Skip to main content
Background Image
  1. Posts/

Basic Vim Cheat Sheet

·3 mins·
Yalchin Mammadli
Author
Yalchin Mammadli
Experienced Python developer with 6+ years of expertise in Django, Flask, and FastAPI, specializing in high-performance web applications. Skilled in Node.js/TypeScript (Express), Docker, CI/CD, and TDD with 95% test coverage. Proven track record across ERP, CRM, e-commerce, blockchain, and AI projects. Focused on continuous growth and delivering impactful, scalable solutions.
Table of Contents

Vim is a highly configurable text editor built to make creating and changing any kind of text very efficient. It is included as “vi” with most UNIX systems and with Apple OS X. This written tutorial will help you to understand basic key bindings of Vim. You can also refer to this tutorial in order to use it as your cheat sheet.

Your Cheat Sheet
#

NoCommandMeaning
1:wSave
2:qQuit
3:q!Quit without saving
4:wqQuit with saving
5kNavigates up
6jNavigates down
7hNavigates left
8lNavigates right
9iEnter insert mode
10esc or ctrl +[Enter normal mode
11ggNavigates to the top
12GNavigates to bottom
13HHigh: takes you to the top of your code
14MMiddle: takes you to the middle of your code
15LLow: takes you to the bottom of your code
16nGNavigates to n-th line (example - 3G navigates to 3rd line)
17{Navigates one code block up
18}Navigates one code block down
19nkN lines up
20njN lines down
21nhN lines left
22nln lines right
23uUndo
24ctrl + rRedo
25. (period)Do it again
26yyCopy
27PPaste above
28pPaste below
29vSwitches to visual mode
30oAdds new line below and enters insert mode
31OAdds new line up and puts you inside insert mode
32wNavigate to next word
33bNavigate to previous word
34:nTakes you to the n-th line
350 (zero)Navigates to the beginning of line
36^ or 0wNavigates to the beginning of the first word in the line
37WNavigates to next word (ignores punctuation)
38BNavigates to previous word (ignores punctuation)
39tNavigates to the specified character and put the cursor one before the specified character (example: t!)
40fto the specified character and put the cursor on the specified character (example: f!)
41%Navigates to the next same character
42cwChanges next word
43dwDeletes next word
44DDeletes rest of the line (after coursor)
45CDeletes rest of the line (after coursor) and enters insert mode
46ctThen press the letter that you want to change up to, will delete till that letter and enter insert mode
47dtThen press the letter that you want to change up to, will delete till that letter
48*Searches for current word
49;Goes to next instance
50aTakes you to the next character and put you into insert mode
51ANavigates to the end of the line and enters insert mode
52ITakes you to at the beginning of the line and puts you into insert mode
53~Swaps the letter (upper to lower case or vice versa)
54/Searches particular word or character, press “Enter” to find. (Then you can use n to navigate next occurrence or N to the previous)
55:numNavigates to specified line. Example: :55 will take you 55th line

Related

What Is Virtual Environment in Python and How to Set Up Virtual Environment
·4 mins
How to Secure Ipfs Node
·3 mins
Sorting Algorithms and Binary Search in Python
·3 mins
Map Sort Filter Functions in Python
·2 mins
Implementing Database Logs or History
·7 mins
Python Decorators With Function and Decorator Parameters
·1 min