From 54ee02272c204c77386f1948eae87ec97d2c5da4 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Wed, 1 Jun 2016 13:12:15 +0200 Subject: [PATCH] Make n/N work properly For caveats see: https://github.com/mhinz/vim-startify/issues/218#issuecomment-222962221 References #218. --- autoload/startify.vim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/autoload/startify.vim b/autoload/startify.vim index 38a2369..23126c9 100644 --- a/autoload/startify.vim +++ b/autoload/startify.vim @@ -702,6 +702,11 @@ function! s:set_mappings() abort execute "nnoremap ". s:nowait_string ." :call startify#open_buffers()" execute "nnoremap ". s:nowait_string ." <2-LeftMouse> :call startify#open_buffers()" + " Without these mappings n/N wouldn't work properly, since autocmds always + " force the cursor back on the index. + nnoremap n ' j'[v:searchforward].'n' + nnoremap N 'j '[v:searchforward].'N' + for k in keys(s:entries) execute 'nnoremap '. s:entries[k].nowait s:entries[k].index \ ':call startify#open_buffers('. string(k) .')'