Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim filetype plugin file |
| 2 | " Language: sh |
Bram Moolenaar | 1588bc8 | 2022-03-08 21:35:07 +0000 | [diff] [blame] | 3 | " |
| 4 | " This runtime file is looking for a new maintainer. |
| 5 | " |
| 6 | " Former maintainer: Dan Sharp |
Bram Moolenaar | 5c73622 | 2010-01-06 20:54:52 +0100 | [diff] [blame] | 7 | " Last Changed: 20 Jan 2009 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 8 | |
| 9 | if exists("b:did_ftplugin") | finish | endif |
| 10 | let b:did_ftplugin = 1 |
| 11 | |
| 12 | " Make sure the continuation lines below do not cause problems in |
| 13 | " compatibility mode. |
| 14 | let s:save_cpo = &cpo |
| 15 | set cpo-=C |
| 16 | |
| 17 | setlocal commentstring=#%s |
| 18 | |
| 19 | " Shell: thanks to Johannes Zellner |
| 20 | if 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\>' |
| 26 | endif |
| 27 | |
| 28 | " Change the :browse e filter to primarily show shell-related files. |
| 29 | if 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" |
| 34 | endif |
| 35 | |
| 36 | " Undo the stuff we changed. |
| 37 | let b:undo_ftplugin = "setlocal cms< | unlet! b:browsefilter b:match_words" |
| 38 | |
| 39 | " Restore the saved compatibility options. |
| 40 | let &cpo = s:save_cpo |
Bram Moolenaar | 84f7235 | 2012-03-11 15:57:40 +0100 | [diff] [blame] | 41 | unlet s:save_cpo |