Add the following to. vimrc:CodeAfter that, restart Vim to generate four spaces by pressing tab:Set Ts = 4 (Note: ts is the abbreviation of tabstop, with four spaces in the tab width)Set expandtab
For saved files, use the following method to
At the beginning, after Ubuntu is installed, garbled characters will be displayed after you exit with vim. This is because Vim of Ubuntu is linked to/usr/bin/gnome by default, this is different from the usual vim, so if we need to use the usual vim
Are you tired of setting the line number, indentation, and highlighting every time you open Vim. Have you ever thought about creating your own Vim so that every time you open your vim, it can be the configuration you want? It is actually very simple,
I was also looking for a quick way to select all, but many of them are repeated and incorrect on the Internet, such:1, $ y, what is this? To write, you must also write: 1, $ y, but I tell you, write: 1, $ Y is all copied, not all selectedDG. This is
Due to years of Linux Operating habits, Vim's quick editing is strongly dependent. If you writeCodeI personally think this is a very inefficient method. Later, I went to the Windows environment for development. We have been using vs. Of course, VS
Source: http://www.2cto.com/ OS /201110/107286.html
Some students prefer to use spaces for indentation. Therefore, manyCodeThe row capital contains consecutive and repeated spaces, some of which are four or even eight. Uncle can't bear it.
How to save the unnamed Vim in Linux
On the command terminal, enter the vim command to open the vim file. After editing the file, the system will remind E32: No file name to save the file. How to save the unnamed Vim? The following describes how:
1) insert function (that is, insert one or several characters in a column of several rows)Step 1: move the cursor to the specified position of the row to be inserted.Step 2: press Ctrl + V to enter the visual block mode.Step 3: move the cursor to
1. Enter the vim installation directory, which is generally/Usr/share/Vim/vim70/, Or something like/usr/share/Vim ??/;
2. If. Vimrc. VimFile, find the following content in the file:
If has ("VMS ")
Set
Nobackup "do not keep a backup file,
I saw a short article about recursive macros on dailyvim.blogspot.com.
I have never realized that Vim macros support recursion. What is the role of recursive Macros? The easiest thing to think of is that you can execute macros throughout the entire
% Jump to matching brackets
[[Jump to the beginning of the code block (but the '{' in the code block must be a separate line)
] Jump to the end of the Code
GD jump to the definition of a local variable
''Jump to the position where the cursor was
1. Configuration File LocationUnder the/etc/directory, there is a file named vimrc, which is a public Vim configuration file in the system and is valid for all users. In each user's home directory, you can create a private configuration file named ".
Reprinted please indicate this blog from "LIU Da csdn blog": http://blog.csdn.net/poechant
1. Delete)
DdDelete the row where the cursor is located
NDDDelete n rows from the row where the cursor is located and down
D1gDelete all rows from the row
Configuration Overview:
1. automatic matching of brackets [all types of brackets and quotation marks are supported]
2. One-click addition of syntax template, author, time, and other information
3. One-click compilation and running of a single source
Multiple tagsOpen the file in the form of multiple tags before entering vim-P . For example, VIM-p * is used to edit all files in the current directory. In Vim editing, tabnew adds a label: tabc to close the current tab: Tabo to close all other tabs:
1. Configuration File LocationUnder the/etc/directory, there is
VimrcFile, which is a public Vim configuration file in the system and is valid for all users. In each user's home directory, you can create a private configuration file named"
. Vimrc".
1. Exit the current form: Q
2. Exit VIM: QA!
3. Jump to the tag, move the cursor to the tag, and press Ctrl +]
4. Set the left mouse button and double-click the tag to jump: Set mouse = a note that there are spaces on both sides of the equal
My Vim configuration (with annotations) is relatively simple and practical, and will be updated continuously in the future based on the function addition.
If you need to copy the following content to the. vimrc file in the user's home directory,
Vim's learning curve is quite large (see the learning curve of various text editors). Therefore, if you see a lot of VIM command classification at the beginning, you will lose interest in this editor. The following article is translated from "Learn
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