1
我想擴展現有的文件類型的文件類型的語法和高亮。我的新文件語法的基本結構如下:擴展VIM文件的語法到另一個文件類型不工作
" Some local (new) syntax that I want to match
syn match upfOperator "[&|~><!)(*#%@+/=?:;}{,.\^\-\[\]]"
syn match upfDefines "\$\S\+"
syn match upfDefines "\${\S\+}"
syn match upfParens "[)(}{\[\]]"
" load syntax that I want to extend. This contains it's own highlight commands
runtime syntax/dtcl.vim
" New highlight statements
hi link upfOperator Statement
hi link upfDefines Constant
hi link upfParens Constant
的問題是,所有包含在dtcl.vim文件語法不突出。我可以打開一個dctl文件並突出顯示。但是,當我打開另一個文件類型(* .upf)時,upf.vim被加載,但不是dtcl.vim。
的dctl.vim不具有會導致文件不加載任何「如果語法定義的」類型的命令。