vim: update release.sh to vim 7.3
[msysgit/mtrensch.git] / share / vim / vim72 / ftplugin / hamster.vim
blobddb40f9286aa482f685e6c1519cb5a0c2bf43618
1 " Vim filetype plugin
2 " Language:    Hamster Script
3 " Version:     2.0.6.0
4 " Maintainer:  David Fishburn <fishburn@ianywhere.com>
5 " Last Change: Wed Nov 08 2006 12:03:09 PM
7 " Only do this when not done yet for this buffer
8 if exists("b:did_ftplugin")
9   finish
10 endif
12 " Don't load another plugin for this buffer
13 let b:did_ftplugin = 1
15 let cpo_save = &cpo
16 set cpo-=C
18 let b:undo_ftplugin = "setl fo< com< tw< commentstring<"
19         \ . "| unlet! b:match_ignorecase b:match_words b:match_skip"
21 " Set 'formatoptions' to break comment lines but not other lines,
22 " and insert the comment leader when hitting <CR> or using "o".
23 setlocal fo-=t fo+=croql
25 " Use the # sign for comments
26 setlocal comments=:#
28 " Format comments to be up to 78 characters long
29 if &tw == 0
30   setlocal tw=78
31 endif
33 " Comments start with a double quote
34 setlocal commentstring=#%s
36 " Move around functions.
37 noremap <silent><buffer> [[ :call search('^\s*sub\>', "bW")<CR>
38 noremap <silent><buffer> ]] :call search('^\s*sub\>', "W")<CR>
39 noremap <silent><buffer> [] :call search('^\s*endsub\>', "bW")<CR>
40 noremap <silent><buffer> ][ :call search('^\s*endsub\>', "W")<CR>
42 " Move around comments
43 noremap <silent><buffer> ]# :call search('^\s*#\@!', "W")<CR>
44 noremap <silent><buffer> [# :call search('^\s*#\@!', "bW")<CR>
46 " Let the matchit plugin know what items can be matched.
47 if exists("loaded_matchit")
48   let b:match_ignorecase = 0
49   let b:match_words =
50         \ '\<sub\>:\<return\>:\<endsub\>,' .
51         \ '\<do\|while\|repeat\|for\>:\<break\>:\<continue\>:\<loop\|endwhile\|until\|endfor\>,' .
52         \ '\<if\>:\<else\%[if]\>:\<endif\>' 
54   " Ignore ":syntax region" commands, the 'end' argument clobbers if-endif
55   " let b:match_skip = 'getline(".") =~ "^\\s*sy\\%[ntax]\\s\\+region" ||
56   "     \ synIDattr(synID(line("."),col("."),1),"name") =~? "comment\\|string"'
57 endif
59 setlocal ignorecase
60 let &cpo = cpo_save
61 setlocal cpo+=M         " makes \%( match \)