diff options
author | Bram Moolenaar <Bram@vim.org> | 2005-06-29 22:40:58 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2005-06-29 22:40:58 +0000 |
commit | 42eeac3552c5a5ea10f24373f76b93633b6c8604 (patch) | |
tree | 902f3158470a3e9c53850708cf982c85c6338796 /runtime/indent/readline.vim | |
parent | 24bbcfe8fe62ea43b1cea86243be4fdc8794140b (diff) | |
download | vim-git-42eeac3552c5a5ea10f24373f76b93633b6c8604.tar.gz |
updated for version 7.0097v7.0097
Diffstat (limited to 'runtime/indent/readline.vim')
-rw-r--r-- | runtime/indent/readline.vim | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/runtime/indent/readline.vim b/runtime/indent/readline.vim index b2640f1f2..52d2a7131 100644 --- a/runtime/indent/readline.vim +++ b/runtime/indent/readline.vim @@ -1,48 +1,35 @@ " Vim indent file -" Language: readline configuration file -" Maintainer: Nikolai Weibull <source@pcppopper.org> -" URL: http://www.pcppopper.org/vim/indent/pcp/readline/ -" Latest Revision: 2004-04-25 -" arch-tag: ee681235-3abf-4a42-8587-edabd409a980 +" Language: readline configuration file +" Maintainer: Nikolai Weibull <nikolai+work.vim@bitwi.se> +" Latest Revision: 2005-06-29 -" Only load this indent file when no other was loaded. if exists("b:did_indent") finish endif - let b:did_indent = 1 setlocal indentexpr=GetReadlineIndent() setlocal indentkeys=!^F,o,O,=$else,=$endif -" Only define the function once. if exists("*GetReadlineIndent") finish endif function GetReadlineIndent() let lnum = prevnonblank(v:lnum - 1) - if lnum == 0 return 0 endif - let line = getline(lnum) let ind = indent(lnum) - " increase indent if previous line started with $if or $else - if line =~ '^\s*$\(if\|else\)\>' + if getline(lnum) =~ '^\s*$\(if\|else\)\>' let ind = ind + &sw endif - let line = getline(v:lnum) - - " decrease indent if this line starts with $else or $endif - if line =~ '^\s*$\(else\|endif\)\>' + if getline(v:lnum) =~ '^\s*$\(else\|endif\)\>' let ind = ind - &sw endif return ind endfunction - -" vim: set sts=2 sw=2: |