New answers tagged

1

It seems you're under the impression that the 'commentstring' option can be used to set which character or format is recognized as a comment in Vimscript... But that's not at all what it is about! It's about telling Vim which format is recognized as a comment in the current language (as in, the current filetype), so that if Vim needs to insert a comment ...


1

The vim-commentary plugin uses 'commentstring' to define what a comment should look like. Some languages support multiple comment formats, e.g. // & /* */. Change 'commentstring to match the format that you use set commentstring=//%s However, if a project uses two different formats then you can still it becomes more challenging. I would then suggest ...


1

You might want to consider using the NERD Commenter plug-in, which offers mappings with finer granularity. See the default mappings, you have <Leader>cc to comment a block of code (not toggle) and also <Leader>cn to comment the code, but forces nesting (which makes it easier to uncomment the block and keep the pre-existing comments as such.) You ...


1

Thanks @danidiaz and @Jake, You both seem to be heading down similar paths and I had not even thought of doing it that way. Here's what I came up with as a 2D .vimrc comment display format directly in the .vimrc file. Let me know what you think. " "= GENERIC CLIPBOARD YANK <F2>y (Y for Yank) "= Yank the entire contents of the file into ...


1

A Vim macro is just text stored in a register, which is taken to represent normal mode commands. Perhaps you could write commented Vimscript functions that constructed and returned a command string, like this: func MakeMacro() let l:m = "" " some comment let l:m .= "ifoo" " some other comment let l:m .= &...


Top 50 recent answers are included