
Snake Vim Trainer - zachgersh
http://www.vimsnake.com/
======
theon144
When I was learning vikeys, I just disabled arrowkeys in my .vimrc :)

    
    
        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!

------
hadem
I was about to say that the keyboard controls didn't work for me until I
remembered that I had Vimium installed with Chrome.

~~~
coherentpony
Same for me, too. Also disable Vimium if you have RES installed.

------
cyphax
I certainly like VIM, it's my default editor on non-Windows operating systems,
but I really don't care one bit about the h,j,k,l keymapping; I can use my
arrow keys, which I find to be lots easier. So I TOTALLY suck at this game
because it doesn't support the arrow keys like VIM does! :P

~~~
zachgersh
This should get you comfortable with using the h,j,k,l mapping then. I
actually turn arrow keys off in my vimrc, I can definitively say it is one of
the things that has made me faster.

~~~
oftenwrong
Do not turn them off; remap them! That is valuable keyboard real estate.

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>

~~~
zachgersh
Such a good call! I don't use buffers enough :)

------
carlmro
The game is fun, but perhaps a bit misleading regarding what 'mastering vim
movement' amounts to. As I am sure many of you know, vim has tons of
constructs for efficient navigation: Using b or w for word-wise jumping,
special markers like $ and 0, Ctrl-D and Ctrl-U etc. A good overview of
movement commands can be found here:
[http://vim.wikia.com/wiki/Moving_around](http://vim.wikia.com/wiki/Moving_around)

~~~
dllthomas
Right. For it to really feel like vim movement, I'd push two keys and the
snake would jump to the next food pellet in insert mode...

------
aith
I made this site at Dev Bootcamp Chicago. It's super simple, but if it brings
someone any amount of entertainment, it'll make my day.

The snake part is a HTML5 canvas, and the back end is Ruby/Sinatra.

Enjoy!

------
boushley
This is awesome! You should add ctrl+[ as an alias for escape as vim does.
I've used that for a while now, and actually reaching up for escape feels
unnatural now.

~~~
NoodleIncident
I aliased jk to ESC. Can that be added in?

~~~
yogo
Out of habit I used _jj_ to escape. A touch of inoremap would help this game
:)

------
ilikepi
I find I'm having a mental conflict between Vim's hjkl controls and WASD-style
gaming controls, despite having very little experience using the latter with
my right hand. This is made worse since it happens to be 'i' that my right-
hand middle finger hits when I think "go up".

Very neat though, regardless!

~~~
McPants
This is what is preventing me from learning Vim. I play games every day using
WASD movement and if I have to switch to hjkl my brain goes haywire.

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.

~~~
Stealth-
I do both regularly. They are different hands and the different movements
actually become very different feeling. When my right hand is on the mouse,
WASD feels natural. Otherwise, I naturally hold my left hand near the ESC key
and my right hand over HJKL.

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 :)

~~~
McPants
It seems like that person I have been waiting for to create that mapping is
me!

------
ottocode
This is awesome. I thought I was pretty good at vim, but the added pressure of
needing to switch modes and directions at the same time without thinking about
the keys was a great learning experience! (and fun game too!)

------
pit
In light of the recent comments about mods editing article titles, I gotta say
that when I saw this earlier today I didn't think it sounded interesting.
After the rename, I clicked on it, and man, it's awesome.

------
guard-of-terra
vim and BSDs default configurations insisting on inexistance of arrow keys is
a "tradition" not completely unlike clitoridectomy. Come on guys (and gals),
we've been over this already.

~~~
coldpie
What? The arrow keys work fine. They're just waaaaay over there. Why do you
want to use them?

~~~
guard-of-terra
They're rather waaay on my keyboard where my right hand is.

What I'm talking about is deliberate crippled default configurations.

------
w0ts0n
On Firefox, It just goes right through the "food"

~~~
aith
You have to be in INSERT mode (press i) to eat the food. That catch is that
you can't change direction in INSERT mode. Press 'esc' to get out of INSERT
mode.

------
clubhi
A good way for me to learn movement is to think of direction as:

walking up stairs: kl kl kl kl kl kl kl walking down stairs: jh jh jh jh jh jh
jh jh jh

------
barbs
I played Nethack on a MacBook Pro (with no number-pad) to get used to the vim
movement keys.

------
andrew_wc_brown
I use vim everyday and I don't find this game easy to play.

------
dllthomas
robots, and later nethack, served this purpose for me as a child... likely
less effectively.

------
yefim
topscore never seems to update.

Try `$.post('/newtop', {score: 16000})`

------
bndw
leaderboard doesn't appear to update (at least in real time).

------
snake_plissken
you just had to go with something different than WASD didntcha?

------
TallboyOne
That game is impossible

