Skip to content

Instantly share code, notes, and snippets.

" toggle comment line
function! SetCommentPrefix()
let s:comment_prefix = "#"
if &filetype == "vim"
" for vim, inline comment start with \"
let s:comment_prefix = "\""
elseif &filetype ==? "c" || &filetype ==? "objc" || &filetype ==? "cpp"
let s:comment_prefix = "//"
endif