I promised my colleague that I would become a VIM pro. 😁 I already know some basics, but I wish I would be more advanced. I actually wanted to practice every day, but I have so much to do for my studies right now. =/
Vim is a text editor for efficient text editing and programming. Vim is useful when you work a lot with the command line in linux. Alternatively there’s nano. Nano is easier to use, but not that efficient and powerful as vim.
According to the tutorial of vim – hero . com it’s not that much. 🤔
Learning vim is just a mix of memorization and practice. But the vim documentation has a hundreds of commands and options.
Basic Navigation
h - Move left
j - Move down
k - Move up
l - Move right
gg - Go to the beginning of the file
G - Go to the end of the file
:n - Go to line number n
w - Move to the beginning of the next word
b - Move to the beginning of the previous word
0 - Go to the beginning of the line
$ - Go to the end of the line
Editing
i - Enter Insert mode before the cursor
a - Enter Insert mode after the cursor
o - Open a new line below the current line
O - Open a new line above the current line
x - Delete the character under the cursor
dd - Delete the current line
yy - Yank (copy) the current line
p - Paste the yanked text after the cursor
u - Undo the last action
Ctrl + r - Redo the last undone action
Searching
/pattern - Search for pattern forward
?pattern - Search for pattern backward
n - Repeat the last search in the same direction
N - Repeat the last search in the opposite direction
Saving and Exiting
:w - Save the file
:q - Quit Vim
:wq - Save and quit
:q! - Quit without saving
Visual Mode
v - Enter Visual mode
V - Enter Visual Line mode
Ctrl + v - Enter Visual Block mode
Miscellaneous
:set number - Show line numbers
:set nonumber - Hide line numbers
:help - Open the help documentation
Leave a Reply