Hacker News new | past | comments | ask | show | jobs | submit login
A CLI game to learn Vim (ostechnix.com)
296 points by prando on May 15, 2018 | hide | past | favorite | 52 comments



I got comfortable on the basic Vim keys using shortcutFoo [0], plus actually diving in to using it full-time. Learning Vim takes full time usage as you need to switch over your muscle memory. I still find that GVim is brilliant for beginners as it is tolerant of using other style shortcuts so you don't burn yourself. Even though you might learn slower you're more likely to progress as it's less frustrating.

I don't know if there's much evidence of these game style methods actually working. I tried vim-adventures [1], but just found it annoying. As far as I can tell you just want to apply similar learning techniques as with touch typing, so just typing the letters to the screen.

As a side benefit of learning Vim, it's encouraged me to improve my touch typing because of the added benefit that you can type your Vim commands faster.

[0]: https://www.shortcutfoo.com/app/dojos/vim

[1]: https://vim-adventures.com/


I felt vim adventures helped me, but then again that's just anecdotal proving your point.


That's good to hear. As long as it's useful for some people that's all that matters for the people that created it. It's not like there's much evidence about the best way to learn Vim so your anecdote is as good as mine. At least there's a lot of people that have generated different methods to suit different people.


Vim adventures also helped me to get started in Vim. I never finished it but it definitely was useful in learning the basics. I recommend it.


Exactly same here. I wanted to chime in because it sounded like it would help supplant the anecdotal evidence.


I'm going to try that! I wonder though, who here didn't have success with vimtutor? I had success learning the basics of vim with vimtutor.


Vimtutor did not work for me, but vim adventures taught me enough to be comfortable using vim on a daily basis. I think it may be because vimtutor focuses on one topic at a time, while vim adventures forces you to use everything you learned up to a point, so it is more of a spaced repetition approach.


"To quit, press ESC or q." They fail to teach you the most important command of VIM.


“ZZ”?


"ZQ"?


:q


:q!


:qa! because I totally saved that first buffer... right?


    CTRL-ALT-T
    $ killall vim


I see that and raise with killing the entire virtual machine in order to exit nano.

* https://unix.stackexchange.com/questions/412194/


> Please do not confuse PacMan with pacman (the arch Linux package manager). PacMan is a classic, popular arcade game released in the 1980s.

This is the most wonderful praise one could give to Arch.


It's funny how they make a clear distinction based on capitalization but fail to capitalize Arch Linux.


If you want to internalise the vi cursor movement keys, play the old unix game "hunt" with your colleagues or classmates.

See http://techtinkering.com/2009/08/11/my-top-10-classic-text-m... (it's at no. 2)

"This is a multi-player games that can be played over a network, or via multiple terminals on one machine. It consists of a top-down view of a maze where you run around trying to find your opponents to kill. There are a number of weapons and you can also play in teams. It is surprisingly fun, a sort of top-down text mode doom.

Originally written by Conrad Huang and Greg Couch in 1979/80."


Emacs has something called Keywiz https://marmalade-repo.org/packages/keywiz which will gather your keybindings (including custom ones) and ask them back to you as a quiz.

Not as cool as this but I used to play it back in the day and learnt quite a few neat tricks from it.


Or try kakoune, a more discoverable and ergonomic rewrite of vim.


Absolutely. 19 years of using vi/vim, and kak won me over in less than a week. One year later, still very happy with kak. Vim is great, but kak is better. Its source code is pretty exemplary, too, and I don't ordinarily have anything at all good to say about C++.


I wish it didn't use alt so much. I use alt it heavily in my i3 bindings.


Why not Mod4 AKA the Windows key?


I use it for i3 too.


Why not nano where all your questions are answered on the lower part of the screen?


nano is not a bad editor. It has a very straightforward learning curve but it is less featured and extensible.

kakoune has more features and high quality plug-ins than nano.

kakoune also interoperates better with tmux.


It's not bad but it's not powerful either.


would be awesome to just:

  docker run -it --rm pacvim
I'll probably build it tonight if nobody else does (please comment here so we don't duplicate work)


I've been practicing making Dockerfiles for things so I figured I'd do this one too.

https://gist.github.com/allanlw/64aaa1ed1b24fa3eb833da7940b3...

Dockerfile style/feedback appreciated, although this is really quite terse


Here's one based on alpine which should be a bit smaller:

https://gist.github.com/tlrobinson/f64d80b872338a878d14601ed...


Nice. I forked it and added tini to handle signals. I also pushed it up to docker hub so anybody can run with:

  docker run -it freedomben/pacvim
I'm gonna send a PR to the pacvim project but here's the repo for now: https://github.com/FreedomBen/pacvim-docker

Edit: Here is the PR - https://github.com/jmoon018/PacVim/pull/29


Somebody please make 'PacMan - a text-mode game to learn Man commands'.


A more ambitious project would teach a deep understanding of monads and/or the borrow checker through the mastery of pacman patterns. And if you're bad, you learn a lot about continuations.



Interesting that this was implemented as a standalone C++ Application. I was expected this to be a vim script like program, which would be more desirable as it would pick up on custom defined shortcuts in my ~/.vimrc.


Obligatory mention of vim adventures [0] and vim tutor [1] :)

Will try this as well as this seems to be something between nethack and vim adventures?

[0] https://vim-adventures.com/

[1] man vimtutor

Edit: arch has a package for it in the aur pacvim-git so pacaur/packer/yaourt can be used to easily install it

Edit2: the game doesn't really teach you anything this is basicly vim adventures without any explanation :/ would have liked something to give vim beginners to get comfortable with the keybinding while actually learning them


Doesn't work for me at all on Arch.

I always just see : Press enter to play => You win the game!

Without anything inbetween, and it jumps straight to the next level.


I'm getting the same behaviour on Ubuntu 16.04 with gcc version 7.2.0.

Edit: There seems to be an issue for this with a fix. https://github.com/jmoon018/PacVim/issues/28


Did you install from the AUR? It works fine for me.


True, aur package works.

I tried to manually build from source before.


Those games are always for vim. But I would love to have something like this with emacs using all the transposition commands or what is available from paredit/smartparens.


> There are two modes

> n – normal mode. > h – hard mode.

> The default mode is h, which is hard

That's an interesting definition of 'normal', then.


Other editors are available.

I've never been either old enough (47) or cool enough (-20C) to really give a shit about vi/vim or emacs and co. I merely tolerate them and can do the very basics.

I use joe by preference at the console ("boredom" if you like - no real excitement) and live with nano. vi and emacs I merely tolerate because I generally have to look up something.

kate's alright - she's a pretty lass (for an editor) but needs a lot of Plasma and QT.


"JOE is a blending of MicroPro's venerable microcomputer word processor WordStar and Richard Stallman's famous LISP based text editor GNU-EMACS (but it does not use code from either program): most of the basic editing keys are the same as in WordStar as is the overall feel of the editor. JOE also has some of the key bindings and many of the powerful features of EMACS."

sounds like you'd enjoy emacs


These editors (and some other ones, but not "joe" or "nano") are very powerful tools. It pays off to learn one well.


I'm pretty old... when I started they taught Cobol at college... But why can't we just use nano?


Text UI != CLI.

I still remember the vim movement commands from some game I played years ago when I tried to learn it. It's a nice way to learn. Reminds me of "typing games" that used to exist.


The classic key bindings for rougelikes were vi key bindings. So rogue, hack, nethack, moria... Newer games of the genera typically still allow the classic bindings, but not as easily supported.


Back in the early 90s, I learned the vi movement keys through hunt(6) from the BSD Games collection. Can't find a good link for the package, but here is the man page: https://www.unix.com/man-page/bsd/6/hunt/


That package has another excellent way of learning vi commands...

The 'quiz' program had the data set of 'ed' ( https://github.com/vattam/BSDGames/tree/master/quiz / https://github.com/vattam/BSDGames/blob/master/quiz/datfiles... )

    print whole file:1,$p|g/[^|$]/p
So it would print out "print whole file" and you could enter one of:

    1,$p  
    g/^/p
    g/$/p
Hunt is also in that repo.



Was waiting for someone to say this. Got comfortable with Vim movement while descretley playing in-browser Dungeon Crawl Stone Soup at work.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: