7 ms·
Snake Vim Trainer
- aith 13y agoI 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!
- cyphax 13y agoI 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 13y agoThis 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.
- cyphax 13y agoGood point about using this to get me comfortable with the keymapping. I dunno if I'll get too depressed from dying over and over before I get the hang of it though! ;)
- aith 13y agoGetting frustrated and depressed with keymapping? Sounds just like my experience using real vim ;)
- oftenwrong 13y agoDo 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>
- harrytuttle 13y agoJust to state some support for this: I have used vim for over a decade and I haven't used hjkl on a good day once. Arrow keys are fine. Occasionally I use hjkl if the terminal is set up wrongly or it's a broken vi implementation but that's it.
- yogo 13y agoInteresting. I'm curious as to how and what you use vim for. I find it hard to believe that anyone would seriously do something like d + down arrow with dj available. All of those seconds (it takes me more than a second to go to the arrows then back to home row) add up over time.
- Patrick_Devine 13y agoYou would use 'dd' instead which is faster since you don't have to have make sure your other hand is in the correct position.
- yogo 13y agoMy example involved deleting two lines, which you can accomplish with '2dd', 'dj', 'dddd', etc. When my hands are on my keyboard 'dj' is my personal preference. The parent poster was using arrow keys so naturally I'm wondering if for something like 'dj' he/she would use 'd + down arrow' since that seems like waste of time. It's a somewhat contrived example to see how far some users take the use of the arrow keys, which you quickly realize are not necessary in vim.
- harrytuttle 13y agoI have a ThinkPad. The keys are closer together. 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.
- bitcrusher 13y agoIt depends on your keyboard as well. I use a Kinesis Advantage, which has the arrow keys in a place that doesn't require movement from your hands, so hjkl doesn't provide the advantage that it used to.
- jonahx 13y agoYou're missing a ton of vim's value by doing that. The reason for those key mappings is so that your hands can remain in standard "typing ready" position, so that you can both type and navigate without moving your hands. If you are moving away to the arrow keys, at that point you're one step away from just navigating by mouse: it's really missing the point.
- eckzow 13y agoI don't know about "a ton" -- there are far better ways to move around a file than mashing hjkl, even with numbered versions (vim-easymotion, vim-seek). Once you can get to the right place in the file I almost never use hjkl with an action, but rather text objects or motions like ci" or dt;
- swift 13y agoI've started to use relative line numbering (numbers.vim is highly recommended) and that has made me use 'j' and 'k' in motions quite frequently. I wish I had made the change earlier!
- JimmaDaRustla 13y agoI got the pitch forks, who has the torches?
- w0ts0n 13y agoOn Firefox, It just goes right through the "food"
- boushley 13y agoThis 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.
- Arnor 13y agoThanks for the VIM tip! I never even thought of looking for an alias for esc before.
- nils_ 13y agoI was thinking the same thing. Not being able to use ctrl+[ actually made this game really really hard for me as my muscle memory screams in protests each time i want to exit insert mode.
- aith 13y agoEasy! I'll add this today
- NoodleIncident 13y agoI aliased jk to ESC. Can that be added in?
- shime 13y agowhy don't you map escape to caps lock?
- paulnechifor 13y ago
- ottocode 13y agoThis 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!)
- hadem 13y agoI was about to say that the keyboard controls didn't work for me until I remembered that I had Vimium installed with Chrome.
- coherentpony 13y agoSame for me, too. Also disable Vimium if you have RES installed.
- bndw 13y agoditto
- TallboyOne 13y agoThat game is impossible
- snake_plissken 13y agoyou just had to go with something different than WASD didntcha?
- ilikepi 13y agoI 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 13y agoThis 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- 13y agoI 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 13y agoIt seems like that person I have been waiting for to create that mapping is me!
- bluedino 13y agoIt's left hand vs right hand, though.
- bndw 13y agoleaderboard doesn't appear to update (at least in real time).
- yefim 13y agotopscore never seems to update. Try `$.post('/newtop', {score: 16000})`
- guard-of-terra 13y agovim 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.
- lubomir 13y agoIt is not insisting. Vim will happilly let you use the arrow keys. It's just that once you acclimate to "hjkl", it is slightly faster and more comfortable, since you don't need to move right hand anywhere while typing. Or at least that's how it works for me.
- phowat 13y agoYou can use the arrows in vim by default, no problem with that. For example, all my current co-workers use vim and I'm the only one who navigates using HJKL. With that said, I really really recommend any vim user to at least give a shot at using it instead of arrow keys. YMMV, but for me, not having to reach for the arrows help me stay in the zone.
- guard-of-terra 13y agoSome distros/OSes ship with unmapped arrow keys and broken home/end in the terminal. This is seriously bad for your health.
- coldpie 13y agoWhat? The arrow keys work fine. They're just waaaaay over there. Why do you want to use them?
- guard-of-terra 13y agoThey're rather waaay on my keyboard where my right hand is. What I'm talking about is deliberate crippled default configurations.
- IanCal 13y agoIt is completely unlike that, please don't compare not having arrow keys to genital mutilation.
- carlmro 13y agoThe 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 13y agoRight. 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...
- theon144 13y agoWhen 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!
- dllthomas 13y agorobots, and later nethack, served this purpose for me as a child... likely less effectively.
- pit 13y agoIn 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.
- clubhi 13y agoA 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 13y agoI played Nethack on a MacBook Pro (with no number-pad) to get used to the vim movement keys.
- andrew_wc_brown 13y agoI use vim everyday and I don't find this game easy to play.