From ecfe5d6756bd351409592f59ac55c0075bc7257f Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 25 May 2019 01:03:29 +1200 Subject: 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. --- vim/autoload/vimrc.vim | 6 ------ vim/vimrc | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) delete mode 100644 vim/autoload/vimrc.vim 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 y :registers nnoremap z :setlocal spelllang=en_nz " \= runs the whole buffer through =, preserving position -nnoremap = :call vimrc#Anchor('1G=G') +nnoremap = m`1G=G`` " \+ runs the whole buffer through gq, preserving position -nnoremap + :call vimrc#Anchor('1GgqG') +nnoremap + m`1GgqG`` " \. runs the configured make program into the location list nnoremap . :lmake! -- cgit v1.2.3