aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-08-02 11:34:06 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-08-02 11:34:06 +1200
commit5e5f1535ae9645bc10b3d26cea66e4bac5625d7a (patch)
tree5a55963c9ddfe8c3d3715a2370d2defe7fa0e06a
parent6b6477146415ae02f3aca34e97f532d7dd808212 (diff)
downloaddotfiles-5e5f1535ae9645bc10b3d26cea66e4bac5625d7a.tar.gz
dotfiles-5e5f1535ae9645bc10b3d26cea66e4bac5625d7a.zip
Round out execution mappings
We'll clobber "z for now. I might rewrite this to be functional at some point, but I do rather like that these all work with vim-tiny.
-rw-r--r--vim/vimrc10
1 files changed, 8 insertions, 2 deletions
diff --git a/vim/vimrc b/vim/vimrc
index d10309da..d19e55d8 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -316,8 +316,14 @@ nnoremap <Bslash><Delete> :bdelete<CR>
" \INS edits a new buffer
nnoremap <Bslash><Insert> :<C-U>enew<CR>
-" \! executes the current line with 'shell'
-nnoremap <Bslash>! :!<C-R>=getline('.')<CR><CR>
+" Execution mappings; each of these clobbers register z
+
+" \@ executes line in normal mode
+nnoremap <Bslash>@ g^"zy$@z
+" \: executes line in command mode
+nnoremap <Bslash>: g^"z:<C-R>z<CR>
+" \! executes line with 'shell'
+nnoremap <Bslash>! g^"zy$:!<C-R>z<CR>
" If we're running NeoVim, source some extra configuration
if has('nvim')