diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-07-07 01:10:14 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-07-07 01:11:40 +1200 |
commit | 579cf9aba14bcf67b4237470104dafc64af9054a (patch) | |
tree | 976226a28958838535dc0838f17749f0c734280b /vim/indent | |
parent | Wrap comments with `gq` in Git commit messages (diff) | |
download | dotfiles-579cf9aba14bcf67b4237470104dafc64af9054a.tar.gz dotfiles-579cf9aba14bcf67b4237470104dafc64af9054a.zip |
Adjust a few Vim Perl indent comments
Diffstat (limited to 'vim/indent')
-rw-r--r-- | vim/indent/perl.vim | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/vim/indent/perl.vim b/vim/indent/perl.vim index edb91028..43137e9c 100644 --- a/vim/indent/perl.vim +++ b/vim/indent/perl.vim @@ -9,7 +9,7 @@ let b:did_indent = 1 " Define indent function function! GetPerlIndent() - " Just return 0 if we have no previous line to work from + " Get previous line, bail if none let l:pn = prevnonblank(v:lnum - 1) if !l:pn return 0 @@ -26,7 +26,7 @@ function! GetPerlIndent() \ ? shiftwidth() \ : &shiftwidth - " Don't touch comments + " Just follow comment indent if l:pl =~# '^\s*#' return l:pi @@ -42,7 +42,7 @@ function! GetPerlIndent() return l:pi + l:sw endif - " Closing brace + " Entering closing brace elseif l:cl =~# '^\s*[])}]' " Reduce indent if possible @@ -56,7 +56,7 @@ function! GetPerlIndent() elseif l:pl =~# '[;,}]\s*$' return l:pi - (l:pi % l:sw) - " Continued line; add half shiftwidth + " Continued line; add half 'shiftwidth' elseif l:sw >= 2 return l:pi + l:sw / 2 endif @@ -67,7 +67,7 @@ endfunction setlocal indentexpr=GetPerlIndent() setlocal indentkeys+=0},0),0] -" Undo all of the above crap +" How to undo all of that let b:undo_indent = '|setlocal indentexpr<' \ . '|setlocal indentkeys<' \ . '|delfunction GetPerlIndent' |