Those things about vim.

Source: Internet
Author: User
Tags wubi

If you are looking for the ability to configure the Vim plug-in, then please look down and read it.

With VIM has been three years, has never been a serious configuration, has been using a can use the configuration, highlighting, line number these. Always used because it can be basically out of the mouse, and the input speed is fast. Just like I used to use Wubi (although now Wubi has fallen behind pinyin). I've been learning python for a while, and when I was writing C programs, I could have a full-complement function with CTRL + P. But now Python does not have this function, I would like to add, so in the Internet to find a bit, found that someone said with Vundle to manage the plug-in, I then probably looked at it, it seems quite complicated, gave up. Just these days, Mac problem, re-installed system, I would like to try to configure a bit, to see the hard not laborious, so, found, really very simple.

The front said so much, mainly to give me have the same idea of people, bold to try, are not troublesome. The following records my use of the process.


First: Find Vundle on GitHub

Address: Https://github.com/VundleVim/Vundle.vim

Open, directly will display the contents of the Readme.md file, although it is English, but very clear. Recommended to enter this address, take a closer look, if you do not understand, I will be here to introduce the details of what it means.

1. Introduction:

installation requiresGitand triggersgit cloneFor each configured repository to~/.vim/bundle/by Default. Curl is required for search.

2.set up  vundle:

$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/vundle.vim

The meaning of this is to download the Vundle plugin from git to the Vundle.vim directory, where you do not have to create the Vundle.vim directory, directly in the terminal to execute the above command.

3.Configure Plugins:

Put this at the top of your .vimrc To use vundle. Remove plugins you don ' t need, they is for illustration purposes.

This means that we now have the Vundle plugin, so we have to configure it in the. vimrc file to enable it. this. vimrc file should know where it is? is in the ~ directory, for my Mac is/users/xx,linux system is generally/home/xx, here xx is my user name. You need to look at it according to your user name. But in fact, not so troublesome, in the system Wave Line ~ is representative of this directory, such as: cd ~, so we are into this directory, also can: CD $HOME, this is also into this directory. Or, if you do not have access to root, direct CD, without adding anything else to this directory. Well, it's a bit verbose. If you do not have a. VIMRC in this directory, then create it and fill it out according to the contents of the readme.md. Remember, these things must be written in the front of the. vimrc.

"The following three must be added, as is written on set nocompatible" be improved, requiredfiletype off "Requiredset rtp+=~/ . Vim/bundle/vundle.vim "The Last Call Vundle#end () in the following sentence is a match, which is equivalent to the beginning of a representative, the end of a delegate," These two sentences, the middle is put on the plug-in we want to install. " Call Vundle#begin () "Is here to write the information you want to install the plug-in, the content in the README.MD is deleted, it is just for example," not we really want to install those, and its example content is, tell us there are many ways to install plug-ins, On GitHub, "You can download it locally, we only use GitHub to install plugins here." Since I am going to install Python plugin, this plugin "at GitHub address is:, then how do we set it up" using plugin ' rkulla/pydiction ', write this sentence on it, behind the ' rkulla/pydiction ', you can "find , which is actually the back part of the address above. Plugin ' rkulla/pydiction ' If you also want to install other plugins, then continue to add in the middle. Call Vundle#end () "The following sentence must also be added, which is specifically highlighted in the documentation. FileType plugin indent on "Here is the configuration done.

4. Install Plugins:

Launch and vim Run:PluginInstall

To install from command line:vim +PluginInstall +qall

This will start installing the plug-in you just configured, if you have not yet exited your vim or you quit Vim, then open, vim in the execution

:P Lugininstall, that is, vim at the bottom of the command line, first colon, then input plugininstall, enter will enter the download interface, this time, you do not operate, it will itself in the download, download after the completion of the changes, and the following will show done, it is easy to identify.


Second: Configure Pydiction

Now that you have completed the plug-in function of Vundle management vim and installed a Python plugin pydiction, then you can use Python's completion function? Not really, because the use of Pydiction also requires additional configuration steps, which is described in Pydiction readme.md. But we just need to do the following step, write the following sentence to the. vimrc file, of course, to change the path content according to your own situation.

Let g:pydiction_location = '/home/user/.vim/bundle/pydiction/complete-dict '

The path behind this is written according to your actual situation, such as mine:

/users/xx/.vim/bundle/pydiction/complete-dict

That's the directory we started with. The Pydiction directory can be found in the Vim/bundle directory.

Now, use VIM to open a. py file. For example: Vim 1.py

This time we enter: Impo and then press the TAB key to see if there is a full complement of the prompt function.








Those things about vim.

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.