This function should be called with autocmd BufEnter * call CommentIt() somewhere after its declaration to be invoked every time the user enters a new buffer. function CommentIt () if &filetype == "vim" vmap +# :s/^/"/ vmap -# :s/^"// elseif &filetype == "tcl" vmap +# :s/^/#/ vmap -# :s/^#// elseif &filetype == "c" vmap +# I/*gva*/ vmap -# I2xgv$h2x elseif &filetype == "cpp" vmap +# Agv:s/^/ *gvIko/*gvAji */ vmap -# :s/^..//gvIddgvAdd elseif &filetype == "dosbatch" vmap +# :s/^/rem / vmap -# :s/^rem // endif endfunction "... autocmd BufEnter * call CommentIt ()
Attributes | Values |
---|---|
rdfs:label |
|
rdfs:comment |
|
Version |
|
dbkwik:vim/property/wikiPageUsesTemplate | |
Previous |
|
Author |
|
Complexity |
|
Created |
|
ID |
|
NEXT |
|
Rating |
|
abstract |
|