I like to be able to find the next occurence of a string without exiting the command line. Here is a hack to do that:

set incsearch
cnoremap <expr> / (getcmdtype() == '/' \|\| getcmdtype() == '?' ? (getcmdline() == '' ? "\<Up>" : "\<Cr>/\<Up>") : "/")
cnoremap <expr> ? (getcmdtype() == '/' \|\| getcmdtype() == '?' ? (getcmdline() == '' ? "\<Up>" : "\<Cr>?\<Up>") : "?")
  • Facebook
  • Twitter
  • Digg
  • Reddit
  • del.icio.us
  • StumbleUpon

No related posts.