Ubuntu14.04 under compile and install Vim74+vim-gdb

Source: Internet
Author: User
Tags bz2

First, the preparatory work
1. Download Vim74 and Vim-gdb for version 7.4:

(1) vim7-4.tar.bz2

(2) vimgdb-for-7.4

2. Uninstall existing VIM and related components

If you have already installed Vim through Software Center, you need to uninstall it

sudo apt-get remove vim vim-runtime gvim

You may also need to remove the following packages:

sudo apt-get remove Vim-tiny vim-common Vim-gui-common
3. Installation dependent environment

To manually compile the installation Vim74, first install the dependent libraries and header files required for compilation.

sudo apt-get build-dep vim

Then compile, if the dependency problem is not resolved, this hint may appear:

No terminal library found checking for tgetent () ... Configure:error:NOT found! You need to install a terminal library;        For example ncurses. Or Specify the name of the library with--with-tlib.

You can also manually install the following libraries to resolve dependencies, for the sake of insurance, it is best to execute.

sudo apt-get install 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

second, no need to vimgdb the VIM installation

Extract the downloaded Vim74 source package, go to the extracted files directory, compile

CD ~/downloads/vim74/./configure--with-features=huge--enable-rubyinterp--enable-pythoninterp-- with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux/--enable-perlinterp--ENABLE-GUI=GTK2-- Enable-cscope--enable-luainterp--enable-multibyte--enable-xim--prefix=/usr

Parameter description:

--with-features=huge: Supports maximum features

--enable-rubyinterp: Enable VIM to support Ruby-written plugins
--ENABLE-PYTHONINTERP: Enable vim for Python-written plug-in support
--ENABLE-LUAINTERP: Enable VIM for LUA-written plug-in support
--enable-perlinterp: Enable VIM to support Perl-written plugins
--enable-multibyte and--enable-xim: You need to enter Chinese in vim to turn on these two features
--enable-cscope:vim Support for Cscope
--ENABLE-GUI=GTK2:GTK2 support, you can also use GNOME to represent the build Gvim
--with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu/Specifies the python path, which is the path of the Python2 on the ubuntu64 bit. The 32-bit should be/usr/lib/python2.7/config-i386-linux-gnu/

--PREFIX=/USR: Set the compilation installation path and notice if you have permission to access it.

If the Configure error occurs, first use make Distclean to clear the Configure generated files before configure.

Finally make a and then install, because the set path/usr Normal user does not have write permission, so need to install with sudo.

You can not specify Vimruntimedir, as long as you execute make.

Make Vimruntimedir=/usr/share/vim/vim74
sudo make install

If you want to uninstall, the suo make uninstall below is good.

To check if the installation is successful, you can run vim--version to see if certain features are turned on. The indication attribute with a plus sign is turned on.

third, vim installation with Vimgdb 1. Install Vim

Unzip the Vim74 source package and Vimgdb's patch pack to ome downloads

: ~/downloads$ ls vim74 vim-7.4.tar.bz2 vimgdb-for-vim7.4-master vimgdb-for-vim7.4-master.zip

Then switch to the current directory and hit the patch

Patch-p0 < Vimgdb-for-vim7.4-master/vim74.patch

Next cut into the Vim74/src,make installation.

CD VIM74/SRC make sudo make install

The default current directory under the Makefile setting features and so on can meet the general requirements, if you need to add a path or make some changes, as long as the file to edit it. I have changed the path inside, because the default/opt/bin this path is not in my $path, and the default is to put Vim bin file here, causing the implementation of VIM will not find the command. If you do not make changes, you can add this path to the $path inside the good.

Open it, search/opt, according to the note, the Bindir, MANDIR, datadir the three lines can be commented out. These three lines after the change are as follows:

# Uncomment the next line to install Vim in "/usr/bin"
#BINDIR =/opt/bin
# Uncomment the next line to install Vim manuals in "/usr/share/man/man1"
#MANDIR =/opt/share/man
# Uncomment the next line to install Vim and files in "/usr/share/vim"
#DATADIR =/opt/share

Then make installs. I am on my Ubuntu although the installation is successful, but the implementation of Vim fails, "vim:caught deadly signal ABRT" error occurs. The workaround is to add cflags= "-o2-d_fortify_source=1" to make, or:

Make cflags= "-o2-d_fortify_source=1"

Then execute the sudo make install and the VIM is finally installed under/usr/local/share/vim/vim74.

If you want to set some features and installation path by executing configure, then remember to add--enable-gdb, and it is executed under VIM74/SRC directory, not vimgdb directly in Vim74 directory configure

./configure--with-features=huge--enable-rubyinterp--enable-pythoninterp--with-python-config-dir=/usr/lib/ python2.7/config-x86_64-linux/--enable-perlinterp--enable-gui=gtk2--enable-cscope--enable-luainterp-- Enable-multibyte--enable-xim--enable-gdb--prefix=/usr

Check again the makefile inside the Bindir, MANDIR, DataDir, ensure that they are three lines of comments. Then make, add Vimruntimedir, and install:

Make Vimruntimedir=/usr/share/vim/vim74 cflags= '-o2-d_fortify_source=1 ' sudo make install

The last installed Vim directory is under/usr/share/vim/vim74.
Run Vim--version Check if there is a plus sign before the following GDB feature, and if so, it means that the VIMGDB installation was successful.

2, installation VIMGDB operating environment

Copy the files under Vimgdb-for-vim7.4-master/vimgdb_runtime to the runtime path. Can be executed in vim: set Runtimepath? to find Runtimepath. View the installation path by executing the echo $VIMRUNTIME. You can see that there are several paths, ~/.vim is the current user,/usr/share/vim/vim74 is all users (this is after the installation path is set, the default path should be in/usr/share/vim/vim74).

Then switch to just select the VIM runtime path, open Vim, execute ": Helptags." (Note that there is no quotation mark, there is a space and a dot behind the Helptags, which indicates the current directory.) ), so you can use ": Help Vimgdb" To open the VIMGDB documentation.

Iv. Reference Documentation

1. Building Vim from source

2, Vimgdb-for-vim7-4

3. Vi/vim Use advanced: Use GDB debugging in Vim – use Vimgdb

4, add vimgdb cause vim successful installation but can not run the solution

5, Vim crashes on startup when compiled With-o3 but works With-o2


Ubuntu14.04 under compile and install Vim74+vim-gdb

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.