Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/tags
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@ tcomment-debug tcomment.txt /*tcomment-debug*
tcomment-maps tcomment.txt /*tcomment-maps*
tcomment-new-filetype tcomment.txt /*tcomment-new-filetype*
tcomment-operator tcomment.txt /*tcomment-operator*
tcomment-textobject tcomment.txt /*tcomment-textobject*
tcomment.txt tcomment.txt /*tcomment.txt*
12 changes: 12 additions & 0 deletions doc/tcomment.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ A secondary set of key maps is defined for normal and insert mode (see also
<Leader>__ :: :TComment
<Leader>_i :: :TCommentInline

*tcomment-textobject*

A text object is also added for selecting an inner-comment:

{operator}ic :: Operate on the inner comment. The mapping can be changed
using the `g:tcomment_textobject_inlinecomment` variable
or disabled by setting it to the empty string, `''`.



-----------------------------------------------------------------------
Expand Down Expand Up @@ -256,6 +264,10 @@ g:tcomment_mapleader_uncomment_anyway (default: 'g<')
g:tcomment_mapleader_comment_anyway (default: 'g>')
See |tcomment-operator|.

*g:tcomment_textobject_inlinecomment*
g:tcomment_textobject_inlinecomment (default: 'ic')
See |tcomment-textobject|.

*:TComment*
:[range]TComment[!] ?ARGS...
If there is a visual selection that begins and ends in the same line,
Expand Down
4 changes: 2 additions & 2 deletions plugin/tcomment.vim
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@ if g:tcomment_maps
exec 'xmap '. g:tcomment_mapleader_comment_anyway .' <Plug>TComment_Comment'
endif
if g:tcomment_textobject_inlinecomment != ''
exec 'vmap' g:tcomment_textobject_inlinecomment ' <Plug>TComment_ic'
exec 'omap' g:tcomment_textobject_inlinecomment ' <Plug>TComment_ic'
exec 'vmap '. g:tcomment_textobject_inlinecomment .' <Plug>TComment_ic'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need for the extra period here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did that to be consistent with the code a few lines above (all the other mappings use dots for string concat). But, I can remove it if you prefer (just let me know).

exec 'omap '. g:tcomment_textobject_inlinecomment .' <Plug>TComment_ic'
endif
endif

Expand Down