summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-04-06 20:18:50 +0000
committerBram Moolenaar <Bram@vim.org>2006-04-06 20:18:50 +0000
commit8dff818edfb61658b94128111234c3c074c1cadc (patch)
treeed09901efe925ec1b065c8dbd4cd94165b01cf6f /runtime
parent910f66f90c928da8b607ccfdc12fc33d9cb8d4a9 (diff)
downloadvim-git-8dff818edfb61658b94128111234c3c074c1cadc.tar.gz
updated for version 7.0c11
Diffstat (limited to 'runtime')
-rw-r--r--runtime/autoload/netrw.vim17
-rw-r--r--runtime/doc/editing.txt4
-rw-r--r--runtime/doc/index.txt4
-rw-r--r--runtime/doc/insert.txt5
-rw-r--r--runtime/doc/pi_netrw.txt5
-rw-r--r--runtime/doc/spell.txt45
-rw-r--r--runtime/doc/tabpage.txt5
-rw-r--r--runtime/doc/tags2
-rw-r--r--runtime/doc/windows.txt11
-rw-r--r--runtime/syntax/make.vim32
-rw-r--r--runtime/syntax/sh.vim26
11 files changed, 102 insertions, 54 deletions
diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim
index 00a3f3e87..7f4bd64e4 100644
--- a/runtime/autoload/netrw.vim
+++ b/runtime/autoload/netrw.vim
@@ -1,7 +1,7 @@
" netrw.vim: Handles file transfer and remote directory listing across a network
" AUTOLOAD PORTION
-" Date: Mar 31, 2006
-" Version: 84
+" Date: Apr 06, 2006
+" Version: 86
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
@@ -23,7 +23,7 @@
if &cp || exists("g:loaded_netrw")
finish
endif
-let g:loaded_netrw = "v84"
+let g:loaded_netrw = "v86"
if v:version < 700
echohl WarningMsg | echo "***netrw*** you need vim version 7.0 or later for version ".g:loaded_netrw." of netrw" | echohl None
finish
@@ -457,8 +457,7 @@ fun! netrw#NetRead(mode,...)
" ftp + <.netrc>: NetRead Method #2 {{{3
elseif b:netrw_method == 2 " read with ftp + <.netrc>
" call Decho("read via ftp+.netrc (method #2)")
- let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape)
-" call Decho("netrw_fname<".netrw_fname.">")
+ let netrw_fname= b:netrw_fname
new
setlocal ff=unix
exe "put ='".g:netrw_ftpmode."'"
@@ -3388,6 +3387,7 @@ fun! s:LocalFastBrowser()
au!
au ShellCmdPost,FocusGained * call s:LocalBrowseShellCmdRefresh()
augroup END
+ endif
" user must have changed fastbrowse to its fast setting, so remove
" the associated autocmd events
@@ -4098,7 +4098,12 @@ fun! s:SetSort()
let priority = priority + 1
endwhile
- exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^\(\d\{3}\/\)\%(\d\{3}\/\)\+/\1/e'
+ " I'm afraid that I don't remember why the following line was present. It
+ " has something to do with priority -- items that satisfy a two or more
+ " priority patterns get preceded by two or more priority patterns: ###/
+ " So, I want to remove priority patterns, but not ###/ directory names.
+ " Following pattern retains just one priority pattern.
+ exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^\(\d\{3}\/\)\%(\d\{3}\/\)\+\ze./\1/e'
" call Dret("SetSort")
endfun
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index eecdd8615..8a9497a21 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -1,4 +1,4 @@
-*editing.txt* For Vim version 7.0c. Last change: 2006 Apr 02
+*editing.txt* For Vim version 7.0c. Last change: 2006 Apr 06
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -313,6 +313,8 @@ CTRL-^ Edit the alternate file (equivalent to ":e #").
in the 'path' is edited.
This command fails if Vim refuses to |abandon| the
current file.
+ If you want to edit the file in a new window use
+ |CTRL-W_CTRL-F|.
If you do want to edit a new file, use: >
:e <cfile>
< To make gf always work like that: >
diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index f1647599b..215c3c1f9 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -1,4 +1,4 @@
-*index.txt* For Vim version 7.0c. Last change: 2006 Mar 24
+*index.txt* For Vim version 7.0c. Last change: 2006 Apr 06
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -549,6 +549,8 @@ tag command action in Normal mode ~
|CTRL-W_g]| CTRL-W g ] split window and do |:tselect| for tag
under cursor
|CTRL-W_g}| CTRL-W g } do a |:ptjump| to the tag under the cursor
+|CTRL-W_gf| CTRL-W g f edit file name under the cursor in a new
+ tab page
|CTRL-W_h| CTRL-W h go to Nth left window (stop at first window)
|CTRL-W_i| CTRL-W i split window and jump to declaration of
identifier under the cursor
diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt
index 417a4b325..5ffc8a85d 100644
--- a/runtime/doc/insert.txt
+++ b/runtime/doc/insert.txt
@@ -1,4 +1,4 @@
-*insert.txt* For Vim version 7.0c. Last change: 2006 Apr 05
+*insert.txt* For Vim version 7.0c. Last change: 2006 Apr 06
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1007,7 +1007,8 @@ items:
word the text that will be inserted, mandatory
abbr abbreviation of "word"; when not empty it is used in
the menu instead of "word"
- menu extra text for the popup menu, after "word" or "abbr"
+ menu extra text for the popup menu, displayed after "word"
+ or "abbr"
info more information about the item, can be displayed in a
preview window
kind single letter indicating the type of completion
diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt
index bc9af21f9..c577ed584 100644
--- a/runtime/doc/pi_netrw.txt
+++ b/runtime/doc/pi_netrw.txt
@@ -1,4 +1,4 @@
-*pi_netrw.txt* For Vim version 7.0c. Last change: Mar 22, 2006
+*pi_netrw.txt* For Vim version 7.0c. Last change: Apr 06, 2006
VIM REFERENCE MANUAL by Charles E. Campbell, Jr.
@@ -1448,6 +1448,9 @@ which is loaded automatically at startup (assuming :set nocp).
==============================================================================
11. History *netrw-history* {{{1
+ v85: * bug fix -- missing an endif
+ * bug fix -- handles spaces in names and directories when using
+ ftp-based browsing
v83: * disabled stop-acd handling; the change in directory handling
may allow acd to be used again. Awaiting feedback.
* D was refusing to delete remote files/directories in wide
diff --git a/runtime/doc/spell.txt b/runtime/doc/spell.txt
index f76ab51e8..ebfecbcc3 100644
--- a/runtime/doc/spell.txt
+++ b/runtime/doc/spell.txt
@@ -1,4 +1,4 @@
-*spell.txt* For Vim version 7.0c. Last change: 2006 Apr 03
+*spell.txt* For Vim version 7.0c. Last change: 2006 Apr 06
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -712,7 +712,7 @@ accepted. This is different from a word with mixed case that is automatically
marked as keep-case, those words may appear in all upper-case letters.
-FORMAT WITH .AFF and .DIC FILES
+FORMAT WITH .AFF AND .DIC FILES *aff-dic-format*
There are two files: the basic word list and an affix file. The affix file
specifies settings for the language and can contain affixes. The affixes are
@@ -1033,7 +1033,7 @@ AFFIX FLAGS *spell-affix-flags*
This is a feature that comes from Hunspell: The affix may specify flags. This
works similar to flags specified on a basic word. The flags apply to the
-basic word plus the affix. Example:
+basic word plus the affix (but there are restrictions). Example:
SFX S Y 1 ~
SFX S 0 s . ~
@@ -1054,14 +1054,33 @@ only used once for affixes, except that both one prefix and one suffix can be
used when both support combining.
Specifically, the affix flags can be used for:
-- Affixes on affixes, as in the example above.
+- Suffixes on suffixes, as in the example above. This works once, thus you
+ can have two suffixes on a word (plus one prefix).
- Making the word with the affix rare, by using the |spell-RARE| flag.
- Exclude the word with the affix from compounding, by using the
|spell-COMPOUNDFORBIDFLAG| flag.
- Allow the word with the affix to be part of a compound word on the side of
the affix with the |spell-COMPOUNDPERMITFLAG|.
+- Use the NEEDCOMPOUND flag: word plus affix can only be used as part of a
+ compound word. |spell-NEEDCOMPOUND|
+- Compound flags: word plus affix can be part of a compound word at the end,
+ middle, start, etc. The flags are combined with the flags of the basic
+ word. |spell-compound|
+- NEEDAFFIX: another affix is needed to make a valid word.
+- CIRCUMFIX, as explained just below.
+
+
+CIRCUMFIX *spell-CIRCUMFIX*
+
+The CIRCUMFIX flag means a prefix and suffix must be added at the same time.
+If a prefix has the CIRCUMFIX flag than only suffixes with the CIRCUMFIX flag
+can be added, and the other way around.
+An alternative is to only specify the suffix, and give the that suffix two
+flags: The required prefix and the NEEDAFFIX flag. |spell-NEEDAFFIX|
+
+
+PFXPOSTPONE *spell-PFXPOSTPONE*
- *spell-PFXPOSTPONE*
When an affix file has very many prefixes that apply to many words it's not
possible to build the whole word list in memory. This applies to Hebrew (a
list with all words is over a Gbyte). In that case applying prefixes must be
@@ -1070,11 +1089,11 @@ in the .aff file:
PFXPOSTPONE ~
-Only prefixes without a chop string can be postponed, prefixes with a chop
-string will still be included in the word list. An exception if the chop
-string is one character and equal to the last character of the added string,
-but in lower case. Thus when the chop string is used to allow the following
-word to start with an upper case letter.
+Only prefixes without a chop string and without flags can be postponed.
+Prefixes with a chop string or with flags will still be included in the word
+list. An exception if the chop string is one character and equal to the last
+character of the added string, but in lower case. Thus when the chop string
+is used to allow the following word to start with an upper case letter.
WORDS WITH A SLASH *spell-SLASH*
@@ -1477,12 +1496,6 @@ CHECKCOMPOUNDTRIPLE (Hunspell) *spell-CHECKCOMPOUNDTRIPLE*
CHECKCOMPOUNDPATTERN (Hunspell) *spell-CHECKCOMPOUNDPATTERN*
Forbid compounding when patterns match. Not supported.
-CIRCUMFIX (Hunspell) *spell-CIRCUMFIX*
- This means a prefix and suffix must be added at the same time.
- Instead only specify the suffix, and give the that suffix two
- flags: The required prefix and the NEEDAFFIX flag.
- |spell-NEEDAFFIX|
-
COMPLEXPREFIXES (Hunspell) *spell-COMPLEXPREFIXES*
Enables using two prefixes. Not supported.
diff --git a/runtime/doc/tabpage.txt b/runtime/doc/tabpage.txt
index db51d843e..5439fd4db 100644
--- a/runtime/doc/tabpage.txt
+++ b/runtime/doc/tabpage.txt
@@ -1,4 +1,4 @@
-*tabpage.txt* For Vim version 7.0c. Last change: 2006 Mar 31
+*tabpage.txt* For Vim version 7.0c. Last change: 2006 Apr 06
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -79,6 +79,9 @@ In the GUI tab pages line you can use the right mouse button to open menu.
:tab split " opens current buffer in new tab page
:tab help gt " opens tab page with help for "gt"
+CTRL-W gf Open a new tab page and edit the file name under the cursor.
+ See |CTRL-W_gf|.
+
CLOSING A TAB PAGE:
diff --git a/runtime/doc/tags b/runtime/doc/tags
index 3e2de485a..4134a1da1 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -3199,6 +3199,7 @@ CTRL-W_d tagsrch.txt /*CTRL-W_d*
CTRL-W_f windows.txt /*CTRL-W_f*
CTRL-W_g] windows.txt /*CTRL-W_g]*
CTRL-W_g_CTRL-] windows.txt /*CTRL-W_g_CTRL-]*
+CTRL-W_gf windows.txt /*CTRL-W_gf*
CTRL-W_g} windows.txt /*CTRL-W_g}*
CTRL-W_h windows.txt /*CTRL-W_h*
CTRL-W_i tagsrch.txt /*CTRL-W_i*
@@ -4430,6 +4431,7 @@ added-options version5.txt /*added-options*
added-regexp version5.txt /*added-regexp*
added-various version5.txt /*added-various*
added-win32-GUI version5.txt /*added-win32-GUI*
+aff-dic-format spell.txt /*aff-dic-format*
after-directory options.txt /*after-directory*
aleph options.txt /*aleph*
alt intro.txt /*alt*
diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt
index b6db5404f..fbc3e7888 100644
--- a/runtime/doc/windows.txt
+++ b/runtime/doc/windows.txt
@@ -1,4 +1,4 @@
-*windows.txt* For Vim version 7.0c. Last change: 2006 Apr 01
+*windows.txt* For Vim version 7.0c. Last change: 2006 Apr 06
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -707,7 +707,7 @@ CTRL-W g CTRL-] Split current window in two. Use identifier under cursor as a
CTRL-W f *CTRL-W_f* *CTRL-W_CTRL-F*
CTRL-W CTRL-F Split current window in two. Edit file name under cursor.
- Like ":split ]f", but window isn't split if the file does not
+ Like ":split gf", but window isn't split if the file does not
exist.
Uses the 'path' variable as a list of directory names where to
look for the file. Also the path for current file is
@@ -723,6 +723,13 @@ CTRL-W F *CTRL-W_F*
jump to the line number following the file name. See |gF| for
details on how the line number is obtained.
+CTRL-W gf *CTRL-W_gf*
+ Open a new tab page and edit the file name under the cursor.
+ Like "tab split" and "gf", but the new tab page isn't created
+ if the file does not exist.
+ {not available when the |+file_in_path| feature was disabled
+ at compile time}
+
Also see |CTRL-W_CTRL-I|: open window for an included file that includes
the keyword under the cursor.
diff --git a/runtime/syntax/make.vim b/runtime/syntax/make.vim
index aba073ee5..4d3b0df45 100644
--- a/runtime/syntax/make.vim
+++ b/runtime/syntax/make.vim
@@ -2,7 +2,7 @@
" Language: Makefile
" Maintainer: Claudio Fleiner <claudio@fleiner.com>
" URL: http://www.fleiner.com/vim/syntax/make.vim
-" Last Change: 2005 Apr 17
+" Last Change: 2006 Apr 5
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
@@ -13,15 +13,15 @@ elseif exists("b:current_syntax")
endif
" some special characters
-syn match makeSpecial "^\s*[@-]\+"
+syn match makeSpecial "^\s*[@+-]\+"
syn match makeNextLine "\\\n\s*"
" some directives
-syn match makePreCondit "^\s*\(ifeq\>\|else\>\|endif\>\|ifneq\>\|ifdef\>\|ifndef\>\)"
-syn match makeInclude "^\s*[-s]\=include"
-syn match makeStatement "^\s*vpath"
-syn match makeExport "^\s*\(export\|unexport\)\>"
-syn match makeOverride "^\s*override"
+syn match makePreCondit "^ *\(ifeq\>\|else\>\|endif\>\|ifneq\>\|ifdef\>\|ifndef\>\)"
+syn match makeInclude "^ *[-s]\=include"
+syn match makeStatement "^ *vpath"
+syn match makeExport "^ *\(export\|unexport\)\>"
+syn match makeOverride "^ *override"
hi link makeOverride makeStatement
hi link makeExport makeStatement
@@ -30,8 +30,8 @@ syn region makeDefine start="^\s*define\s" end="^\s*endef\s*$" contains=makeStat
" Microsoft Makefile specials
syn case ignore
-syn match makeInclude "^!\s*include"
-syn match makePreCondit "!\s*\(cmdswitches\|error\|message\|include\|if\|ifdef\|ifndef\|else\|elseif\|else if\|else\s*ifdef\|else\s*ifndef\|endif\|undef\)\>"
+syn match makeInclude "^! *include"
+syn match makePreCondit "! *\(cmdswitches\|error\|message\|include\|if\|ifdef\|ifndef\|else\|elseif\|else if\|else\s*ifdef\|else\s*ifndef\|endif\|undef\)\>"
syn case match
" identifiers
@@ -39,8 +39,8 @@ syn region makeIdent start="\$(" skip="\\)\|\\\\" end=")" contains=makeStatement
syn region makeIdent start="\${" skip="\\}\|\\\\" end="}" contains=makeStatement,makeIdent,makeSString,makeDString
syn match makeIdent "\$\$\w*"
syn match makeIdent "\$[^({]"
-syn match makeIdent "^\s*\a\w*\s*[:+?!*]="me=e-2
-syn match makeIdent "^\s*\a\w*\s*="me=e-1
+syn match makeIdent "^ *\a\w*\s*[:+?!*]="me=e-2
+syn match makeIdent "^ *\a\w*\s*="me=e-1
syn match makeIdent "%"
" Makefile.in variables
@@ -54,8 +54,8 @@ syn match makeImplicit "^\.[A-Za-z0-9_./\t -]\+\s*:$"me=e-1 nextgroup=makeSourc
syn region makeTarget transparent matchgroup=makeTarget start="^[A-Za-z0-9_./$()%-][A-Za-z0-9_./\t $()%-]*:\{1,2}[^:=]"rs=e-1 end=";"re=e-1,me=e-1 end="[^\\]$" keepend contains=makeIdent,makeSpecTarget,makeNextLine skipnl nextGroup=makeCommands
syn match makeTarget "^[A-Za-z0-9_./$()%*@-][A-Za-z0-9_./\t $()%*@-]*::\=\s*$" contains=makeIdent,makeSpecTarget skipnl nextgroup=makeCommands,makeCommandError
-syn region makeSpecTarget transparent matchgroup=makeSpecTarget start="^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>:\{1,2}[^:=]"rs=e-1 end="[^\\]$" keepend contains=makeIdent,makeSpecTarget,makeNextLine skipnl nextGroup=makeCommands
-syn match makeSpecTarget "^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>::\=\s*$" contains=makeIdent skipnl nextgroup=makeCommands,makeCommandError
+syn region makeSpecTarget transparent matchgroup=makeSpecTarget start="^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>\s*:\{1,2}[^:=]"rs=e-1 end="[^\\]$" keepend contains=makeIdent,makeSpecTarget,makeNextLine skipnl nextGroup=makeCommands
+syn match makeSpecTarget "^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>\s*::\=\s*$" contains=makeIdent skipnl nextgroup=makeCommands,makeCommandError
syn match makeCommandError "^\s\+\S.*" contained
syn region makeCommands start=";"hs=s+1 start="^\t" end="^[^\t#]"me=e-1,re=e-1 end="^$" contained contains=makeCmdNextLine,makeSpecial,makeComment,makeIdent,makePreCondit,makeDefine,makeDString,makeSString nextgroup=makeCommandError
@@ -67,9 +67,9 @@ syn match makeStatement contained "(\(subst\|addprefix\|addsuffix\|basename\|cal
" Comment
if exists("make_microsoft")
- syn match makeComment "#.*" contains=makeTodo,@Spell
-else
- syn region makeComment start="#" end="^$" end="[^\\]$" keepend contains=makeTodo,@Spell
+ syn match makeComment "#.*" contains=makeTodo
+elseif !exists("make_no_comments")
+ syn region makeComment start="#" end="^$" end="[^\\]$" keepend contains=makeTodo
syn match makeComment "#$"
endif
syn keyword makeTodo TODO FIXME XXX contained
diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim
index ee029e23d..8e20b9881 100644
--- a/runtime/syntax/sh.vim
+++ b/runtime/syntax/sh.vim
@@ -2,8 +2,8 @@
" Language: shell (sh) Korn shell (ksh) bash (sh)
" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
" Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int>
-" Last Change: Mar 01, 2006
-" Version: 81
+" Last Change: Apr 06, 2006
+" Version: 82
" URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
"
" Using the following VIM variables: {{{1
@@ -79,7 +79,7 @@ syn cluster shDerefVarList contains=shDerefOp,shDerefVarArray,shDerefOpError
syn cluster shEchoList contains=shArithmetic,shCommandSub,shDeref,shDerefSimple,shExpr,shExSingleQuote,shSingleQuote,shDoubleQuote,shSpecial
syn cluster shExprList1 contains=shCharClass,shNumber,shOperator,shExSingleQuote,shSingleQuote,shDoubleQuote,shSpecial,shExpr,shDblBrace,shDeref,shDerefSimple
syn cluster shExprList2 contains=@shExprList1,@shCaseList,shTest
-syn cluster shFunctionList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shCommandSub,shComment,shDo,shEcho,shFor,shHereDoc,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shSpecial,shOperator,shFunctionStart
+syn cluster shFunctionList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shSpecial,shOperator,shFunctionStart
syn cluster shHereBeginList contains=@shCommandSubList
syn cluster shHereList contains=shBeginHere,shHerePayload
syn cluster shHereListDQ contains=shBeginHere,@shDblQuoteList,shHerePayload
@@ -154,9 +154,15 @@ syn match shCharClass contained "\[:\(backspace\|escape\|return\|xdigit\|alnum
" Loops: do, if, while, until {{{1
" ======
-syn region shDo transparent matchgroup=shConditional start="\<do\>" matchgroup=shConditional end="\<done\>" contains=@shLoopList
-syn region shIf transparent matchgroup=shConditional start="\<if\>" matchgroup=shConditional end="\<;\_s*then\>" end="\<fi\>" contains=@shLoopList,shDblBrace,shDblParen
-syn region shFor matchgroup=shLoop start="\<for\>" end="\<in\>" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen skipwhite nextgroup=shCurlyIn
+if g:sh_fold_enabled
+ syn region shDo fold transparent matchgroup=shConditional start="\<do\>" matchgroup=shConditional end="\<done\>" contains=@shLoopList
+ syn region shIf fold transparent matchgroup=shConditional start="\<if\>" matchgroup=shConditional end="\<;\_s*then\>" end="\<fi\>" contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey
+ syn region shFor fold matchgroup=shLoop start="\<for\>" end="\<in\>" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen skipwhite nextgroup=shCurlyIn
+else
+ syn region shDo transparent matchgroup=shConditional start="\<do\>" matchgroup=shConditional end="\<done\>" contains=@shLoopList
+ syn region shIf transparent matchgroup=shConditional start="\<if\>" matchgroup=shConditional end="\<;\_s*then\>" end="\<fi\>" contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey
+ syn region shFor matchgroup=shLoop start="\<for\>" end="\<in\>" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen skipwhite nextgroup=shCurlyIn
+endif
if exists("b:is_kornshell") || exists("b:is_bash")
syn cluster shCaseList add=shRepeat
syn region shRepeat matchgroup=shLoop start="\<while\>" end="\<in\>" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen,shDblBrace
@@ -174,7 +180,11 @@ syn match shComma contained ","
syn match shCaseBar contained skipwhite "[^|"`'()]\{-}|"hs=e nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote
syn match shCaseStart contained skipwhite skipnl "(" nextgroup=shCase,shCaseBar
syn region shCase contained skipwhite skipnl matchgroup=shSnglCase start="[^#$()'"]\{-})"ms=s,hs=e end=";;" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,shComment
-syn region shCaseEsac matchgroup=shConditional start="\<case\>" end="\<esac\>" contains=@shCaseEsacList
+if g:sh_fold_enabled
+ syn region shCaseEsac fold matchgroup=shConditional start="\<case\>" end="\<esac\>" contains=@shCaseEsacList
+else
+ syn region shCaseEsac matchgroup=shConditional start="\<case\>" end="\<esac\>" contains=@shCaseEsacList
+endif
syn keyword shCaseIn contained skipwhite skipnl in nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote
if exists("b:is_bash")
syn region shCaseExSingleQuote matchgroup=shOperator start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial,shSpecial skipwhite skipnl nextgroup=shCaseBar contained
@@ -319,7 +329,7 @@ endif
" Functions: {{{1
syn keyword shFunctionKey function skipwhite skipnl nextgroup=shFunctionTwo
-syn match shFunctionStart "{" contained
+syn match shFunctionStart "^\s*{" contained
if g:sh_fold_enabled
syn region shFunctionOne transparent fold start="^\s*\h\w*\s*()\_s*\ze{" matchgroup=shFunctionStart end="}" contains=@shFunctionList
syn region shFunctionTwo transparent fold start="\h\w*\s*\%(()\)\=\_s*\ze{" matchgroup=shFunctionStart end="}" contains=shFunctionKey,@shFunctionList contained