]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
vimrc: Behave like 'scrolloff' while searching.
authorSimon Ruderich <simon@ruderich.org>
Tue, 23 Nov 2010 23:24:59 +0000 (00:24 +0100)
committerSimon Ruderich <simon@ruderich.org>
Tue, 23 Nov 2010 23:24:59 +0000 (00:24 +0100)
vimrc

diff --git a/vimrc b/vimrc
index 582797ebc522f035aae17a30cf898a84f5991f6a..7d1f0aef93967db3d0904d25770e50477755116d 100644 (file)
--- a/vimrc
+++ b/vimrc
@@ -214,6 +214,11 @@ cnoremap <C-N> <Down>
 nnoremap <Space> <C-F>
 nnoremap - <C-B>
 
+" Behave like 'scrolloff' but only while searching. Thanks to "Benjamin R.
+" Haskell" <vim@benizi.com> from the Vim mailing list (2010-10-26).
+nnoremap n nzv3j3k
+nnoremap N Nzv3k3j
+
 " Go to next and previous buffer. Thanks to elik in #vim on Freenode
 " (2010-05-16 18:38 CEST) for this idea.
 nnoremap <silent> gb :bnext<CR>