diff --git a/nvim/dotfiles/plugins-list.vim b/nvim/dotfiles/plugins-list.vim index 3fa3e77..d540517 100644 --- a/nvim/dotfiles/plugins-list.vim +++ b/nvim/dotfiles/plugins-list.vim @@ -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' diff --git a/nvim/plugin/editing.vim b/nvim/plugin/editing.vim index fc11f3a..d53d96a 100644 --- a/nvim/plugin/editing.vim +++ b/nvim/plugin/editing.vim @@ -233,6 +233,18 @@ set commentstring=//%s noremap s s noremap S S + " Remove the mappings that I won't use + let g:tcomment_maps = 0 + + nmap gc TComment_gc + nmap gcc TComment_gcc + nmap gC 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 gCC m'o''TComment_gcb+ + xnoremap gc :TCommentMaybeInline + xnoremap gC :TCommentBlock + " }}}