Skip to content

Instantly share code, notes, and snippets.

@arnsholt
Created October 10, 2012 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arnsholt/3866515 to your computer and use it in GitHub Desktop.
Save arnsholt/3866515 to your computer and use it in GitHub Desktop.
vimrc snippet
function! Printit()
echo synIDattr(synID(line("."), col("."), 1), "name") "(".synID(line("."), col("."), 1).")"
endfunction
map <expr> <F2> Printit()
function! NonComment(nonComment, comment, style)
let cur = synIDattr(synID(line("."), col("."), 1), "name")
if a:style == cur
return a:comment
else
return a:nonComment
endif
endfunction
au FileType tex inoremap <expr> æ NonComment("{\\ae}", "æ", "texComment")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment