aboutsummaryrefslogtreecommitdiff
path: root/vim/after/ftplugin/perl.vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-07-10 01:55:15 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-07-10 01:56:49 +1200
commitf36ef6745c3c96914eb7be228125c1d53bf70287 (patch)
treea42fc40eafc296b522071d60d754eb3c83ffece7 /vim/after/ftplugin/perl.vim
parent7e79ea883a34099d24ad02a5709ee3f8e759606f (diff)
downloaddotfiles-f36ef6745c3c96914eb7be228125c1d53bf70287.tar.gz
dotfiles-f36ef6745c3c96914eb7be228125c1d53bf70287.zip
Overhaul after/ftplugin
Use .= operator to append to b:undo_ftplugin, as we're requiring Vim 7.0 or later everywhere here anyway. Also remove &compatible where we don't need line breaks.
Diffstat (limited to 'vim/after/ftplugin/perl.vim')
-rw-r--r--vim/after/ftplugin/perl.vim18
1 files changed, 6 insertions, 12 deletions
diff --git a/vim/after/ftplugin/perl.vim b/vim/after/ftplugin/perl.vim
index dd5285e3..065a9512 100644
--- a/vim/after/ftplugin/perl.vim
+++ b/vim/after/ftplugin/perl.vim
@@ -1,21 +1,17 @@
" Extra configuration for Perl filetypes
-if &filetype != 'perl' || &compatible || v:version < 700
+if &filetype !=# 'perl' || v:version < 700 || &compatible
finish
endif
" Use Perl itself for checking and Perl::Tidy for tidying
compiler perl
setlocal equalprg=perltidy
-let b:undo_ftplugin = b:undo_ftplugin
- \ . '|unlet b:current_compiler'
- \ . '|setlocal equalprg<'
- \ . '|setlocal errorformat<'
- \ . '|setlocal makeprg<'
+let b:undo_ftplugin .= '|unlet b:current_compiler'
+ \ . '|setlocal equalprg< errorformat< makeprg<'
" Add angle brackets to pairs of matched characters for q<...>
setlocal matchpairs+=<:>
-let b:undo_ftplugin = b:undo_ftplugin
- \ . '|setlocal matchpairs<'
+let b:undo_ftplugin .= '|setlocal matchpairs<'
" Stop here if the user doesn't want ftplugin mappings
if exists('g:no_plugin_maps') || exists('g:no_perl_maps')
@@ -27,8 +23,7 @@ nnoremap <buffer> <LocalLeader>c
\ :<C-U>compiler perl<CR>
nnoremap <buffer> <LocalLeader>l
\ :<C-U>compiler perlcritic<CR>
-let b:undo_ftplugin = b:undo_ftplugin
- \ . '|nunmap <buffer> <LocalLeader>c'
+let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>c'
\ . '|nunmap <buffer> <LocalLeader>l'
" Bump version numbers
@@ -36,6 +31,5 @@ nmap <buffer> <LocalLeader>v
\ <Plug>PerlVersionBumpMinor
nmap <buffer> <LocalLeader>V
\ <Plug>PerlVersionBumpMajor
-let b:undo_ftplugin = b:undo_ftplugin
- \ . '|nunmap <buffer> <LocalLeader>v'
+let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>v'
\ . '|nunmap <buffer> <LocalLeader>V'