I looked around the arpanet and wasn’t successful in finding a solution…
Basically I am wanting to have a highlight for whenever those 3 words or more words appear that I define…
andyw8
(Andy Waite)
February 25, 2016, 1:29pm
2
Do you have the vim-ruby plugin installed? It should automatically highlight when them prefixed with a #
:
syn keyword rubyEval eval class_eval instance_eval module_eval
syn keyword rubyException raise fail catch throw
" false positive with 'include?'
syn match rubyInclude "\<include\>[?!]\@!"
syn keyword rubyInclude autoload extend load prepend refine require require_relative using
syn keyword rubyKeyword callcc caller lambda proc
endif
" Comments and Documentation
syn match rubySharpBang "\%^#!.*" display
syn keyword rubyTodo FIXME NOTE TODO OPTIMIZE HACK REVIEW XXX todo contained
syn match rubyComment "#.*" contains=rubySharpBang,rubySpaceError,rubyTodo,@Spell
if !exists("ruby_no_comment_fold")
syn region rubyMultilineComment start="^\s*#.*\n\%(^\s*#\)\@=" end="^\s*#.*\n\%(^\s*#\)\@!" contains=rubyComment transparent fold keepend
syn region rubyDocumentation start="^=begin\ze\%(\s.*\)\=$" end="^=end\%(\s.*\)\=$" contains=rubySpaceError,rubyTodo,@Spell fold
else
syn region rubyDocumentation start="^=begin\s*$" end="^=end\s*$" contains=rubySpaceError,rubyTodo,@Spell
endif
" Note: this is a hack to prevent 'keywords' being highlighted as such when called as methods with an explicit receiver
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(alias\|and\|begin\|break\|case\|class\|def\|defined\|do\|else\)\>" transparent contains=NONE
Don’t use it but is there a way where it can also contain // ?
using ruby.vim would be overkill for just this feature…
I actually got something like this
augroup HiglightTODO autocmd! autocmd WinEnter,VimEnter * :silent! call matchadd('TODO', 'TODO', -1) augroup END
Now how would I change the highlight color , and add new things like FIXME, BUG, REFACTOR ?