When editing with vim, it is often difficult to edit multiple files or to edit a file by referring to other files. Here are two methods:
1. Multiple tags
Enter:
Name of the vim-P file to be edited
For example, VIM-p * is used to edit all files
I have always wanted to learn the god-like editor vim, but I have never had the courage to install, uninstall, and install it, just like I used Firefox. I have installed and installed it for no less than 10 times, later, I decided to use Firefox
Vim has been using the configuration file for more than three years and has been tossing for a while. Recently, I found that an ivim configuration file is not bad. The specific installation method is as follows:
First install exuberant catgs:
Sudo
Vim-visualized operations
Vim supports the following visual operations:
V → single character selection.V → select a row at a time. → block selection. It is very powerful to work with keys a and I.GV → after exiting the visualization mode, you
Vim can be applied to some popularProgramming LanguageBut is not enabled by default.
In command mode, we can use the following command to start the PHP Automatic completion function:: Set omnifunc = phpcomplete
#
Completephp
When writing some
Add the following content to vimrc and then press: PrettyxmlYou can automatically format the XML. However, xmllint must be in your path variable. If you do not have one, please install the libxml2 package.
Function! Doprettyxml ()"Save The
[Translation]
"Finding empty linesSearch for empty rows
/^/N/{3}: Find 3 empty lines
Search 3Empty row
[Annotation]
: Help // n
This regular expression matches three consecutive empty rows, that is, there are three consecutive linefeeds at the
[Translation]
"Search for declaration of subroutine/function under cursor
"Find the subroutine under the cursor/Function Declaration
: Nmap gx yiw/^/ (sub/ function/)/S/+ "
[Annotation]
: Help: NMAP
: Help IW
: Help
Most of the content in
The CTAG plug-in is mainly used to jump between variables and function definitions like in VC, so it is very convenient.
Download and install: http://down1.chinaunix.net/distfiles/ctags-5.2.3.tar.gz
Tar-xzvf ctags. xxxxxx
./Configure -- prefix =
Vim, as one of the best text editors, uses Vim to compile documents and write code. Every time you learn a new feature of VIM, it will greatly improve productivity. Some people have been using Vim for decades and have not fully mastered the
Method 1:1. Backup vimdir/syntax/C. Vim
2. Download C. Vim
And replace the existing vimdir/syntax/C. Vim
Method 2:1. Backup vimdir/syntax/C. Vim2. Open the vimdir/syntax/C. Vim file and search for the following locations:Code:"A bunch of useful
Vim compilation command
./Configure -- enable-multibyte -- enable-CSTE
-- Enable-multibyte (Vim can be configured in multiple languages)
-- Enable-csinsight (instead of sourceinsight, sourceinsight is a very powerful code reading tool)
Vim Help
1Install vim
Ubuntu has only pre-installed VI (Vim-tiny), but has not installed Vim. It can only be installed manually. Vim & gvim
Sudo apt-get install vim-gnome
2, Configuration file locationIn the Directory/Etc/Vim/Below, there isVimrcFile,
Ten required Vim Plugin
Http://www.openfoundry.org/en/tech-article/2244
The configuration of vimrc is as follows (for the sake of simplicity, you can directly describe it using annotations ):
If (has ("win32") | has ("win95") | has ("win64") |
Vim copy and paste
Vim, as one of the best text editors, uses Vim to compile documents and write code. Every time you learn a new feature of VIM, it will greatly improve productivity. Some people have been using Vim for decades and have not fully
2011-11-17
Vim basic configurationset nocompatible set columns=80 set tabstop=4 set ruler set expandtab set number set ignorecase set wrapmargin=15 set cindent set shiftwidth=4 syntax onCode coloring and display of line numbers:
The vim tab key
: S/vivian/sky/Replace the first vivian in the current row with sky: S/vivian/sky/g replace all vivian in the current row with sky: N, $ s/vivian/sky/Replace the first vivian from row n to row n as sky: N, $ s/vivian/sky/g replace all vivian values
Document directory
Select The Right Mode)
You can download the original Vim Recipes text from runpaint.
Select The Right Mode)
Problem
Although you know that Vim has multiple operation modes, you are not sure when to use them.
Solution
There
Previous Article http://www.cnblogs.com/amaoxiaozhu/archive/2012/03/23/2414007.html
This article is very helpful:
Http://blog.csdn.net/wooin/article/details/1858917
Zero, Code Completion
Extremely powerful functions, in editing mode
Ctrl + p or
Some advanced editors will contain macro functions, which are certainly not missing in vim. It is very convenient to use Macros in vim:
: Qx starts to record macros and saves the results to register xQ exit record mode@ X macro commands for playing
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.