The code naturally without the text editor vim, automatic indentation is tab, even if you delete the tab changed to 4 spaces, the next level indent will continue to use tabs, which caused the Space and tab mix
Information that can be modified,
Using Find-and-replace methods
In Linux, the starting mark for each line of text is ^, the ending sign is $, so use vim to search for ^ and replace with ^ #即可.
: 10,20s/^/#/g
Indicates that 10-20 rows are added to the annotation, and the same
Enter edit modeLowercase i in the current word match either insertUppercase I inserts at the beginning of the line where the cursor is locatedUppercase O Inserts an edit line above the cursorLowercase o Inserts an edit line below the cursorLowercase
Enter edit modeEdit mode, which is the mode that we can modify the document, configureI insert in the current word match eitherI (uppercase) is inserted at the beginning of the line where the cursor isA inserts after the current characterA
The use of the VI editor/vim editor for the Kali Linux system differs from CentOS in many ways. The basic use method is as follows1, VI of the basic conceptBasically, vi can be divided into three states, namely command mode, insert mode (and bottom
The three modes of VIM in Linux are: command mode , last line mode , and edit mode . here is a diagram of the three:Switch between the three modes:The command mode is the default mode in Vim.Command mode switch to last line mode : Use colon (:) in
Vim brace matching is highlighted in the vim7.4 version, which is turned on by default. But the default parentheses matchThe highlight color is light blue, in the light of the blind at the same time, seriously affect our writing code, the most
You can undo one operation by pressing u in VIU undo the last step operationCtrl+r Redo the previous undo operationVim is the most famous text/code Editor on Linux, and the GVim of the Vi editor of the early years, while the Windows edition of the
Use the Vim editor in Ubuntu in edit mode to use the next key will become the letter ABCD, using the HJKL key will become up and down around.This is because Ubuntu is preinstalled with the vim tiny version and requires a vim full version. Execute
va{Select {} intermediate content, including {}va[SELECT [] intermediate content, including {}VA (check () middle content, including {}vi intermediate content, including <>Change the above a to I, not including the corresponding brackets;VI "SELECT"
Vim Paste Code problemvim
When using Xshell for VIM operation, often directly paste some external code, and then paste on the following will appear progressive indentation of the situation, has not been to find out why, and line to get him
1. Setting items that affect Chinese encoding
Encoding (ENC): encoding is the internal use of Vim code, encoding settings will affect the internal vim buffer, message text and so on. In a UNIX environment, the default setting for encoding
Use Vim when there is Chinese garbled, the problem is on Vim, for CentOS should modify the/ETC/VIMRC file, add the following four lines of code on the header of the file:
Set fileencodings=utf-8,gb2312,gbk,gb18030
Set termencoding=utf-8
Why do I need to compile and install vim?Because I want to install YCM,YCM requires a vim version of 8.0Tutorial steps:1, check the system version2. Remove the vim that comes with the system3, compile and install vim4, test the installation of VIM1,
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 "
Because of my personal preference, I like to set the background color to dark when I use VIM.But each time you open a vim to reset it, it feels very troublesome.Always enter [ESC]: Set Bg=dark is inconvenientThe rough way is to go directly to
1) Cursor commandK,j,h,l---up and down around the cursor Movement command, although you can use the keyboard to the right of the four cursor keys, but remember that these four commands are also very useful, that is, the right hand on the keyboard
Ancient artifact, presumably we will associate to the XX TV drama, the ancient artifact is not Donghuang clock, shaft sword, Pangu, refining demon pot, Hao Tian Tower, Fuxi Qin, Shennong Ding, Kong Tong Printing, Kunlun Mirror, nu wa stone. It is
Excerpt from: http://www.apelearn.com/bbs/thread-7146-1-1.htmlThe differences between ": X" and ": Wq" are as follows:(1): Wq Mandatory Write file and exit (save and exit write and quite). Force write even if the file is not modified, and update the
The vi Editor full name is Visual Interface, which is a visual interface, like Notepad in Windows, Vim is equivalent to an upgraded version of VI, which contains all the operations commands of VI, and what vim does with respect to VI:1, VIM support
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service