Skip to content

Instantly share code, notes, and snippets.

@fgarcia
Created October 31, 2014 07:48
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 fgarcia/b1020381c1077a28e0da to your computer and use it in GitHub Desktop.
Save fgarcia/b1020381c1077a28e0da to your computer and use it in GitHub Desktop.
Vim #ruby syntax to highlight sets of keywords
""""""""""""""""""""""""""""""""""""""""
" Keywords
" important, more eye catching
syn keyword rubyTodo DANGER WARNING WAITING TODO contained
hi rubyTodo guifg=magenta ctermfg=magenta gui=bold
" less important, less striking
syntax keyword rubySharpBang SOURCES NOTE FUTURE DFS contained
hi rubySharpBang guifg=darkmagenta ctermfg=darkmagenta gui=bold
" first uppercase word within comments
" syntax match rubySharpBang /# \u\+\($\|\s\)/hs=s+1 contained
" hi rubySharpBang guifg=darkmagenta ctermfg=magenta gui=bold
""""""""""""""""""""""""""""""""""""""""
@fgarcia
Copy link
Author

fgarcia commented Oct 31, 2014

This will highlight keywords within comments

Comment highlight is defined with rubyComment region, which already defines a set of "allowed" subregions. That is the reason I reused rubyTodo and rubySharpBang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment