search

Home  >  Q&A  >  body text

gvim - vim upgrade problem

To follow the youcompleteme plug-in, you need vim7.3.584 version support, and my gvim version is 7.3.547
When upgrading, I referred to this tutorial: http://www.cnblogs.com/scue/p/3234102.html

sudo apt-get install -y hgsvn libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev ruby-dev mercurial cscope exuberant-ctagssudo apt-get remove vim vim-runtime gvim #这一步可以不做
cd ~
hg clone https://code.google.com/p/vim/
cd vim
./configure --with-features=huge \
            --enable-rubyinterp \
            --enable-pythoninterp \
            --enable-perlinterp \
            --enable-gui=gtk2 --enable-cscope --prefix=/usr
make VIMRUNTIMEDIR=/usr/share/vim/vim73
sudo make install
sudo update-alternatives --install /usr/bin/editor editor /usr/bin/vim 1
sudo update-alternatives --set editor /usr/bin/vim
sudo update-alternatives --install /usr/bin/vi vi /usr/bin/vim 1
sudo update-alternatives --set vi /usr/bin/vim

But after the upgrade, the version of gvim is still 7.3.547, and the version of vim is 7.4.265
I want to use youcompleteme plugin in gvim, not in vim.


The problem has been solved by itself. Please click on the solution:



Install the needed dependencies: $ sudo apt-get install ncurses-dev build-essential mercurial Clone the sources of Vim 7.4: $ hg clone https://vim.googlecode.com/hg/ vim Build Vim from sources: $ cd vim/src $ make distclean $ ./configure --with-features=huge --enable-pythoninterp --enable-rubyinterp $ make $ sudo make install Adjust the PATH: $ export PATH=/usr/local/bin:$PATH

Now the gvim version is the same version as vim.
But it’s not very clear. Are the above commands mainly used to modify the configuration information of gvim so that vim can be called directly?

给我你的怀抱给我你的怀抱2773 days ago760

reply all(4)I'll reply

  • phpcn_u1582

    phpcn_u15822017-05-16 16:43:10

    But it’s not very clear. Are the above commands mainly used to modify the configuration information of gvim so that vim can be called directly?

    No. What you did was recompile vim. In this way, gvim and vim are of course the same version

    reply
    0
  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-16 16:43:10

    Well, I think so. The source code of vim itself has support for gui, so when you execute it

    $ ./configure --with-features=huge --enable-pythoninterp --enable-rubyinterp
    

    This command has already been compiled into vim with gui support, and then the next step

    $ export PATH=/usr/local/bin:$PATH
    

    The function of this line is just to add the default installation location (path under /usr/local) before the $PATH variable, so that the newly installed vim will be searched before the vim installed in /usr by the package management, so that you Both vim and gvim are compiled and installed from the same source code, so of course they are the same version~
    You can which vim还有which gvim take a look at where they are and what files they are, maybe this will give you a clearer idea of ​​what happened in the above operations~

    reply
    0
  • 阿神

    阿神2017-05-16 16:43:10

    In the first half, you only updated vim, not gvim. Of course, gvim is still old:

    >>> ll /usr/bin/gvim
    lrwxrwxrwx 1 root root 22 3月   1 21:39 gvim -> /etc/alternatives/gvim
    >>> ll /etc/alternatives/gvim
    lrwxrwxrwx 1 root root 16 3月   1 21:39 /etc/alternatives/gvim -> /usr/bin/vim.gtk
    

    This part is managed by the system.

    It stands to reason that the make install 之后,gvim 会链接到 vim 的,可能是你的 update-alternatives command updates it.

    In the second half, you (as normal) installed vim (and gvim link) under /usr/local. This is the user/system administrator's place. The system package manager will not interfere, so it will be installed normally. (So ​​I don’t know where you learned the messy installation method above.)

    reply
    0
  • 世界只因有你

    世界只因有你2017-05-16 16:43:10

    It should be because the path has been modified. If you use which vim to look at it, you will know the path of the vim executable file called,

    reply
    0
  • Cancelreply