aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-25 01:03:29 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-25 01:03:29 +1200
commitecfe5d6756bd351409592f59ac55c0075bc7257f (patch)
tree32206a210c1f52635625e7a28fc05994d539906a
parentSwitch to more robust $MYVIM definition (diff)
downloaddotfiles-ecfe5d6756bd351409592f59ac55c0075bc7257f.tar.gz
dotfiles-ecfe5d6756bd351409592f59ac55c0075bc7257f.zip
Simplify \= and \+ maps to remove autoload
It always bugged me that I had just the one little function in here, when everything else is either neatly self-contained or dependent on a plugin. These maps should be good enough.
-rw-r--r--vim/autoload/vimrc.vim6
-rw-r--r--vim/vimrc4
2 files changed, 2 insertions, 8 deletions
diff --git a/vim/autoload/vimrc.vim b/vim/autoload/vimrc.vim
deleted file mode 100644
index 1af59c07..00000000
--- a/vim/autoload/vimrc.vim
+++ /dev/null
@@ -1,6 +0,0 @@
-" Run some normal-mode keystrokes without jumping around
-function! vimrc#Anchor(keys) abort
- let view = winsaveview()
- execute 'normal! '.a:keys
- call winrestview(view)
-endfunction
diff --git a/vim/vimrc b/vim/vimrc
index 3a6fd7b5..0d463660 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -418,9 +418,9 @@ nnoremap <Leader>y :<C-U>registers<CR>
nnoremap <Leader>z :<C-U>setlocal spelllang=en_nz<CR>
" \= runs the whole buffer through =, preserving position
-nnoremap <Leader>= :<C-U>call vimrc#Anchor('1G=G')<CR>
+nnoremap <Leader>= m`1G=G``
" \+ runs the whole buffer through gq, preserving position
-nnoremap <Leader>+ :<C-U>call vimrc#Anchor('1GgqG')<CR>
+nnoremap <Leader>+ m`1GgqG``
" \. runs the configured make program into the location list
nnoremap <Leader>. :<C-U>lmake!<CR>