How to build your vim

Source: Internet
Author: User
Tags file system git clone linux

Many of the things in a Linux system are in the form of scripting code, configuration files, and you need to edit them frequently when using Linux systems. Obviously, if there is no text editor, the road to the river is impossible.

My choice is vim. Vim is the most famous text/code Editor on Linux, as well as the enhanced version of the VI editor in the early years, which is praised as the most outstanding classical artifact in the text/code Editor. The reason why it is such a good reputation, I think there are mainly the following reasons: 1. It is ancient and mysterious, steep learning curve, difficult to control, but once learned to benefit. It is now regarded as a master, geek-specific editor. So although Vim is already an antique-grade software, there are countless new people to learn to use. 2. Lightweight, needless to say, when you simply edit a text file (such as script code, configuration file), the tools you use are, of course, the lighter the better. Vim is also a powerful tool for reading text files. 3. The classic ingenious editing method and powerful function. Its full use of keyboard operations, users must remember a bunch of shortcuts, key combinations and various commands to start using, once the use of skilled editing efficiency far beyond the rest of the editor, and has a variety of plug-ins, syntax highlighting, code completion, color schemes, such as extremely rich resources and flexible configuration;

I use vim:1 mainly in the following situations. Used to modify the server system's configuration file; many times, Linux as a server will not open the graphical interface, when the need for remote operation, can only use SSH "command character" Shell interface to operate it, in this case, VIM is naturally preferred. 2. Script for reading kernel source code and system; 3. To write a simple program, generally is a single file of the program, or multiple files but only a few files of the project, such as learning a programming language when doing exercises, like to see the folder clean, do not like a lot of similar. project files; 4. Install B, colorful full text of the character interface, Cool.

Not suitable for vim use scene: 1. Large programming projects, large projects or the best use of the IDE, if you want to remotely connect to a server without a graphical interface to write large projects, it is best to set up a code warehouse on the server; Reason: Vim does not have a good project management function, vim automatic complement is only based on text matching, There is no semantic analysis function of program language. 2. Content input requirements are not high, but often need to set the display format, and each action itself there are many pauses of work, with other GUI editor (such as LibreOffice Writer) more efficient than vim.

Some people say, Vim is "into also plug-ins, failure also plug-ins." Vim's flexible configuration and rich plug-ins greatly enhance its functionality, but it also greatly increases the difficulty of managing vim. First, before you use VIM, you must be properly configured, and Vim is extremely cumbersome to configure. So there are a lot of online such as "Universal Configuration", "the strongest configuration" of the article, these can be referred to. However, some of these articles have many errors, even before and after the content of duplication, conflict, and these articles are "to teach people to fish, not to teach people to fishing", they give the configuration can be copied, but often make people unclear so. Vim is rich in plug-ins, there are many plug-ins on the internet to configure vim into a powerful IDE article, but the vim of the plug-in management is very difficult, because each install a plug-in, you need to put the plug-in files to the Vim installation path under the plugin, autoload, syntax, Doc and other directories. Fortunately, Vundle turned out, it not only solves the Vim plug-in in the file system of the problem of decentralization, while being able to automatically search and download Plug-ins.

Installing and configuring VIM

You need to install vim before using it, but in Ubuntu this is not a matter, a sudo aptitude install command can be done. Because Vundle search and download plug-ins require git, you need to install VIM, gvim, and Git as follows:

sudo aptitude install vim
sudo aptitude install gvim
sudo aptitude install git

Then, create a. Vim directory in the user's home directory, set up the bundle directory in the. Vim directory, and then save the Vundle automatically downloaded plugins here. Then, go to the Bundle directory and download vundle using the git clone command.

Now let's show my profile (the. vimrc file in the home directory). My configuration is different from the online spread of the "universal Configuration", "the strongest configuration." My configuration is "The simplest configuration" that can achieve the effect I want. The following figure is line 1th to 17th, where Vundle is configured and Vundle is used to manage plug-ins. In some configurations on the web, it is not correct to put vundle configuration at the end of the configuration file. The Vundle configuration must be placed at the front. (If not vundle, use the pathogen plug-in also to put the configuration to the front.) This is because, only after the Vundle plug-in run, VIM will go to the ~/.vim/bundle directory to load other plug-ins, if the Vundle did not first run, vim of course can not find the plugin downloaded.

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.