Tutorials
Learn More
GVIM Commands
GVim, or Vim (Vi Improved), is a highly configurable text editor that enhances the traditional Vi editor with additional features, providing a powerful and efficient platform for text editing in a graphical environment. Below are the basic gvim commands used by VLSI professionals.
Command |
Description |
i |
Enter insert mode before the cursor |
I |
Enter insert mode at the beginning of the line |
a |
Enter insert mode after the cursor |
A |
Enter insert mode at the end of the line |
o |
Open a new line below the current line |
O |
Open a new line above the current line |
yy |
Copy (yank) the current line |
dd |
Delete the current line |
D |
Delete from the cursor position to the end of the line |
x |
Delete the character under the cursor |
p |
Paste the content after the cursor |
P |
Paste the content before the cursor |
u |
Undo the last change |
Ctrl + r |
Redo the last undone change |
:w |
Save the current file |
:q |
Quit Vim (close current file) |
:q! |
Quit Vim without saving changes |
:wq |
Save and quit |
:e <filename> |
Open a new file |
:bnext or :bn |
Switch to the next buffer |
:bprev or :bp |
Switch to the previous buffer |
:bd |
Close the current buffer |
:vsp <filename> |
Open a file in a vertical split |
:sp <filename> |
Open a file in a horizontal split |
Ctrl + w + hjkl |
Move between split windows |
gg |
Move to the beginning of the file |
G |
Move to the end of the file |
:set number |
Show line numbers |
:set nonumber |
Hide line numbers |
:set hlsearch |
Highlight search results |
:set nohlsearch |
Turn off search result highlighting |
/pattern |
Search forward for the specified pattern |
?pattern |
Search backward for the specified pattern |
n |
Move to the next search result |
N |
Move to the previous search result |
:s/pattern/replace/g |
Replace all occurrences of a pattern |
:s/pattern/replace/gc |
Replace with confirmation |
* or # |
Search for the word under the cursor (forward/backward) |
Ctrl + ] |
Jump to the definition of a function (tags) |
Ctrl + t |
Jump back from the definition (tags) |
:%s/foo/bar/g |
Replace all occurrences in the entire file |
:r <filename> |
Read the content of a file and insert it |
:set ts=4 |
Set tabstop to 4 spaces |
:set expandtab |
Use spaces instead of tabs |
:set nowrap |
Disable line wrapping |
:set wrap |
Enable line wrapping |
:set syntax=<syntax> |
Set syntax highlighting (e.g., :set syntax=python) |
Resources