Skip to content

Instantly share code, notes, and snippets.

@sgur
Created August 1, 2012 03:21
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 sgur/3223355 to your computer and use it in GitHub Desktop.
Save sgur/3223355 to your computer and use it in GitHub Desktop.
:, /, ? 2度押しで cmdline から cmdwin へ移行する
function! s:switch_cmdline(trigger)
if empty(getcmdline()) && getcmdtype() == a:trigger
call feedkeys("\<ESC>q".a:trigger, 'n')
else
return a:trigger
endif
endfunction
cmap <expr> ; <SID>switch_cmdline(';')
cmap <expr> / <SID>switch_cmdline('/')
cmap <expr> ? <SID>switch_cmdline('?')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment