
A CLI game to learn Vim - prando
https://www.ostechnix.com/pacvim-a-cli-game-to-learn-vim-commands/
======
icc97
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](https://www.shortcutfoo.com/app/dojos/vim)

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

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

~~~
Nr7
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.

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

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

~~~
caioariede
“ZZ”?

~~~
mycodebreaks
"ZQ"?

~~~
Veelox
:q

~~~
camdenreslink
:q!

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

~~~
bbeonx

        CTRL-ALT-T
        $ killall vim

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

* [https://unix.stackexchange.com/questions/412194/](https://unix.stackexchange.com/questions/412194/)

------
jgtrosh
> 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.

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

------
Tepix
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...](http://techtinkering.com/2009/08/11/my-top-10-classic-text-mode-
bsd-games/) (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."

------
noufalibrahim
Emacs has something called Keywiz [https://marmalade-
repo.org/packages/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.

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

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

~~~
JetSpiegel
Why not Mod4 AKA the Windows key?

~~~
icholy
I use it for i3 too.

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

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

[https://gist.github.com/allanlw/64aaa1ed1b24fa3eb833da7940b3...](https://gist.github.com/allanlw/64aaa1ed1b24fa3eb833da7940b34b58)

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

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

[https://gist.github.com/tlrobinson/f64d80b872338a878d14601ed...](https://gist.github.com/tlrobinson/f64d80b872338a878d14601eda764bdb)

~~~
freedomben
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](https://github.com/FreedomBen/pacvim-docker)

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

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

~~~
pvg
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.

------
adkafka
Bit of a backdoor if you press '&' :)
[https://github.com/jmoon018/PacVim/blob/master/src/game.cpp#...](https://github.com/jmoon018/PacVim/blob/master/src/game.cpp#L141-L143)

------
adkafka
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.

------
BlackLotus89
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/](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

------
the_duke
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.

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

~~~
the_duke
True, aur package works.

I tried to manually build from source before.

------
testcross
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.

------
boffinism
> 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.

------
gerdesj
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.

~~~
Vekz
"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

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

------
cup-of-tea
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.

~~~
shagie
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.

~~~
ralphm
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/](https://www.unix.com/man-page/bsd/6/hunt/)

~~~
shagie
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/tree/master/quiz)
/
[https://github.com/vattam/BSDGames/blob/master/quiz/datfiles...](https://github.com/vattam/BSDGames/blob/master/quiz/datfiles/ed)
)

    
    
        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.

