2

I'm new to nvim and I have some questions when I use nvim

  1. I often work with Javascript and I want nvim can tab automatically like VS Code when I press enter. How can I do that?
  2. How can I cut/copy/paste with clipboard in Neovim, Should I use some plugin?

This is some Pluging I'm using:

Plug 'preservim/nerdtree'
Plug 'drewtempelmeyer/palenight.vim'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'pangloss/vim-javascript'
Plug 'w0rp/ale'
Plug 'prettier/vim-prettier', { 'do': 'npm install' }
Plug 'yuezk/vim-js'
Plug 'maxmellon/vim-jsx-pretty'
Plug 'kassio/neoterm'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-fugitive'
Plug 'alvan/vim-closetag'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'raimondi/delimitmate'
Plug 'ekalinin/dockerfile.vim'
Plug 'scrooloose/nerdcommenter'

Thanks for any helps.

Share a link to this question
CC BY-SA 4.0
4

For auto tab, I suppose you mean auto indentation. You can turn on autoindent and smartindent option.

set autoindent smartindent

To use clipboard for cut and paste, set clipboard option

set clipboard+=unnamedplus

See :h clipboard for more info.

Share a link to this answer
CC BY-SA 4.0
1
  • Thanks, set clipboard+=unnamedplus worked for me. Remember everyone, the paste command is p, and the copy command is #yy (where # is the number of lines you want to copy). The copy command (yank) is also :#1,#2y, where #1 is the start line and #2 is the end line. You can also make a selection with visual block (ctrl+v) or select (gh) then yank the selected text with y.
    – Rublacava
    1 min ago

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.