VIM is a text editor mainly used under the LINUX environment. It is very quirky and looks like a product of another world to an inexperienced person, but after using it to some extent, you will be able to operate it smoothly so that you can learn how to ride a bicycle.
The good thing about VIM
-Reading and writing is very fast (usually, processing fails when reading and writing a huge amount of JSON etc.) -Since the range of key touch is narrow, the burden on the finger is small. -You can make some nice customs just by rewriting .vimrc (customization of next dream is troublesome because widgets may be involved and it becomes heavy depending on things)
That can be mentioned.
Recently, it seems that there are quite a few people who move to VS Code etc. and leave VIM, and people who do not use VIM from the beginning, but even if you do not code, I remember thinking about opening and editing files in Linux. It's best to keep it.
Below, I will explain the intro part for those who say that they have no experience with VIM, but who want to use it. If you remember this much, you will be able to do a little text processing other than coding without difficulty.
VIM has a lot of features, and I've been using it for less than a year now, and probably not even one-third of its potential. There is an article "Gachi VIMMER in a month" at the link destination, but at least it has not reached this area.
How to make newcomers vimmer in a month
Well, what kind of customization is convenient and what kind of command you want to use depends on the person, so it is important to gradually increase the commands that can be used by each person.
For the time being, let's work hard while using only the following commands at first. If possible, you can increase the number of other commands you use, but I think you can take the stance of "trying to use only this thoroughly for a month."
・ "I or o" and "ESC" Switching between edit mode and command mode. You can't do anything without it.
・ ": W" and ": q" Save and command to exit VIM. I can't do anything without this
・ "Hjkl" Move up, down, left and right. It seems that using the arrow keys is a bad idea, but I think it's unavoidable that the hand goes there a little. Thorough tied-up play will speed up your progress.
・ "Yy" "dd" "p" Copy, cut and paste. It corresponds to the whole line. You should be able to master this even if you force it. By the way, it copies the number of lines specified by "number + yy" (same for dd)
・ "Gg" "G" Warp to the last line or the first line.
・ "Shift + v" or "ctrl + v" Select any number of characters on multiple lines or one line. Then it can be yy or dd. There is a slight habit in the position to attach.
・ "/ (Character string)" and "n" If you enter a character string from "/" and press enter, it will warp to the location of the character string. After that, if you keep pressing n, you will jump to the next candidate.
For the time being, try using the above commands thoroughly. After that, I will increase what I can do at my own pace.
Create a file called ".vimrc" in your root directory and write your favorite settings in it. Since each person's favorite settings are really different, you can select them by referring to the links below. However, for the time being, I think that it is very inconvenient if you do not make it possible to move the cursor to the right of the end of the line with "set virtual edit = onemore".
Write this in ~ / .vimrc without thinking! ~ Introduction to vim for beginners by vim ~
Recommended Posts