Ranking of Vim commands I use most often after 2 years of Vim experience

A1020 000055

I have always used Vim to create web services. I have been using Vim for about two years now. As a reminder, I summarized the commands that I often use (but easily forget).

1. Create a new tab

:tabe

2. Close the current tab

:tabc

3. start over

u

4. cancel

Ctrl + r 

There is a big difference between knowing this and not knowing this.

5. Move the screen halfway down.

Ctrl + d

6. Move the screen halfway up.

Ctrl + u

7. Move to the first line

gg

8. Move to the bottom line

G

9. Delete and copy lines from the specified line

Type ms on the start line, me on the end line, and then the following command

:'s,'ed (削除) :'s,'ey (コピー) 

This is quite useful.

10. Batch Replace in File

:%s/hoge/hoge2/g 

Note that I often forget.

11. Change line break tag

When a file edited on windows is opened on a mac, there are times when it has strange line feed tags and the text has been packed. In such cases, this is the solution.

:set fileformat = mac :set fileformat = unix 

This is also fine :set ff = mac :set ff = unix