not have any action on the character, you can exit directly: q! When using VIM to open a file and manipulate the characters, discard all operations to exit: Wq Save Exit: wq! Force-Save exit, take effect for Superuser and file owner9.vim ManualVimtutor Vim's Handbook: Q Exit VimtutorVim is a powerful editing software, today can only be explained to you these commonly used, I hope everyone in the future work slowly discover new features, skilled use of vim editing software. I also hope that with
Brief introductionThere are many kinds of text editors under Linux, VI is the most commonly used, and it is also standard for each version of Linux. Note thatVI is just a text editor that can color characters and can be auto-complete, but unlike word in Windows, there is a typography feature. VI is a decade to grind a sword of the product, although the command is
First, delete multiple linesSingle-row deletion,: 1 (line number to be deleted) dMulti-line Delete,: 1,10dDdDelete the cursor in the rowNddDelete n rows starting at the current lineDwDeletes a character starting with the current characterNdwDeletes n characters starting with the current characterd$, DDeletes a line of characters starting with the current characterDDelete to the beginning of the next sentenceDDelete to the beginning of the next paragraphD EnterDelete 2 rowsSecond, duplicate multi
cursor at the end of the line
: n1,n2d: Delete the specified range of rows
4. Copy and Cut commands
YY: Copy when moving forward
Nyy: Copy the current row following n rows
DD: cut when moving forward
NDD: Cuts the current row following n rows
P, p: Paste
5. Replace and Cancel commands6. Search and Replace commands
Set IC and set Noic
%s: full-text replacement
%s/dd/sam/g
Start line, terminating line substitution
in the current row with P2: n1,n2s/p1/p2/g: All P1 in line N1 to N2 are replaced with P2 ": 2,7s/ma/ma666/g": g/p1/s//p2/g: Replace all P1 in the file with P2 ": g/ma/s//ma5555/g"G/makaidong/s//macaihong/gG/macaihong/s//makaidong/g5. Line Mode command: N1,N2 CO N3: Copy the contents of the N1 line to the N2 line under the N3 line "similar to copy copy: 2,3 Co 10": n1,n2 m N3: Moves the contents of the N1 line to the N2 line below the N3 line "move similar to clip: 2,3 m 18": n1,n2 D: N1 The con
Next page: Page Down
Up one page: Page up
To the beginning of the line: Home
To end of line: End
Move to the end of the file: G
Move to file header: GG
The cursor moves down n rows: N
Search down Word string:/word
Press N again: Search down
Then press N: Search up
Search for word1 between N1 and N2 lines and replace with Word2:: n1,n2s/word1/word2/g
Search for word1 between the first line and the last row, and replace it with Word2:1, $s/word1/word2/g
(1) VI is used in three wayscommand line mode text mode last line mode(2) command line mode can copy, delete, paste, insert, undo operationCopy command:Paste command:Delete command:Insert command:Undo command:(3) The last line mode can be saved, manipulated, replaced operationSave command:Use of VI Editor on Linux
The vi can be divided into three states, namely command mode, insert mode, and the bottom line mode, the function of each mode is as follows:Command-line mode:Controls the movement of the screen cursor, the deletion of characters, words, or lines, moving and copying a section and entering insert mode, or to last line mode.Insert mode:Only in the Insert mode, you can do text input, press "esc" to return to the command line mode.Bottom row mode (last line mode):Save or Exit VI, or you can set the
Tags: class command mode access use instead of case install shift Lin
By default, Vim uses a built-in register instead of an X Window's clipboard
Enable system Clipboard SupportYou can use vim --version | grep clipboard the view, if the Clipboard is displayed before the tag, - but not + the marker, indicating that the Clipboard cannot be accessed.You need to install Vim's X environment support and install it using the Package Manager gVIM .How to use*the method is available with an indic
Tags: GPO linu nbsp CTR Open File Version command line edit modifyVI Most original versionVim modified version, more powerfulOpen FileVim file path (command line mode)The command line mode enters edit mode:A append to the current positionI insert forward in the current positiono Edit the next line in the current rowO edit a line at the current position Save:Switch back to command-line mode: Press ESCPress: SHIFT +: Switch to Extended modecommand-line mode common commands:NG: Jumps to the end of
Tags: vim linux text editorVim is an upgraded version of VI, which is displayed according to the text attributes, with the following details:General mode:1. Cursor Positioning:Move left and right one character, H LMove one character up or down, K JLeft and right down, around on both sides, down in the middle so rememberCursor positioned at the beginning of shift+6 ^Cursor positioning line End shift+4 that is $Cursor positioned to the first line of tex
Vim Editor Our computer's editor is divided into two categories1, Text editorThe text editor edits the pure ASICLL document without any extra modifiers2, Word ProcessorWord processors include Word documents, word processing tools inside WPS, with many modifiers, but modifiers are not related to file content, but modifiers are an effective part of document data.On
The main contents of this section
Three modes of the VIM editor
Move cursor
Input mode
Modify text
Zhou Zhihu L.Number: ZhouzhihubeyondNET Name: Rocking Teen Dream1. Three modes of the VI editorLearning to use the VI editor is one of the most essential techniques to learn Linux systems, because Linux
Vim text editor under the Linux command lineVim text Editor is a very powerful tool that can do many things, such as creating new files, opening files, editing files, saving files, and opening multiple files at the same time. Here is a summary of some of the commonly used VIM editor commands:1.The way to enter the VIM
VI is the standard editor for UNIX and Linux systems. Once you learn it, you will be in the world of Linux. Basically VI can be divided into three states, namely the command mode, insert mode, and the bottom line mode.The VI Editor is the standard editor for all UNIX and
In Linux, the Vim editor is the system's own text editor, which is powerful. This vim (VI) is very simple. Note: The Linux command should be lowercase oh!Vim Editor, you can create a new file can also modify the file, the command is: vim/usr/local/con.cfg If this file is not
In Linux, the Vim editor is the system's own text editor, which is powerful. This vim (VI) is very simple. Note: Linux commands are lowercase!Vim Editor, you can create a new file can also modify the file, the command is: vim/usr/local/con.cfg If this file is not previously,
In Linux, the Vim editor is the system's own text editor, but to modify a text file, it is not like Windows, more novice, into the VI editor, can not exit so that the forced shutdown, in fact, this vim (vi) is very simple.1. Enter the VIM editorVim Editor, you can create a n
10 line position after the cursorH: Current screen head M: Current screen middle L: current screen EndG: Last line of FileY W paste a WordYY: Copy a row can be added number 5YY cursor current after 5 lines containU: Undo OnceU: Undo AllD W: Delete a wordD d: Delete Row 10dd: Delete 10 rowsD: Delete the current letter after D ^ Delete the current letter beforeSearch: VI Editor's search function, enter "/" below the VI editor, search for string to be e
Tags: targe new tar switch insert mode set for also modeVI (VIM) is a very common editor on Linux, and many Linux distributions have VI (VIM) installed by default. VI (VIM) commands are numerous but if used flexibly it will greatly improve efficiency. VI is the abbreviation for "Visual Interface", Vim is VI improved (enhanced version VI). In general system Manage
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.