tcomment_vim icon indicating copy to clipboard operation
tcomment_vim copied to clipboard

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

Open krishnakumarg1984 opened this issue 5 years ago • 2 comments

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?

krishnakumarg1984 avatar Oct 05 '19 12:10 krishnakumarg1984

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

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

HTH

tomtom avatar Oct 06 '19 04:10 tomtom

I think this is referring to the 'ic' mapping (g:tcomment_textobject_inlinecomment and <Plug>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.

atomictom avatar Dec 30 '19 19:12 atomictom