Snake Vim Trainer
vimsnake.com
vimsnake.com
inoremap <Up> <NOP>
inoremap <Down> <NOP>
inoremap <Left> <NOP>
inoremap <Right> <NOP>
noremap <Up> <NOP>
noremap <Down> <NOP>
noremap <Left> <NOP>
noremap <Right> <NOP>
I know it sounds masochistic, but it really isn't; I actually had to check after a while whether I really set it, because I didn't remember any issues with navigation. Try it!Occasionally I use hjkl if the terminal is set up wrongly or it's a broken vi implementation but that's it.
Used for most editing tasks. Those seconds are fractional compared to thinking time before cutting code. I'm not paid in words per minute.
w, g, / are used more than the arrows anyway.
I use them for buffer switching, since I do that frequently. Left and right change to the next and previous buffers, respectively. Down to quickly swap to the previously focused buffer. Up to bring up a buffer switch menu. Here are the .vimrc lines:
" Arrow keys for buffer switching
nnoremap <left> :bprev<cr>
nnoremap <right> :bnext<cr>
nnoremap <down> :buffer #<cr>
nnoremap <up> :buffers<cr>:buffer<space>The snake part is a HTML5 canvas, and the back end is Ruby/Sinatra.
Enjoy!
inoremap kj <ESC>
In GNOME: System → Preferences → Keyboard; Layouts; Options; Miscellaneous compatibility options → "Both Shift-Keys together toggle Caps Lock" (You can also remap Caps Lock in this same dialog, so the change isn't just for Vim. It's under "Caps Lock key behavior". Also, having a compose key is awesome.)
Very neat though, regardless!
I have been waiting for someone to create a Vim control scheme that relies on WASD movement and maybe also brings in other common gaming related keys (E for insert?, space for escape?) To me this seems more logical than hjkl/i/esc.
Until then though it just feels like more work that it needs to be for me to personally learn Vim. Which is a shame because I can recognize how useful it can be, especially after watching Destroy all Software screencasts.
Because it's the home row, it also feels more natural when you are getting ready to type. The mental separation between "gaming" and "typing" is not hard to get a hold of really quick. Give it a try! I guarantee you'll be completely used to it within a week.
Also, keep in mind all of these keys can be remapped in Vim anyways :)
map k g<Down>
map i g<Up>
map j <Left>
noremap h i
Note that with this config, we maintain the normal mode "inner" text objects with "h" instead of "i". So where you would previous type di' to delete inside quotes, now you'll dh'. And dh( instead of di(, etc. It all works, and I've been using this config for a couple years now.That said it should be easy to remap vim keys to use WASD/etc - although there might be conflicts with other functions.
What I'm talking about is deliberate crippled default configurations.
Of course UNIX terminal handling is not standardized at all, so you may find that some programs ignore $TERM and do their own thing.
Is Home ^]]1~ or it's ^]H? You have to guess every time.
walking up stairs: kl kl kl kl kl kl kl walking down stairs: jh jh jh jh jh jh jh jh jh
Try `$.post('/newtop', {score: 16000})`