List of content you will read in this article:
Vim is an advanced, powerful UNIX-based text editor that has relatively more features than its previous version i.e. vi editors which many developers and system administrators use. As VIM is a free text editor and has a lot of VIM commands that are difficult to learn or memorize. So in this article, We have prepared an amazing VIM cheat sheet pdf for you to save your time and by using it you can boost your productivity and easier to work with VI/VIM Editor.
Let’s start:
Vim Cheat sheet PDF
1. Vim Quit
:qa |
To close all the file |
:w |
Save the content |
ZQ |
Quit without checking changes |
:wq / :x |
Save and close |
:qa! |
Close all files, ignoring all the changes |
:q |
Simply close file |
:q! |
Close file, ignoring changes |
ZZ |
Save and quit the current file |
2. Vim Clipboard
x |
Remove a character |
P |
Paste the copied content before the cursor |
dd |
Remove a line |
"*y / "+y |
Paste to the system clipboard |
p |
Paste |
yy |
Yank current line |
"*p / "+p |
Paste the copied content from the system clipboard |
3. Editing in Vim
<C-R> |
Redo changes |
A |
Append from the end of line |
i |
Insert |
o |
Next line |
O |
Previous line |
s |
Delete char and insert |
a |
Append |
S |
Delete line and insert |
C |
Delete until end of the line and insert |
r |
Replace one character |
2dd |
delete two lines |
R |
Enter Replace mode |
u |
Undo changes |
cc |
replace the whole line |
ciw |
replace the word |
dd |
delete a line |
diw |
delete the character under the cursor |
Starting From $5.99/Monthly
Linux Virtual Server
4. Search in Vim
Here we have added VIM Search Commands.
N |
Find the previous match |
/pattern |
Find a pattern |
:cn[ext] |
Go to the next pattern found |
:cn[revious] |
Go to the previous pattern found |
# |
The previous whole word under the cursor |
* |
Get the next whole word under the cursor |
5. Moving Cursor in Vim
j |
Move down |
h |
Move left |
L |
Go to the bottom of the screen |
k |
Move up |
l |
Move right |
e |
Go to the end of the word |
W |
Go to the start of the word |
M |
Go to the middle of the screen |
6. Vim Visual Commands
> |
Move text right |
< |
Move text left |
~ |
switch case |
u |
Convert selected text to lowercase |
U |
Convert selected text to uppercase |
7. Vim Macros
@a |
run the macro 'a' |
qa |
record the macro 'a' |
@@ |
run the last run macro again |
q |
stop the recording of macro |
Conclusion
We went over many areas of the vim cheat sheet commands and shortcuts that we can download PDF from the above-given link. We talked about cursor movement, searching, editing, deleting, and exiting, among other things. We can work on this editor without using a mouse because it is advanced enough to accomplish tasks with a keyboard. This offers all of the functionality we require for a variety of tasks. Also, this is similar to the vi cheat sheet.
Keep Exploring.
People also read:
I'm fascinated by the IT world and how the 1's and 0's work. While I venture into the world of Technology, I try to share what I know in the simplest way with you. Not a fan of coffee, a travel addict, and a self-accredited 'master chef'.