another file in the current file: R/path/to/somefile21st, interacting with the shell:! Command22nd, Advanced Topics1, display or cancel line number: Set Nu: Set Nonu2, display ignores case: Set IC: Set Noic3, Set auto indent: Set AI: Set Noai4, find the text highlighted or canceled: Set Hlsearch: Set Nohlsearch5, syntax highlighting: Syntax on:: Syntax off23, configuration file[Email protected] ~]# VIM/ETC/VIMRC[Email protected] ~]# ~/.VIMRC24th,
Vim Text Editor Common commandsSimple IntroductionVI and VIM are the most commonly used text editors on Unix/linux and are very powerful, and Vim is an upgraded version of VI. Vi is similar to Notepad in Windows, and Vim is similar to EmEditor or EditPlus in Windows. 1. Vim
Vim Select text, delete, copy, pasteThe selection of text, for the editor, is a very basic thing, also often used, summarized as follows:V starts at the current position of the cursor, where the cursor is selected, and then ends with a click of v.V starts at the current line of the cursor, the line that the cursor passes through is selected, and then the end of the V is pressed.CTRL + V starts at the cursor's current position, selects the rectangular
Advanced editors all contain macro functions. vim cannot be missing. it is very convenient to use macros in vim: qx starts to record macros, and save the result to the register xq exit record mode @ x play record macro commands in the register x to explain a little. after entering: qx in normal mode, all your edits to the text will be recorded
Some advanced edito
1. Full-text coverageAfter the program is published to the test and development environment, it is often necessary to telnet to the Linux change code. Usually in the IDE, CTRL + A, CTRL + V to cover the entire document, you need to do this in vim
Vim filenameGG-Jumps to the first line (the cursor does not have to be executed when the first row is default)V--Enter visual modeG--Jump to the la
Common editing commands in vim and Shell
Because many of the operations in Linux and Linux are implemented through the command line, mastering some simple command line operations will greatly save our time in unnecessary steps, now we will summarize the frequently used editing commands in vim and shell.
1. Shell:
CTRL
Vim enters vim on the command line and goes to the VIM editorI press the I key and the lower end shows the--insert--insert commandESC exit I (insert) command for other commands to use: R file name reads into a file content and writes to the current editor: W New file name the contents of the editor are written to a new
First I want to say that Vim and VI commands are almost the same, so learning to edit commands is easy, exclude extension correlation, and automatically complement the use of the same configuration30 Seconds to install Vim editor, 5 min to browse common commandsEnvironment: Virtual machine Ubuntu:Install
Run the shell command in vim. the following forms are available ):! The command does not exit vim, and runs the shell command to display the command output in the vim command area. it does not change the content of the currently edited file, for example :! Ls-l special can execute shell command in... vim summary execut
current window to close the command : BDIf Vim does not add parameters, it opens multiple files directly.such as vim file1 file2 file3You can use commands to switch between files : bn, for example: B2 switch to the second file: B3 switch to a third fileSave and exit all windows:WQAExit all windows: QASummary comparison:650) this.width=650; "title=" Db.png "alt="
I have summarized 18 very useful vim commands. The most famous program editor in Linux is not vim. In normal mode, 1. dd mdash; delete the row where the cursor is located. 2./word mdash; specify the words in full text search. 3.G mdash; mdash; move the cursor to the last row of the file, and move the cursor to row 99th, that is, 99G4... I have summarized 18 v
Run the shell command in vim. The following forms are available ):! The command does not exit vim, and runs the shell command to display the command output in the vim command area. It does not change the content of the currently edited file, for example :! Ls-l special run :! Bash to start a bash shell and execute commands
Vim Common commands"," "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "H Move left oneL Move Right OneK Move up oneJ Move Down one0 cursor to the beginning of the current line$ cursor to the end of the current line^ The cursor moves to the first non-space/tab character on the current lineW cursor moves to the beginning of the next worde cursor
Learning vim is often needed, and these commands are the most commonly used commands I've had this time, and it's very efficient to improve myText editing efficiency.------------------------------------------------------------------------A1. Text Collation classA2. Format settingsA3. Editing techniquesA4. Clipboard tips (more convenient with Ditto)A5. File browsi
7th to of the file with "string2 ".---- Note: S is substitute, % indicates all rows, and G indicates global.---- 5. Edit two files at the same time, copy the text in one file and paste it into another file.---- VI file1 file2---- YY copies the row at the cursor of file 1----: N switch to file 2 (n = NEXT)---- P paste the copied row at the cursor of file 2----: N switch back to file 1---- 6. Replace the path in the file.---- Use the command ": % s #/usr/bin # G" to replace all the paths/usr/bin
cursor is locatedo Insert a new line at the next line where the cursor is locatedo Insert a new line at the cursor locationR replaces the character at the cursor one timeR always replaces the text at the cursor until ESC is pressedCommand mode shortcut keys: w [filename] Save as filename: R [FileName] reads the contents of the filename specified in the file to the line where the cursor is located.: n1,n2 w [filename] save N1 to N2 row as filename:! command to execute the
linePaste command (paste)P: lowercase p; If the contents of the buffer are full lines, paste them below the current cursor, or paste them at the back of the cursor;P: Uppercase P: The contents of the buffer if it is an entire line, paste it at the top of the line where the cursor is currently located, or paste it in front of the cursor;Copy command (Yank):Y: Copy, the working behavior is similar to the D command, can also be used in conjunction with the cursor jump command;YY: Copy a whole line
Advanced some of the editor, will contain the macro function, Vim is certainly not missing, the use of macros in Vim is very convenient:: QX starts recording macro and registers the result in register XQ Exit Record mode@x playing macro commands recorded in the X registerTo explain a little bit, when entering in normal mode: After QX, all your edits to the text w
Advanced some of the editor, will contain the macro function, Vim is certainly not missing, the use of macros in Vim is very convenient:: QX starts recording macro and registers the result in register XQ Exit Record mode@x playing macro commands recorded in the X registerTo explain a little bit, when entering in normal mode: After QX, all your edits to the text w
Tags: convenient label page input Delete Direction command Mini means give upAdvanced some of the editor, will contain the macro function, Vim is certainly not missing, the use of macros in Vim is very convenient:: QX starts recording macro and registers the result in register XQ Exit Record mode@x playing macro commands recorded in the X registerTo explain a lit
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:
[email protected]
and provide relevant evidence. A staff member will contact you within 5 working days.