Alibabacloud.com offers a wide variety of articles about difference between vi and vim, easily find your difference between vi and vim information here online.
Vi/vim EditorOpen File:#vi [Option][file ...]+#: After opening the file, the cursor is directly at the beginning of line #;#/pattern: After opening the file, the cursor is directly at the beginning of the first line that is matched to the PATTERN;(1) Mode conversion:Edit mode: Default modeEdit mode---> Output mode:I:insert, enter at the cursor positionA:append, a
1. Edit File/USR/SHARE/VIM/VIMRCsudo vi/usr/share/vim/vimrc2, insert the following line under set backspace=2Set AI "Auto Indentingset ruler" show the cursor positionset hlsearch "Highli ght the last searched Termset history=1000 "Keep + lines of historysyntax on" syntax Highlightin Gfiletype plugin on "Use the file type plugins3, Save exit, view effect4, if you
file (common)
: w! If the file is read-only, force the file to be written, but it depends on what permissions you currently have.
: Q leave VI (common)
: q! Force leave without saving files
: Wq (: wq!) left after saving (forced save)
: W[filename] Save edited data to another file (similar to save file)
: Set NU Displays line numbers and line numbers at the beginning of each line
: Seu Nonu Cancel line number
4. Vim's
text Editing tools under the VI command lineVim is an enhanced version of VIcommand vim to start the Vim editorvim can typically be used in the form of a vim+ target file pathif the destination file exists, Vim opens the fileIf the destination file does not exist, create a n
original position (the position of the last use of the G command). If you do an edit operation in this middle, two anti-quotes move the cursor back to the last edit position. If you use the Search command, you can move the cursor back to the location of the last search. "and" functions similarly, except that it moves the cursor back to the beginning of the row where the last position was, not the exact position.Moving the cursor according to the line number is a quick way to move in a large fil
You can use the: s command to replace a string in Vi/vim. The command has a number of different details of how to use the method, you can implement complex functions, record several here, convenient later query.: s/vivian/sky/replaces the current line the first Vivian is sky: S/vivian/sky/g replaces the current line all Vivian are sky: N, $s/vivian/sky/replaces the first Vivian of each row in the nth row to
You can use the: s command to replace a string in Vi/vim. The command has a number of different details of how to use the method, you can implement complex functions, record several here, convenient later query.: s/vivian/sky/replaces the current line the first Vivian is sky: S/vivian/sky/g replaces the current line all Vivian are sky: N, $s/vivian/sky/replaces the first Vivian of each row in the nth row to
You can use the: s command to replace a string in Vi/vim. The command has a number of different details of how to use the method, you can implement complex functions, record several here, convenient later query.: s/vivian/sky/replaces the current line the first Vivian is sky: S/vivian/sky/g replaces the current line all Vivian are sky: N, $s/vivian/sky/replaces the first Vivian of each row in the nth row to
How to use FG to quickly return to vim?When you use VIM to modify a parameter in a file, you cannot remember the parameters for a long time. It often appears that when we just opened this file with Vim, we forgot the parameters just now. At this point we need to temporarily exit this file to find parameters in a directory. Or, you have multiple open actions to cl
Vi-vim Editor: Full screen editor, modal editorVim mode:Edit mode (Command mode) Input mode Last-line mode (bottom-row mode)Mode conversion: Edit mode--Input mode: I: Enter in front of the character where the current cursor is located I: Input at the beginning of the line where the current cursor is located A: Enter after the character of the current cursor A: Insert at the last na
Common vi/vim commands and common vivim commandsWorking Mode
INSERT command
A attaches text behind the cursor
A adds text at the end of the line
I insert before the cursor
I insert text at the beginning of the line
O Insert a new row under the cursor
O Insert a new line to the cursorLocating command
H move one character to the left/the arrow to the left
J. Move down one row/down arrow
K move up one row/Up
: ctrl + t
3. Set multiple tags paths: Just jump across your project. What should I do if I want to see the system function? Use :! Man is fine, but what should I do if I want to see python library functions?
You can edit your own vimrc directly in vi: e $ MYVIMRC, but of course you don't need to input so much. After entering MY, you can use the tab to complete it,
Set tags =./tags,/usr/lib/python2.6/tags
4. Display All tags of a keyword:
: Ts keyword
Abstract:
1) move the cursor in the screen;
2) move the cursor inside the row;
3) screen scrolling;
Vi vim has the compilation mode and command mode. The following cursor movement operations are performed in command mode;
The following uses the ^ character to indicate that the Ctrl key is pressed. For example, ^ F indicates that the Ctrl and F keys are simultaneously pressed;
In the following, press a key
VI test.txtOrVim Test.txtVim is an upgraded version of VI, with more commands and stronger functionality.The following is a collection of vim usage, when you want to implement the exit in Vim, the first thing to do is to press "ESC", and then enter ": Wq" One or one-like mode: Delete, copy and paste Class command x,x x
Enter Vi/vim VI/vim filenamethree modes of Operation:text editing mode: I,a,o into the text editor, press ESC to exit the text edit and convert to command mode. 1) I insert text at the cursor location. ·2) a The text is inserted at the next position where the cursor is located. ·3) o Insert a new line, and then inse
http://my.oschina.net/laserdance/blog/53474 a lot of win under the compiled configuration file (decoding format has UTF8/GBK) uploaded to the Linux server when the Chinese characters garbledHere's how to fix it:Modify the VI environment configurationVi/etc/vircAdd a row AnywhereSet fileencodings=utf-8,gbk,ucs-bom,cp936SaveThen quit the connection reconnect to more articles link: Vi/
Vi/Vim
Picture copyright: lampbrother
Note: After Entering Vim/Vi, the command mode is used by default.
1) Basic commands
AAdd text behind the cursor
IInsert text before the cursor
: WqSave changes and exit
ZZShortcut Key, save the modification and exit
: Q!Exit Without saving changes
: WSave changes
2) ba
Vi/Vim
Picture copyright: lampbrother
Note: After Entering Vim/Vi, the command mode is used by default.
1) Basic commands
AAdd text behind the cursor
IInsert text before the cursor
: WqSave changes and exit
ZZShortcut Key, save the modification and exit
: Q!Exit Without saving changes
: WSave changes
Tags: height alt ima data an insert es2017 not sharedThree modes of 1:VIGeneral instruction Mode: VI opens (creates) a file by default in general instruction mode, you can move the cursor up or down, use shortcut keys to copy and paste, delete entire row of columns.Edit mode: In the general instruction mode, press "I, I,a, A,r, R,o, o" Any one, enter the editing mode, the bottom left corner appears insert or replace Word. Keyboard input is now availab
Tags: string for select blog multiple status letter vim tmp(a) What is Vi/vim?Almost all the configuration files in the Linux world exist in plain text, and the VI editor is available on all Linux distribution systems, so it is convenient to easily modify the various configurations of the system with simple text editin
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.