From 6201df6009b3c70a2d064fc0caf9ac297017ba0b Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 7 Jul 2018 16:14:53 +1200 Subject: Simplify in/out indent for blocks --- vim/indent/perl.vim | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/vim/indent/perl.vim b/vim/indent/perl.vim index cd01f30b..aac8f818 100644 --- a/vim/indent/perl.vim +++ b/vim/indent/perl.vim @@ -83,36 +83,42 @@ function! GetPerlIndent(lnum) let l:pl = getline(l:pn) let l:pi = indent(l:pn) - " Get value of 'shiftwidth' - let l:sw = &shiftwidth ? &shiftwidth : &tabstop + " Just follow comment indent + if l:pl =~# '^\s*#' + return l:pi + endif " Get current line properties let l:cl = getline(a:lnum) + " Get value of 'shiftwidth' + let l:sw = &shiftwidth ? &shiftwidth : &tabstop + " Base indent with any fractional indent removed let l:pb = l:pi - l:pi % l:sw - " Just follow comment indent - if l:pl =~# '^\s*#' - return l:pi - - " Move out with closing brace - elseif l:cl =~# '^\s*[])}]' - return l:pb >= l:sw ? l:pb - l:sw : 0 - - " Move in after opening brace - elseif l:pl =~# '[{([]\s*$' - return l:pb + l:sw + " Handle open and closing brackets + let l:open = l:pl =~# '[{([]\s*$' + let l:shut = l:cl =~# '^\s*[])}]' + if l:open || l:shut + let l:in = l:pb + if l:open + let l:in = l:in + l:sw + endif + if l:shut + let l:in = l:in - l:sw + endif + return l:in > 0 ? l:in : 0 + endif " Never continue after a semicolon or a double-underscore - elseif l:pl =~# '\;\s*$' + if l:pl =~# '\;\s*$' \ || l:pl =~# '__DATA__' \ || l:pl =~# '__END__' return l:pb " Line continuation hints - elseif l:pl =~# '[^])},]\s*$' - \ || l:cl =~# '^\s*\(and\|or\|xor\)' + elseif l:cl =~# '^\s*\(and\|or\|xor\)' \ || l:cl =~# '^\s*\(&&\|||\|//\)' \ || l:cl =~# '^\s*[?:=]' return l:pb + l:sw / 2 -- cgit v1.2.3 From ea1d36c539897ef17d223073ef5cb3d239b0a71a Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 7 Jul 2018 16:16:51 +1200 Subject: Bump VERSION --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index c55e22ec..7bc1fd01 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -tejr dotfiles v1.23.0 -Sat Jul 7 03:31:48 UTC 2018 +tejr dotfiles v1.23.1 +Sat Jul 7 04:16:46 UTC 2018 -- cgit v1.2.3 From f0deb80d7071373385cbe4bd7f99c6ca938a149c Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 7 Jul 2018 16:17:53 +1200 Subject: Update dotfiles(7) manual --- man/man7/dotfiles.7df | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/man/man7/dotfiles.7df b/man/man7/dotfiles.7df index 7c4d410e..1e9c1e02 100644 --- a/man/man7/dotfiles.7df +++ b/man/man7/dotfiles.7df @@ -496,16 +496,10 @@ structures like functions, I like to implement it as a plugin in documentation for each in \f[C]~/.vim/doc\f[]. .PP They eventually get either discarded or spun off into their own -repositories, added to this repository as submodules instead, and -uploaded to +repositories, added to this repository as submodules under +\f[C]vim/bundle\f[] instead, and uploaded to vim.org (https://www.vim.org/account/profile.php?user_id=73687). .PP -In the current version, there are no local plugins; everything's got its -own repository. -All plugins and colorschemes are available as submodules in -\f[C]~/.vim/bundle\f[]. -They are installed into \f[C]~/.vim\f[]. -.PP I still use two third\-party plugins: Tim Pope's repeat.vim (https://www.vim.org/scripts/script.php?script_id=2136) and surround.vim (https://www.vim.org/scripts/script.php?script_id=1697). -- cgit v1.2.3