Update Log
October 31, 2023: Online VIM Editor Simulation Toolbox completed and launched

Online VIM Editor Simulation Tool

This is an online tool that simulates the VIM editor, allowing for simple simulations of basic VIM editor commands and displaying the results. It also provides the functions and corresponding commands of the VIM editor for friends in need to refer to and use.


Online VIM Editor Simulation Learning

VIM Editor, one of the most commonly used editors on Linux, is loved by many programmers. Mastering VIM operations is considered a prerequisite for a qualified programmer.

VIM Editor | VIM Introduce

  1. Learning VIM will make it your last text editor to use. There is no better text editor, it is very difficult to learn, but incredibly useful.
  2. I suggest the following four steps: ①. Survival; ②. Feeling good; ③. Feeling better, stronger, faster; ④. Using VIM's superpowers.
  3. The learning curve of VIM is quite steep, so if you see a bunch of VIM command categories at the beginning, you will definitely lose interest in this editor.
  4. vi(vim) is a very commonly used editor on Linux, and many Linux distributions come with vi(vim) installed by default. vi(vim) has many commands, but once you master them, it will greatly improve your efficiency. vi stands for "visual interface", and vim is short for vi IMproved (an enhanced version of vi).

VIM/VI Basic Commands | VIM Learning

Category Command
1. Open, Save, Close Files vim filename // Open the filename file
:w // Save file
:w https://www.masters-tool.com // Save to https://www.masters-tool.com file
:q // Exit the editor, if the file has been modified, please use the following command
:q! // Exit the editor without saving
:wq // Exit the editor and save the file
2. Insert Text or Line (Press ESC to exit insert mode) a // Add text to the right of the current cursor position
i // Add text to the left of the current cursor position
A // Add text at the end of the current line
I // Add text at the beginning of the current line (at the start of the non-empty line)
O // Create a new line above the current line
o // Create a new line below the current line
R // Replace (overwrite) the text at and after the current cursor position
J // Merge the current line and the next line into one line (still in command mode)
3. Move Cursor Use the up, down, left, and right arrow keys
In command mode: h left, j down, k up, l right.
Spacebar right, Backspace left, Enter moves to the next line start, - moves to the previous line start.
4. Delete, Restore Characters or Lines x // Delete the current character
nx // Delete n characters starting from the cursor
dd // Delete the current line
ndd // Delete n lines including the current line
u // Undo the last operation
U // Undo all operations on the current line
5. Search /atool // Search for the string "atool" below the cursor
?atool // Search for the string "atool" above the cursor
n // Search down for the previous search term
N // Search up for the previous search term
6. Jump to Specified Line n+ // Jump down n lines
n- // Jump up n lines
nG // Jump to line number n
G // Jump to the end of the file
7. Set Line Number :set nu // Show line numbers
:set nonu // Hide line numbers
8. Copy, Paste yy // Copy the current line to the clipboard, you can also use "ayy to copy, "a is the buffer, a can be replaced with any letter from a to z, to complete multiple copy tasks.
nyy // Copy the current line and the next n lines to the clipboard, you can also use "anyy to copy, "a is the buffer, a can be replaced with any letter from a to z, to complete multiple copy tasks.
yw // Copy characters from the cursor to the end of the word.
nyw // Copy the next n words starting from the cursor.
y^ // Copy content from the cursor to the beginning of the line.
y$ // Copy content from the cursor to the end of the line.
p // Paste the content of the clipboard after the cursor, if a custom buffer is used before, it is recommended to use "ap for pasting.
P // Paste the content of the clipboard before the cursor, if a custom buffer is used before, it is recommended to use "aP for pasting.
9. Replace :s/old/new // Replace the first occurrence of "old" with "new" in the line
:s/old/new/g // Replace all occurrences of "old" with "new" in the line
:n,m s/old/new/g // Replace all occurrences of "old" with "new" from line n to line m
:%s/old/new/g // Replace all occurrences of "old" with "new" in the current file
10. Edit Other Files :e otherfilename // Edit the file named otherfilename.
11. Modify File Format set fileformat=unix // Change the file to Unix format, for example, text files under Windows may have ^M in Linux.