diff options
Diffstat (limited to 'vim/after/ftplugin/perl/tidy.vim')
-rw-r--r-- | vim/after/ftplugin/perl/tidy.vim | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/vim/after/ftplugin/perl/tidy.vim b/vim/after/ftplugin/perl/tidy.vim index 18033a42..bd3e73a1 100644 --- a/vim/after/ftplugin/perl/tidy.vim +++ b/vim/after/ftplugin/perl/tidy.vim @@ -9,27 +9,27 @@ if exists('b:undo_ftplugin') \ . '|unlet b:did_ftplugin_perl_tidy' endif -" Set up a mapping for the tidier, if we're allowed -if !exists('g:no_plugin_maps') && !exists('g:no_perl_maps') +" Stop here if the user doesn't want ftplugin mappings +if exists('g:no_plugin_maps') || exists('g:no_perl_maps') + finish +endif - " Define a mapping target - nnoremap <buffer> <silent> <unique> +" Define a mapping target +nnoremap <buffer> <silent> <unique> + \ <Plug>PerlTidy + \ :<C-U>%!perltidy<CR> +if exists('b:undo_ftplugin') + let b:undo_ftplugin = b:undo_ftplugin + \ . '|nunmap <buffer> <Plug>PerlTidy' +endif + +" If there isn't a key mapping already, use a default one +if !hasmapto('<Plug>PerlTidy') + nmap <buffer> <unique> + \ <LocalLeader>t \ <Plug>PerlTidy - \ :<C-U>%!perltidy<CR> if exists('b:undo_ftplugin') let b:undo_ftplugin = b:undo_ftplugin - \ . '|nunmap <buffer> <Plug>PerlTidy' - endif - - " If there isn't a key mapping already, use a default one - if !hasmapto('<Plug>PerlTidy') - nmap <buffer> <unique> - \ <LocalLeader>t - \ <Plug>PerlTidy - if exists('b:undo_ftplugin') - let b:undo_ftplugin = b:undo_ftplugin - \ . '|nunmap <buffer> <LocalLeader>t' - endif + \ . '|nunmap <buffer> <LocalLeader>t' endif - endif |