Developed under Linux, even only management and maintenance work, but also the use of Vim. As a newbie, I am also just getting in touch. This section records the Vim common commands that I use or collect on a daily basis.
Of course, you can learn all the commands of Vim by typing: vimtutor directly on the command line. Vim is very powerful, many cows integrate a lot of plugins in vim, but only the basic vim command is introduced here.
Move Commands
h "Left
j "下下
k "上
l "Right
w "The cursor moves to the first character of the next word a word forward
b "The cursor moves to the first character of the previous word
e "The cursor moves to the next The tail character of a word
ge " The cursor moves to the end character of the previous word
$ " Move the cursor to the end of the current line
^ " Cursor moves to the first non-whitespace character of the current line
0 "Mops the cursor to the first character of the current line
Note: These commands can be preceded by the '0' command. Accept a count, 2$; all the above commands can accept some operation commands, such as d$, dw, etc.
Modify Command
x "Delete a character
d " followed by any displacement command that will delete the text from the current cursor to the end of the displacement
"Content, such as dw, delete word
c " Similar to the d command function, the different commands enter the Insert mode after the deletion, change
dd " Delete A whole line
yy "Copy a whole line
p "Paste the clipboard contents to the current location
vimdiff 1.c 2.c "Create A vertical split window compares the two files to different places
Search Command
f<a> " Single character search, fa is the next a search in the current line, find a
/string "Full-text search for a string, if you want to find the word "func" then use /func
" If the text has multiple func, press n to move it to Down the func position
"n can also accept the number count in front, such as 3n, it will find the next func
?string &qu Ot; has the same function as /string, the only difference is that the search direction is opposite
Note:
You can use: set noingorecase to ignore character case;
/and? The command has a memory function. You can use multiple <UP> keys to select the search history. The maximum number of history records can be changed on the session viminfo;
Search for characters. */?%$^[] and other special characters should be preceded by a backslash;
Search for isolated words, that is, there are no other characters before and after (except spaces, tabs) If you only search for the, don't want to find the there or whether, etc., use /\\<the\\>;
You can use: set hlsearch to highlight the word to be searched;
Positioning command
G " The cursor moves to the last line of the file, or Shift+G
15G " The cursor moves to the 15th line of the file, or 15gg
gg "The cursor moves to the first line of the file
45% "The cursor moves to the file 45%
H "The cursor moves to the very beginning of the current screen
M "The cursor moves to the middle of the current screen
L "The cursor moves to the end of the current screen
Note: CTRL+gView current cursor position
Scroll Command
CTRL+U "Window scrolls up half screen
CTRL+D "Window scrolls down half screen
CTRL+E "Roll up one line, no Too big Meaning
CTRL+Y " scroll down one line
CTRL+F " roll forward a full screen
CTRL+B " roll back a full screen
zz "The current line is placed in the center of the screen
zt "The current line is placed at the top of the screen
zb "The current line is placed at the bottom of the screen
Split window
:split "lateral split
:new "add a new window horizontally
:vsplit "vertical split
:vnew "Add new window vertically
CRTL+W w "Switch small windows in order
:qall "Close all windows
:wall " ;Save all windows
Tab (tab) command
:tabedit filename "Create a tab page called filename in the vim window being edited
:tab split " Create a new tab page
gt " Move to the next tab page
gT " Move to the next tab page
For the time being, learn new The order will continue to be updated.
Compiled linux kernel has been 3 times, each compilation needs to go online to find the compilation
Alibaba Cloud host has been a very good choice for domestic small webmasters, not only mature techno
First, the interrupt system hardware architecture: arm cortex-A9, the interrupt controller on A15 i
Speaking of the easiest way to install the system is to find a system installation CD and then slowl
Ubuntu system Grub failure how to do
Linux CentOS WEB server partitioning scheme
Differences between Linux and Windows systems
File descriptors in server programming
Linux configuration multiple IP
Linux resource limit level summary
Linux Learning: Using File Finder
The difference between hard links and symbolic links
Linux Security Minor - Restrict remote root login
Linux service configuration linux system routing configuration
Ten strokes successfully rule out that WinXP cannot start fault
Excel quickly enters decimals. Two strokes make it easy to improve efficiency
XP comes with Recovery Console Application Tips
Win7 system computer hides QQ data age and gender skills
How to solve the problem of loading desktop failure after Win8 computer update
Office2016 version activation key collection
Windows 10 Build 14278 image exposed on the network