aboutsummaryrefslogtreecommitdiff
path: root/vim/ftplugin
diff options
context:
space:
mode:
Diffstat (limited to 'vim/ftplugin')
-rw-r--r--vim/ftplugin/html.vim15
-rw-r--r--vim/ftplugin/perl.vim15
-rw-r--r--vim/ftplugin/sh.vim22
-rw-r--r--vim/ftplugin/vim.vim5
4 files changed, 34 insertions, 23 deletions
diff --git a/vim/ftplugin/html.vim b/vim/ftplugin/html.vim
index c756eb80..3db5dcca 100644
--- a/vim/ftplugin/html.vim
+++ b/vim/ftplugin/html.vim
@@ -1,10 +1,12 @@
" Run `tidy -errors -quiet` over buffer
-nnoremap <buffer> <silent> <LocalLeader>c
- \ :write !tidy -errors -quiet<CR>
+nnoremap <buffer> <silent>
+ \ <LocalLeader>c
+ \ :<C-U>write !tidy -errors -quiet<CR>
" Filter buffer through `tidy`
-nnoremap <buffer> <silent> <LocalLeader>t
- \ :%!tidy -quiet<CR>
+nnoremap <buffer> <silent>
+ \ <LocalLeader>t
+ \ :<C-U>%!tidy -quiet<CR>
" Make a bare URL into a link to itself
function! s:UrlLink()
@@ -21,5 +23,8 @@ function! s:UrlLink()
normal! a</a>
endfunction
-nnoremap <buffer> <silent> <LocalLeader>r
+
+" Mapping for the function above
+nnoremap <buffer> <silent>
+ \ <LocalLeader>r
\ :<C-U>call <SID>UrlLink()<CR>
diff --git a/vim/ftplugin/perl.vim b/vim/ftplugin/perl.vim
index 2ea4676b..07cf9a1f 100644
--- a/vim/ftplugin/perl.vim
+++ b/vim/ftplugin/perl.vim
@@ -1,11 +1,14 @@
" Run `perl -c` over buffer
-nnoremap <buffer> <silent> <LocalLeader>c
- \ :write !perl -c<CR>
+nnoremap <buffer> <silent>
+ \ <LocalLeader>c
+ \ :<C-U>write !perl -c<CR>
" Run `perlcritic` over buffer
-nnoremap <buffer> <silent> <LocalLeader>l
- \ :write !perlcritic<CR>
+nnoremap <buffer> <silent>
+ \ <LocalLeader>l
+ \ :<C-U>write !perlcritic<CR>
" Filter buffer through `perltidy`
-nnoremap <buffer> <silent> <LocalLeader>t
- \ :%!perltidy<CR>
+nnoremap <buffer> <silent>
+ \ <LocalLeader>t
+ \ :<C-U>%!perltidy<CR>
diff --git a/vim/ftplugin/sh.vim b/vim/ftplugin/sh.vim
index c09e4fe8..d13f34da 100644
--- a/vim/ftplugin/sh.vim
+++ b/vim/ftplugin/sh.vim
@@ -27,22 +27,24 @@ endif
" Map checker based on shell family
if exists('b:is_bash') && b:is_bash
- let b:check = 'bash -n'
+ let b:check = 'write !bash -n'
elseif exists('b:is_ksh') && b:is_ksh
- let b:check = 'ksh -n'
+ let b:check = 'write !ksh -n'
else
- let b:check = 'sh -n'
+ let b:check = 'write !sh -n'
endif
-nnoremap <buffer> <silent> <LocalLeader>c
- \ :<C-U>execute ':write !' . b:check<CR>
+nnoremap <buffer> <silent>
+ \ <LocalLeader>c
+ \ :<C-U>execute b:check<CR>
" Map linter based on shell family
if exists('b:is_bash') && b:is_bash
- let b:lint = 'shellcheck -s bash -'
+ let b:lint = 'write shellcheck -s bash -'
elseif exists('b:is_ksh') && b:is_ksh
- let b:lint = 'shellcheck -s ksh -'
+ let b:lint = 'write !shellcheck -s ksh -'
else
- let b:lint = 'shellcheck -s sh -'
+ let b:lint = 'write !shellcheck -s sh -'
endif
-nnoremap <buffer> <silent> <LocalLeader>l
- \ :<C-U>execute ':write !' . b:lint<CR>
+nnoremap <buffer> <silent>
+ \ <LocalLeader>l
+ \ :<C-U>execute b:lint<CR>
diff --git a/vim/ftplugin/vim.vim b/vim/ftplugin/vim.vim
index e023553e..d4e55ace 100644
--- a/vim/ftplugin/vim.vim
+++ b/vim/ftplugin/vim.vim
@@ -1,5 +1,6 @@
" Run `vint` over buffer
" /dev/stdin is not optimal here; it's widely implemented, but not POSIX.
" `vint` does not seem to have another way to parse standard input.
-nnoremap <buffer> <silent> <LocalLeader>l
- \ :write !vint -s /dev/stdin<CR>
+nnoremap <buffer> <silent>
+ \ <LocalLeader>l
+ \ :<C-U>write !vint -s /dev/stdin<CR>