Skip to content

Instantly share code, notes, and snippets.

@Raimondi
Created October 26, 2011 22:27
Show Gist options
  • Save Raimondi/1318204 to your computer and use it in GitHub Desktop.
Save Raimondi/1318204 to your computer and use it in GitHub Desktop.
Some useful snippets for Vim syntax.
" Name of syntax item under the cursor
nore <leader>n :echo synIDattr(synID(line("."), col("."), 1), "name")<CR>
" Syntax stack of item under the cursor
nnore <leader>s :<C-U>echo join(map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")'), ' => ')<CR>
" Color of syntax item under the cursor
echo synIDattr(synIDtrans(synID(line("."), col("."), 1)), "fg")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment