1. 建立檔案 ~/.vim/syntax/c.vim
2. 在 c.vim 當中加入
" Highlight Class and Function names
syn match cCustomParen "(" contains=cParen
syn match cCustomFunc "\w\+\s*(" contains=cCustomParen
syn match cCustomScope "::"
syn match cCustomClass "\w\+\s*::" contains=cCustomScope
hi cCustomFunc guifg=yellowgreen
hi cCustomClass guifg=#00FF00
3. 重新啟動 vim
參考資料:
1. class & function names highlighting in Vim - Stack Overflow
...
No comments:
Post a Comment