an Entity in Data Space: 134.155.108.49:8890
In this piece of code, we try to get the extension of the file, and based on that, decide what kind of comment is to be applied. Save the following in a file named vcomments.vim. function! Comment() let ext = tolower(expand('%:e')) if ext == 'php' || ext == 'rb' || ext == 'sh' || ext == 'py' silent s/^/\#/ elseif ext == 'js' silent s:^:\/\/:g elseif ext == 'vim' silent s:^:\":g endif endfunction function! Uncomment() let ext = tolower(expand('%:e')) if ext == 'php' || ext == 'rb' || ext == 'sh' || ext == 'py' silent s/^\#// elseif ext == 'js' silent s:^\/\/::g elseif ext == 'vim' silent s:^\"::g endif endfunction
Entity | Attribute | Value | Rank |
---|