Mercurial > vim
comparison runtime/doc/syntax.txt @ 10261:bdd7fc1a38c0
commit https://github.com/vim/vim/commit/dc08328821a2c11e33dfb1980332e4923ec64fca
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Oct 11 08:57:33 2016 +0200
Updated runtime files.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 12 Oct 2016 12:15:04 +0200 |
parents | 876fbdd84e52 |
children | 169a62d5bcb9 |
comparison
equal
deleted
inserted
replaced
10260:2fff06882079 | 10261:bdd7fc1a38c0 |
---|---|
2861 let sgml_no_rendering=1 | 2861 let sgml_no_rendering=1 |
2862 | 2862 |
2863 (Adapted from the html.vim help text by Claudio Fleiner <claudio@fleiner.com>) | 2863 (Adapted from the html.vim help text by Claudio Fleiner <claudio@fleiner.com>) |
2864 | 2864 |
2865 | 2865 |
2866 SH *sh.vim* *ft-sh-syntax* *ft-bash-syntax* *ft-ksh-syntax* | 2866 *ft-posix-synax* *ft-dash-syntax* |
2867 | 2867 SH *sh.vim* *ft-sh-syntax* *ft-bash-syntax* *ft-ksh-syntax* |
2868 This covers the "normal" Unix (Bourne) sh, bash and the Korn shell. | 2868 |
2869 This covers syntax highlighting for the older Unix (Bourne) sh, and newer | |
2870 shells such as bash, dash, posix, and the Korn shells. | |
2869 | 2871 |
2870 Vim attempts to determine which shell type is in use by specifying that | 2872 Vim attempts to determine which shell type is in use by specifying that |
2871 various filenames are of specific types: > | 2873 various filenames are of specific types: > |
2872 | 2874 |
2873 ksh : .kshrc* *.ksh | 2875 ksh : .kshrc* *.ksh |
2874 bash: .bashrc* bashrc bash.bashrc .bash_profile* *.bash | 2876 bash: .bashrc* bashrc bash.bashrc .bash_profile* *.bash |
2875 < | 2877 < |
2876 If none of these cases pertain, then the first line of the file is examined | 2878 If none of these cases pertain, then the first line of the file is examined |
2877 (ex. /bin/sh /bin/ksh /bin/bash). If the first line specifies a shelltype, | 2879 (ex. looking for /bin/sh /bin/ksh /bin/bash). If the first line specifies a |
2878 then that shelltype is used. However some files (ex. .profile) are known to | 2880 shelltype, then that shelltype is used. However some files (ex. .profile) are |
2879 be shell files but the type is not apparent. Furthermore, on many systems | 2881 known to be shell files but the type is not apparent. Furthermore, on many |
2880 sh is symbolically linked to "bash" (Linux, Windows+cygwin) or "ksh" (Posix). | 2882 systems sh is symbolically linked to "bash" (Linux, Windows+cygwin) or "ksh" |
2881 | 2883 (Posix). |
2882 One may specify a global default by instantiating one of the following three | 2884 |
2885 One may specify a global default by instantiating one of the following | |
2883 variables in your <.vimrc>: | 2886 variables in your <.vimrc>: |
2884 | 2887 |
2885 ksh: > | 2888 ksh: > |
2886 let g:is_kornshell = 1 | 2889 let g:is_kornshell = 1 |
2887 < posix: (using this is the same as setting is_kornshell to 1) > | 2890 < posix: (using this is the nearly the same as setting g:is_kornshell to 1) > |
2888 let g:is_posix = 1 | 2891 let g:is_posix = 1 |
2889 < bash: > | 2892 < bash: > |
2890 let g:is_bash = 1 | 2893 let g:is_bash = 1 |
2891 < sh: (default) Bourne shell > | 2894 < sh: (default) Bourne shell > |
2892 let g:is_sh = 1 | 2895 let g:is_sh = 1 |
2893 | 2896 |
2897 < (dash users should use posix) | |
2898 | |
2894 If there's no "#! ..." line, and the user hasn't availed himself/herself of a | 2899 If there's no "#! ..." line, and the user hasn't availed himself/herself of a |
2895 default sh.vim syntax setting as just shown, then syntax/sh.vim will assume | 2900 default sh.vim syntax setting as just shown, then syntax/sh.vim will assume |
2896 the Bourne shell syntax. No need to quote RFCs or market penetration | 2901 the Bourne shell syntax. No need to quote RFCs or market penetration |
2897 statistics in error reports, please -- just select the default version of the | 2902 statistics in error reports, please -- just select the default version of the |
2898 sh your system uses in your <.vimrc>. | 2903 sh your system uses and install the associated "let..." in your <.vimrc>. |
2899 | 2904 |
2900 The syntax/sh.vim file provides several levels of syntax-based folding: > | 2905 The syntax/sh.vim file provides several levels of syntax-based folding: > |
2901 | 2906 |
2902 let g:sh_fold_enabled= 0 (default, no syntax folding) | 2907 let g:sh_fold_enabled= 0 (default, no syntax folding) |
2903 let g:sh_fold_enabled= 1 (enable function folding) | 2908 let g:sh_fold_enabled= 1 (enable function folding) |
2904 let g:sh_fold_enabled= 2 (enable heredoc folding) | 2909 let g:sh_fold_enabled= 2 (enable heredoc folding) |
2905 let g:sh_fold_enabled= 4 (enable if/do/for folding) | 2910 let g:sh_fold_enabled= 4 (enable if/do/for folding) |
2906 > | 2911 > |
2907 then various syntax items (HereDocuments and function bodies) become | 2912 then various syntax items (ie. HereDocuments and function bodies) become |
2908 syntax-foldable (see |:syn-fold|). You also may add these together | 2913 syntax-foldable (see |:syn-fold|). You also may add these together |
2909 to get multiple types of folding: > | 2914 to get multiple types of folding: > |
2910 | 2915 |
2911 let g:sh_fold_enabled= 3 (enables function and heredoc folding) | 2916 let g:sh_fold_enabled= 3 (enables function and heredoc folding) |
2912 | 2917 |
2926 let sh_maxlines = 100 | 2931 let sh_maxlines = 100 |
2927 < | 2932 < |
2928 The default is to use the twice sh_minlines. Set it to a smaller number to | 2933 The default is to use the twice sh_minlines. Set it to a smaller number to |
2929 speed up displaying. The disadvantage is that highlight errors may appear. | 2934 speed up displaying. The disadvantage is that highlight errors may appear. |
2930 | 2935 |
2931 *g:sh_isk* *g:sh_noisk* | 2936 |
2932 The shell languages appear to let "." be part of words, commands, etc; | |
2933 consequently it should be in the isk for sh.vim. As of v116 of syntax/sh.vim, | |
2934 syntax/sh.vim will append the "." to |'iskeyword'| by default; you may control | |
2935 this behavior with: > | |
2936 let g:sh_isk = '..whatever characters you want as part of iskeyword' | |
2937 let g:sh_noisk= 1 " otherwise, if this exists, the isk will NOT chg | |
2938 < | |
2939 *sh-embed* *sh-awk* | 2937 *sh-embed* *sh-awk* |
2940 Sh: EMBEDDING LANGUAGES~ | 2938 Sh: EMBEDDING LANGUAGES~ |
2941 | 2939 |
2942 You may wish to embed languages into sh. I'll give an example courtesy of | 2940 You may wish to embed languages into sh. I'll give an example courtesy of |
2943 Lorance Stinson on how to do this with awk as an example. Put the following | 2941 Lorance Stinson on how to do this with awk as an example. Put the following |