Skip to content

Instantly share code, notes, and snippets.

@13k
Created March 26, 2010 23:21
Show Gist options
  • Save 13k/345519 to your computer and use it in GitHub Desktop.
Save 13k/345519 to your computer and use it in GitHub Desktop.
"
" CSS 1-line comment helpers
"
" Comments the current line
fun CssComment()
:s@^\(\s*\)\(.*\)$@\1/*\2*/@
endfun
" Un-comment from current line
fun CssUncomment()
:s@^\(\s*\)/\*\(.*\)\*/$@\1\2@
endfun
" Toggles between comment and un-comment
fun ToggleCssComment()
if (match(getline("."), "\s*/\\*.*\\*/") > -1)
call CssUncomment()
else
call CssComment()
end
endfun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment