October 15, 2008

Add bracket match of CS (clearsilver) file in VIM

1. download matchit.zip for vim (script 39) and install it following the instruction
2. disable the vim default cs (c sharp) filetype plugin by doing:
cd /usr/share/vim/vim63/ftplugin/
sudo mv cs.vim csharp.vim
3. create out own cs filetype flugin
mkdir ~/.vim/ftplugin
vi cs.vim, and enter the following line:
:let b:match_words='<:>,<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td ]\>:<\@<=/dl>,<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'

4. done! now press % match < > and things like

No comments:

Post a Comment