|Emulate a typewriter||Tom Link||5/22/09 2:17 AM|
What would be the best way to emulate this in vim:
I was thinking of putting vim into insert mode and of remapping all
keys that would get you out of it & of disabling cursor keys and the
like. Any other ideas? Any idea of how to remap all those keys
automatically via vimscript?
|Re: Emulate a typewriter||Andy Wokula||5/22/09 5:40 AM|
Tom Link schrieb:
Isn't getchar() the first thing that comes to mind?
here is a workaround (use incomplete mapping to delay getchar() until
" start typewrite mode (stop with CTRL-C):
nmap <script> <Plug>twm i<SID>m_
imap <SID>m_<Esc> <SID>m_
Tried on a win32 gVim.
|Re: Emulate a typewriter||Erik Falor||5/22/09 9:38 AM|
|Re: Emulate a typewriter||Tom Link||5/23/09 2:23 AM|
> Isn't getchar() the first thing that comes to mind?Thank you very much for the code. Interesting approach. I had to make
a small change though to make <c-c> abort the typewriter mode.
|Re: Emulate a typewriter||Tom Link||5/23/09 2:25 AM|
|Re: Emulate a typewriter||Liang Li||1/30/14 7:07 AM|
Your script is awesome! The way that you capitalized on vim's handling of ambiguous mappings to slow down the input loop is pretty awesome. Coolest peice of vimscript I've ever seen.
Don't let it get to your head ;-)