Skip to content

Instantly share code, notes, and snippets.

@hlissner
Created September 6, 2014 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hlissner/3de525e280f26df0bbee to your computer and use it in GitHub Desktop.
Save hlissner/3de525e280f26df0bbee to your computer and use it in GitHub Desktop.
Using . to repeat last f/F/t/T match in vim
" I remap the leader/localleader, and ; to alias :, but what if I like , and ;?
let mapleader = ','
noremap ; :
" Makes f, F, t and T repeat the search. Support repeating with .
nnoremap <Plug>NextMatch ;
nnoremap <silent> f :<C-u>call repeat#set("\<lt>Plug>NextMatch")<CR>f
nnoremap <silent> F :<C-u>call repeat#set("\<lt>Plug>NextMatch")<CR>F
nnoremap <silent> t :<C-u>call repeat#set("\<lt>Plug>NextMatch")<CR>t
nnoremap <silent> T :<C-u>call repeat#set("\<lt>Plug>NextMatch")<CR>T
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment