Vi is a widely used text editor in unix/linux. vi has various variants and different variant software on different machines. among them, vim is relatively easy to use and widely used. vim is short for ViIMproved, indicating better vi. this article describes some of the useful features,
I. general mode: the commands for deleting, copying, and pasting x and X are u
Open multiple FilesVim File1 file2: Open/:e does not close vim open fileSub-frame window: New Window: SP Landscape: VSP Portraitctrl+w window switch: TABC Close the current window: Tabo Close All windows: Ctrl+w + Vertical expansion (Increased number of rows): ctrl+w-Zoom Out (decrease in number of lines)inter-file switchingctrl+6-Next file: bn-Next file: bp-Previous fileCopying between multiple filesCTRL + V into visual mode"+y/" *y copy"+p/" *p past
at the cursor position
R
Replaces characters starting at the cursor position, while changing vim to text input mode
.
Repeat the last modification
The cursor moves the key, and the command mode controls the cursor movement.
Key
Function
h or [←]
Move the cursor to the left one
J or [↓]
Move the cursor down one line
K or [↑]
where the cursor is located, and R will always replace the text of the cursor until ESC is pressedInstruction mode: W writes edited data to the drive file: w! If the file property is read-only, the archive is forced to be written. However, in the end can be written, or with you on the file permissions related Ah!: Q Leave VI: q! If you have modified the file, do not want to store, use! Do not modify the file for forced departure: Wq Save exit, wq! Force save exit: w [filename] saves edited data
: W writes data to the hard disk: w! If the file property is read-only, the file is forced to be written. However, it is important to note that this is true if your permission can be changed .: Q Leave Vim: q! Modified the file, and did not want to save: Wq left after saving: wq! forced to leave after saving: W[filename] Save edited data as another file (similar to save As): R[filename] In the edited data, read into the data of another file, the "file
use of Vim under iOS; three modes of vim:1, General mode (default)2, insert mode (write text)3, command-line mode (save) The functions of the various modes are differentiated as follows:1, General mode: Controls the movement of the screen cursor, the deletion of characters and cursors, and moves the copied section. 2, insert mode: Only in the insert mode, you can do text data input, press ESC to return to t
the n-down line of the cursor
Y1g copy all data from the row where the cursor is located to the first row
G. Copy all data from the row where the cursor is located to the last row.
Y0 copies the character of the cursor to all data at the beginning of the row.
Y $ copy all data from the character with the cursor to the end of the row
Paste command: P, P: paste the copied data under the cursor line; P: paste the copied data on the cursor line
Other commands
Since 1970s, Vi has been one of the best programmers. no matter you are a beginner or veteran of Vi, the following section provides 100 useful Vi commands, which I believe will be helpful to you. Basics: efilenameOpenfilenameforedition: wSavefile: qExitVim: w! E...
Since 1970s, Vi has been one of the best programmers. no matter you are a beginner or veteran of Vi, the following section provides 100 useful Vi comm
If my latest post on this topic doesn't remind you, I'm definitely a fan of vim. So before some of you throw rocks at me, I'm going to show you a series of "little-known Vim commands." I mean, some of the commands you might not have met before, but it might be useful for you. As a second disclaimer, I don't know which
. ZZ does not need to enter a colon and press Enter)
:q!→ Exit and do not save:qa!Forcibly exit all the files being edited, even if other files are changed.
:bnAnd:bp→ You can open many files at the same time and use these two commands to switch to the next or previous file. (Chen Hao Note: I like to use: N to the next file)
Let's take a look at how Vim repeats itself:
.→ (Decimal point) The last c
Common Vim commands
Original article addressHttp://dozb.bokee.com/4767885.html
Access the VI commandVI filename: open or create a file and place the cursor at the beginning of the first lineVi + N filename: open the file and place the cursor at the beginning of line NVi + filename: open the file and place the cursor at the beginning of the last lineVi +/pattern filename: open the file and place the cursor
paste d DeleteWord movementW W move to the beginning of the next wordE e moves to the end of the next wordb b backwards to the beginning of the previous wordIt is important to note that E ignores punctuation, such as: I ' m,e will be two words, E won'tSimilarly, precede the command with a number that represents the number of executions, such as: 2w, to move 2 words downI may say a few more times at the beginning, because this technique is important.The entire row moves,0 move to the beginning o
Some of the commands commonly used by the VIM editor under Linux (what to add)Command mode:: Set Nu #显示行号: Syntax on #语法高亮: Set tabstop=4 #tab back four gridVI has three modes: insert mode, command mode, low line modeInsert mode: You can enter characters in this mode, press ESC to return to command modeCommand mode: You can move the cursor, delete characters, etc.Low-line mode: can save files, exit VI, set
Vim played in Windows. after moving to Ubuntu, Vi is very awkward (especially the items on the clipboard cannot be paste in Vi ...) and so on... I plan to convert Vi to Vim, which may be much better. don't talk nonsense, start action. in fact, it is very simple: 1. open the command line and tap the following command (download and install Vim with clipboard functi
Hello everyone, the content continues to explain. This time, we will introduce the vim file editing command in liunx. Well, this command can bring out so much content as you can imagine its importance, in this section, I suggest you contact us to learn more, because this will affect the speed of future operations. Come on ..
Vim Text Editor
Edit File
Vi
[Root @ 0425 ~] #
The usual copy and paste commands for VIM are organized as follows:1. Select the text. Using V to enter the visual mode, move the cursor key selection.2. The command to copy is: Y, the commonly used commands are as follows:Y Copies the selected block to the buffer when a piece is selected using the V mode;yy copy entire row (Nyy or yny, copy n rows, n is number);
# grep-n Domain main.c--colour=auto650) this.width=650; "title=" 6631883603326779415.jpg "src=" https://s1.51cto.com/wyfs02/M02/06/97/wKiom1m6doiS_ Zpgaacqh6w8vyg605.jpg-wh_500x0-wm_3-wmp_4-s_910153933.jpg "alt=" Wkiom1m6dois_zpgaacqh6w8vyg605.jpg-wh_50 "/># vim MAIN.C +62 open it straight to line 62.-N Display line number,--colour=auto find the character with color, if recursive find plus R,-NR#shift +zz Save Exit, (Shift+z is Z, two times Z is also
In linux, vim is quite powerful. at the beginning, everyone who is familiar with it will feel useful but cannot remember what it is for. now let's take a look at the basic commands. (There is no time for today. add some examples in the search time) search: word search down to word? Word direction
In linux, vim is quite powerful. at the beginning, everyone who is
The multi-line comments and multi-line Delete commands in Vim, which are also frequently used tips, can greatly improve productivity. 1. Multi-line Comment: 1. First press ESC to enter command line mode, press CTRL + V to enter the column (also known as block) mode; 2. Use the upper and lower keys at the beginning of the line to select multiple lines needing comments; 3. Press the keyboard (uppercase) "I" k
modeCTRL+F: Flip a screen to the end of the fileCTRL+B: Flip a screen to the file headerText Lookup/word? wordAddress delimitation Startline, EndLine #: Nth row.: Current line $: Last line%: Full textRelative delimitation: +#: N rows down from the specified position-#: up n rows from the specified positionText substitution operationss/to find content/content/modifiers to replace/: separators such as #,@G: Global SubstitutionI: Case insensitiveWhat to look for: You can use regular expressionsWha
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.