PacVim: A interesting game helps you master Vim

The use of Vim has always been a problem, so that there is a problem on StackOverFlow, a well-known programmer's Q&A community. How do I exit the Vim editor? Gained over 2 million views.

We often say that learning is painful. Is there any way to help us learn Vim more easily?

The answer is of course yes.

We can learn to use Vim by playing games.

What is PacVim?

PacVim comes from Github developer Jamal Moon. He developed this game in order to help himself learn vim and make the learning curve more smooth.

"Vim is a great tool to write and edit code, but many people, including me, struggled with the steep learning curve. I did not find a fun, free way to learn about the vim commands in-depth, and thus, PacVim was born.", the develpoer says.

What does PacVim look like? First look at a gif.

In this game, you are a little green man with a blue cursor, escape the red vain monster Monster (red G, Ghost, ghost). Unlike the classic Pac-Man, the control in PacVim is not our habit. Up, down, left and right, but Vim's unique keys.

key what it does
q quit the game
h move left
j move down
k move up
l move right
w move forward to next word beginning
W move forward to next WORD beginning
e move forward to next word ending
E move forward to next WORD ending
b move backward to next word beginning
B move backward to next WORD beginning
$ move to the end of the line
0 move to the beginning of the line
gg/1G move to the beginning of the first line
numberG move to the beginning of the line given by number
G move to the beginning of the last line
^ move to the first word at the current line
& 1337 cheatz (beat current level)

How to play PacVim?

There are many ways to play PacVim, the easiest is to run directly with a Docker image. Execute the following code directly, you can start PacVim to play.

docker run -it freedomben/pacvim [LEVEL_NUMBER] [MODE]

The LEVELNumber in the above code ranges from 0 to 9, the larger the number, the more difficult it is.

Mode can be N or H, N means Normal, normal difficulty; H means Hard, difficult.

On MAC, the developer has compiled PacVim into a HomeBrew package. You only need to execute the following command to install it.

brew install pacvim

After the installation is complete, execute a command such as pacvim 8 n and you can start the game!

Are you interested in trying such a game? GitHub repo

Written By

Yuan Gao

Comments :

Leave a Reply