Custom syntax in VIM: Difference between revisions

Jump to navigation Jump to search
no edit summary
(Created page with "In VIM, you can define a custom syntax to display comments differently from XDS parameters. This aids legibility. * create file ~/.vim/syntax/inp.vim syntax match XDS_Commen...")
 
No edit summary
 
Line 1: Line 1:
In VIM, you can define a custom syntax to display comments differently from XDS parameters. This aids legibility.
In VIM, you can define a custom syntax to display comments differently from XDS parameters. This aids legibility.


* create file ~/.vim/syntax/inp.vim
* put
  syntax match XDS_Comment /!.*$/
  syntax match XDS_Comment /!.*$/
* create file ~/.vim/ftdetect/inp.vim
: into ~/.vim/syntax/inp.vim (create file if it doesn't exist)
 
* put
  autocmd BufRead,BufNewFile *.INP set filetype=inp
  autocmd BufRead,BufNewFile *.INP set filetype=inp
* create file ~/.vimrc
: into ~/.vim/ftdetect/inp.vim (create file if it doesn't exist)
 
* put
  highlight def link XDS_Comment Comment
  highlight def link XDS_Comment Comment
: into ~/.vimrc (create file if it doesn't exist)
18

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu