diff options
author | Bram Moolenaar <Bram@vim.org> | 2015-08-11 20:34:49 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2015-08-11 20:34:49 +0200 |
commit | fc39ecf8ded5466d7e9cbde8db75517718b023d8 (patch) | |
tree | 1c2c095ba1c61e9f6241fa999f09f92c79f71968 /runtime/indent/sh.vim | |
parent | 25c2f6783a9d5f15e062bd5b085abe7deb121152 (diff) |
Update runtime files.
Diffstat (limited to 'runtime/indent/sh.vim')
-rw-r--r-- | runtime/indent/sh.vim | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/runtime/indent/sh.vim b/runtime/indent/sh.vim index 29a25a2108..b2f35b23a7 100644 --- a/runtime/indent/sh.vim +++ b/runtime/indent/sh.vim @@ -1,10 +1,11 @@ " Vim indent file -" Language: Shell Script -" Maintainer: Currently unmaintained. If you want to take it, please -" email Bram +" Language: Shell Script +" Maintainer: Christian Brabandt <cb@256bit.org> " Previous Maintainer: Peter Aronoff <telemachus@arpinum.org> -" Original Author: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2014-08-22 +" Original Author: Nikolai Weibull <now@bitwi.se> +" Latest Revision: 2015-07-28 +" License: Vim (see :h license) +" Repository: https://github.com/chrisbra/vim-sh-indent if exists("b:did_indent") finish @@ -12,7 +13,7 @@ endif let b:did_indent = 1 setlocal indentexpr=GetShIndent() -setlocal indentkeys+=0=then,0=do,0=else,0=elif,0=fi,0=esac,0=done,),0=;;,0=;& +setlocal indentkeys+=0=then,0=do,0=else,0=elif,0=fi,0=esac,0=done,0=end,),0=;;,0=;& setlocal indentkeys+=0=fin,0=fil,0=fip,0=fir,0=fix setlocal indentkeys-=:,0# setlocal nosmartindent @@ -56,8 +57,8 @@ function! GetShIndent() let ind = indent(lnum) let line = getline(lnum) - if line =~ '^\s*\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\)\>' - if line !~ '\<\%(fi\|esac\|done\)\>\s*\%(#.*\)\=$' + if line =~ '^\s*\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>' + if line !~ '\<\%(fi\|esac\|done\|end\)\>\s*\%(#.*\)\=$' let ind += s:indent_value('default') endif elseif s:is_case_label(line, pnum) @@ -78,7 +79,7 @@ function! GetShIndent() let pine = line let line = getline(v:lnum) - if line =~ '^\s*\%(then\|do\|else\|elif\|fi\|done\)\>' || line =~ '^\s*}' + if line =~ '^\s*\%(then\|do\|else\|elif\|fi\|done\|end\)\>' || line =~ '^\s*}' let ind -= s:indent_value('default') elseif line =~ '^\s*esac\>' && s:is_case_empty(getline(v:lnum - 1)) let ind -= s:indent_value('default') |