Vim configuration, vim configuration file

Source: Internet
Author: User

Vim configuration, vim configuration file

1. background description:

The vim editor is a popular and powerful text editor in linux. Configuring vim can greatly improve code development efficiency.

2. configuration scheme:

I searched on github for how others configured vim. Here you can select a configuration solution suitable for you. Here I select more configuration schemes of Star: vimrc

  

3. How to install:

Refer to the above link for detailed installation instructions (due to network reasons, it may be slow to download and install, just wait patiently)

3. Problems:

My current system: Linux version 4.4.0-21-generic (buildd @ lgw01-21) (gcc version 5.3.1 20160413 (Ubuntu 5.3.1-14ubuntu2) # 37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016

After the installation is completed according to the instructions of the author, some plug-ins may not run properly due to system or software version reasons during use.

For example, I encountered the following problems during usage:

Vim open a python file named filename. py. vim will prompt the following error:

  

Based on the error prompt, we open the file where the error prompt is located:

  

We can understand that the pyflakes. vim plug-in requires vim support for python. For this prompt, we will check the current vim support for python.

Execute this command: vim -- version | grep python

  

We can know that-python and + python3 indicate that currently vim supports python3 and does not support python2, but pyflakes. vim does not support python3.

In this case, you should install python2 so that vim can support python2.

4. Install software

Here we can get the corresponding version of the software: vim-nox-py2

Taking nox as an example: sudo apt-get install vim-nox-py2

Wait for the installation to complete and output the command to switch between python and python3 through vim: sudo update-alternatives -- config vim

For example:

  

Number 0 corresponds to the default support for vim python3 here we choose the vim-nox-py2 we just installed is number 3

In this case, enter vim -- version | grep python again to check whether the versions supported by vim for python have been switched over.

  

Now we have switched over the python version supported by vim.

Pyflakes. vim this plug-in can also be used normally

  

  

 

   

  

 

  

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.