[nvim] use tcomment.vim instead of vim-commentary

This commit is contained in:
Dmytro Meleshko 2021-04-23 17:41:11 +03:00
parent 0221e6c08c
commit 4d42627b83
2 changed files with 17 additions and 1 deletions

View file

@ -12,7 +12,11 @@
endif
Plug 'Raimondi/delimitMate'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-commentary'
" if g:vim_ide
Plug 'tomtom/tcomment_vim'
" else
" Plug 'tpope/vim-commentary'
" endif
Plug 'tpope/vim-surround'
Plug 'Yggdroot/indentLine'
Plug 'idbrii/detectindent'

View file

@ -233,6 +233,18 @@ set commentstring=//%s
noremap <leader>s s
noremap <leader>S S
" Remove the mappings that I won't use
let g:tcomment_maps = 0
nmap <silent> gc <Plug>TComment_gc
nmap <silent> gcc <Plug>TComment_gcc
nmap <silent> gC <Plug>TComment_gcb
" The default block commenting mapping refuses to work on a single line, as
" a workaround I give it another empty one to work with.
nmap <silent> gCC m'o<Esc>''<Plug>TComment_gcb+
xnoremap <silent> gc :TCommentMaybeInline<CR>
xnoremap <silent> gC :TCommentBlock<CR>
" }}}