I have been editing and debugging programs using vim recently. I can see someone calling gdb directly in vim on the Internet. So google found a way to patch vim, so we need to install vim in the source code. The first article found was vim7.2, but vim cannot be started after installation, and a memory error is reported. Later, vim7.3 and the vimgdb-for-vim7.3 were used to successfully make vim call gdb directly. The installation steps are as follows: Download vim-7.3 and vimgdb-for-vi
I have been editing and debugging programs using vim recently. I can see someone calling gdb directly in vim on the Internet. So google found a way to patch vim, so we need to install vim in the source code. The first article found was vim7.2, but vim cannot be started after installation, and a memory error is reported. Later, vim7.3 and the vimgdb-for-vim7.3 were used to successfully make vim call gdb directly.
The installation steps are as follows:
- Download the vim-7.3 and vimgdb-for-vim7.3 source package.
Vim-7.3.tar.bz2Http://www.vim.org/sources.php
Vimgdb-for-vim7.3 (this patch) https://github.com/larrupingpig/vimgdb-for-vim7.3
- Decompress the source code package and install patches.
Tar xjvf vim-7.3.tar.bz2-C/tmp
Tar xzvf vimgdb-for-vim7.3.tar.gz-C/tmp
Cd/tmp
Patch-p0 <larrupingpig-vimgdb-for-vim7.3-bd07a6c/vim73.patch
Cd vim73/src
Make
Sudo make install
Note: The last few letters of the larrupingpig-vimgdb-for-vim7.3-bd07a6c name may be different here
- Download and install libreadline-dev, libncurses5-dev, lua5.1.4
The main purpose of this step is to solve the "lua. h: No such file or directory" error.
First install libreadline-dev and libncurses5-dev, in Ubuntu, directly apt-get can sudo apt-get install libreadline-devsudo apt-get install libncurses
I installed lua in the source code, but there is also lua in apt-get. Http://www.lua.org/ftp/lua-5.1.4.tar.gz:
Tar xzvf lua5.1.4.tar.gz-C/tmp Cd/tmp Make linux
- Install vimgdb Runtime Environment
Copy the runtime environment of vimgdb to the runtime environment of vim. In the vim runtime environment, enter set runtimepath in an open vim file. For example, mine is: Runtimepath = ~ /. Vim,/usr/local/share/vim/vimfiles,/usr/local/share/vim/vim73,/usr/local/share/vim/vimfiles/after ,~ /. Vim/after
Usually ~. /Vim folder
Cp-rf/tmp/vimgdb-for-vim7.3/vimgdb_runtime /*~ /. Vim
When vimgdb is running, there is a doc folder in the environment. Switch to this directory, start vim and execute the: helptags. Command. Note that there is a "." After the helptags space, indicating the current directory. If you do not perform this step, you cannot directly find the help document of vimgdb in vim. After completing this step, you can use: help vimgdb in vim to query the vimgdb help document.