As we all know, Vim is the next very important text editor for Linux. We can use it to look at code and change code, and many experts have directly made Vim into a powerful IDE for writing code.

However, Vim is more difficult for beginners to get started with than other editors. Vim is an editor without a graphical interface, and everything depends on the instructions, and the instructions are very many and very complicated, which is very difficult to learn.

Is there a faster and easier way to learn Vim? Here’s a game that improves your Vim skills.

The game is called PacVim, and it was actually inspired by a game called PacMan. The two are very similar. They both avoid monsters and eat Beans. The difference is that PacVim uses Vim’s commands to operate the protagonist throughout the game, and in this way improves your Vim level.

Install PacVim games

The source code of this game is hosted on GitHub, just download, compile and install.

$ git clone https://github.com/jmoon018/PacVim.git
$ cd PacVim
$ sudo make install
Copy the code

Start the game

After successful installation, execute the following command to start the game:

$ pacvim [LEVEL_NUMER] [MODE]
Copy the code

Among them:

  • LEVEL_NUMER: indicates the level number
  • MODE: Difficulty, n – formal MODE, H – hard MODE

For example, if we want to play level 5, the game in formal mode, we can start the game like this:

$ pacvim 5 n
Copy the code

If we just wanted to play the game from scratch, it would be like this:

$ pacvim
Copy the code

Here’s what the game looks like after it runs:

The game still looks fun, at least a lot better than just remembering the commands.

Quit the game

Exiting the game is as simple as pressing ESC or Q.

The rules of the game

As mentioned above, the basic rule of the game is to avoid monsters and eat beans. But in this, dou dou is a white word, as you pass, the characters will turn green.

In the game, the main character is a green square and the monster is a big red G. There are two types of obstacles:

  1. Yellow is the wall, you can’t go over the wall;
  2. Blue float key~It won’t attack you, but you can’t touch it either. Touch it and you’ll die.

You have 3 lives in total, but pass levels 0, 3, 6, and 9 and an extra life is awarded. The game has a total of 10 levels, from 0 to 9, after passing the 9th level, will start from the 0 level again, but more difficult.

[A]. Conditions of victory

Manipulate the green square and turn the white characters into green characters. When all the white characters turn green, you win that level and move on to the next level. Use the Vim command for the entire operation.

B. Failure conditions

If you touch a monster (capital G) or an float key ~, you’re dead and you lose a life. When all lives are lost, the game ends.

Since it is used to learn Vim operation, then we must know what Vim has some instructions. The common instructions are shown below:

Through this game, under tension and pressure, your Vim command unknowingly remember, and then to operate the Vim editor, it will be like flying! Let’s play!

—————–