blob: 93a46f63e2053b927b420399f62873834ac1c787 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim filetype plugin file
2" Language: sh
Bram Moolenaar1588bc82022-03-08 21:35:07 +00003"
4" This runtime file is looking for a new maintainer.
5"
6" Former maintainer: Dan Sharp
Bram Moolenaar5c736222010-01-06 20:54:52 +01007" Last Changed: 20 Jan 2009
Bram Moolenaar071d4272004-06-13 20:20:40 +00008
9if exists("b:did_ftplugin") | finish | endif
10let b:did_ftplugin = 1
11
12" Make sure the continuation lines below do not cause problems in
13" compatibility mode.
14let s:save_cpo = &cpo
15set cpo-=C
16
17setlocal commentstring=#%s
18
19" Shell: thanks to Johannes Zellner
20if exists("loaded_matchit")
21 let s:sol = '\%(;\s*\|^\s*\)\@<=' " start of line
22 let b:match_words =
23 \ s:sol.'if\>:' . s:sol.'elif\>:' . s:sol.'else\>:' . s:sol. 'fi\>,' .
24 \ s:sol.'\%(for\|while\)\>:' . s:sol. 'done\>,' .
25 \ s:sol.'case\>:' . s:sol. 'esac\>'
26endif
27
28" Change the :browse e filter to primarily show shell-related files.
29if has("gui_win32")
30 let b:browsefilter="Bourne Shell Scripts (*.sh)\t*.sh\n" .
31 \ "Korn Shell Scripts (*.ksh)\t*.ksh\n" .
32 \ "Bash Shell Scripts (*.bash)\t*.bash\n" .
33 \ "All Files (*.*)\t*.*\n"
34endif
35
36" Undo the stuff we changed.
37let b:undo_ftplugin = "setlocal cms< | unlet! b:browsefilter b:match_words"
38
39" Restore the saved compatibility options.
40let &cpo = s:save_cpo
Bram Moolenaar84f72352012-03-11 15:57:40 +010041unlet s:save_cpo