tomtom / tcomment_vim

An extensible & universal comment vim-plugin that also handles embedded filetypes
http://www.vim.org/scripts/script.php?script_id=1173
GNU General Public License v3.0
1.39k stars 102 forks source link

How to disable (and/or remap) inline comment mappings? #255

Open krishnakumarg1984 opened 4 years ago

krishnakumarg1984 commented 4 years ago

Thank you for the excellent plugin. Here's a small issue/request.

For writing latex documents, I am using the vimtex plugin. The mapping cic of vimtex stands for change in command and is quite helpful to change the command being written

For eg., if ^ points to the current cursor location

\emph{This is an important line}
                           ^ 

cic in normal mode shall put the cursor in the correct location & switching to insert mode

\{This is an important line}
 ^                           

which is super helpful , eg. to make the text bold.

\textbf{This is an important line}

This conflicts with the inline comment mapping of tcomment.

Can you please provide some documentation to

  1. disable
  2. remap

tcomments inline mapping functionality?

tomtom commented 4 years ago

Did you mean gcic? tcomment doesn't use the cic map.

Anyway, you could redefine g:tcomment_opleader1. Please see :h tcomment-operator.

HTH

atomictom commented 4 years ago

I think this is referring to the 'ic' mapping (g:tcomment_textobject_inlinecomment and TComment_ic).

You can disable it by adding:

let g:tcomment_textobject_inlinecomment = ''

to your .vimrc. I also think it's broken: the string concatenation will generate e.g. exec 'omapic <Plug>TComment_ic' rather than exec 'omap ic <Plug>TComment_ic'. You can fix that for now with:

let let g:tcomment_textobject_inlinecomment = ' ic'

But I'll also try sending a pull request.