Skip to content

Instantly share code, notes, and snippets.

@dahu
Created March 14, 2015 01:58
Show Gist options
  • Select an option

  • Save dahu/0e720c57714ebce806c1 to your computer and use it in GitHub Desktop.

Select an option

Save dahu/0e720c57714ebce806c1 to your computer and use it in GitHub Desktop.
Vertically re-centre screen after searching
" Barry Arthur, March 2013
" Always vertically centre the screen after searching
nnoremap / :let searching = 1<cr>/
augroup CenteredSearches
au!
au CursorHold,CursorMoved * if exists('g:searching') | exe 'normal! zz' | unlet g:searching | endif
augroup END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment