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.4k stars 103 forks source link

[question] how to comment using shortcut like on videos? #268

Closed mandaputtra closed 4 years ago

mandaputtra commented 4 years ago

I'm sorry, I'm noob in vim but how to comment with these plugins? Here the debug info and some videos.

TCOMMENT: &ft = javascript => javascript
TCOMMENT: stx = jsString => javascriptString
TCOMMENT: ct  = {'rxmid': '', 'rxend': '', 'commentstring': '// %s', 'commentstring_rx': '\%%(// %s\|/* %s */\)', 'mode': '', 'filetype': 'javascript', 'replacements': {'*/': {'subst': '|)}>#', 'guard_rx': '^\s*/\?\*'}, '/*': {'subst': '#<{(|', 'guard_rx': '^\s*/\?\*'}}, 'rxbeg': '\*\+'}

Videos showing use of gcc on insert mode.

But if I use, :TComment on the vim-command-terminal it works like charm. Only the shortcut, I can't use it.

And the last one, what is {motion} ?

Thanks for your time and sorry for the question.

mandaputtra commented 4 years ago

Sorry I just ask on the vi.stackexchange.com for better discussion related to question.

tomtom commented 4 years ago

gcc doesn't work in insert mode. You can use (g:tcomment_mapleader1 twice) in insert mode instead.