Skip to content

Instantly share code, notes, and snippets.

@dahu
Created October 27, 2012 11:31
Show Gist options
  • Select an option

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

Select an option

Save dahu/3964354 to your computer and use it in GitHub Desktop.
WaitForKeyMap
function! WaitForKeyMap(start)
let c = nr2char(getchar())
if maparg(a:start . c, 'i') != ''
echo "soup!"
call feedkeys(a:start . c)
return ''
else
return c
endif
endfunction
inoremap ,pfa echo 1
inoremap ,pfb echo 2
inoremap <expr> ,pf WaitForKeyMap(',pf')
finish
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment