昨天,今天,明天,每天的每天,你是否都多懂得一点点...

星期二, 九月 01, 2009

VIM syntax

syntax match wine_name /^[^|]\+/ 
syntax match add_desc /\(^[^|]*|\)\@<=[^|]\+/ contains=num
syntax match vintage /\(^[^|]*|[^|]*|\)\@<=[^|]\+/ 
syntax match bottle_size /\(^[^|]*|[^|]*|[^|]*|\)\@<=[^|]\+/ 
syntax match price /\(^[^|]*|[^|]*|[^|]*|[^|]*|\)\@<=[^|]\+/ 
syntax match deep_link /\(^[^|]*|[^|]*|[^|]*|[^|]*|[^|]*|\)\@<=[^|]\+/ 

syntax match num /\d*/ contained

highlight link wine_name cursor 
highlight link add_desc Statement
highlight link vintage include
highlight link bottle_size function
highlight link price lcursor
highlight link deep_link underlined
存为 dat.vim 放在vimfiles\syntax目录下. 在vimrc里加入 autocmd BufRead *.dat :set ft=dat






--
Feng

没有评论:

其它博客地址

此博客的同步博客地址: http://fengnz.wordpress.com
这里进入我的MSN SPACE.