How to construct VIM + GCC + GDB developing platform

最近因Cisco VPN问题重装了Win7系统,原来的Vim忘记备份了How <wbr>to <wbr>construct <wbr>VIM <wbr>+ <wbr>GCC <wbr>+ <wbr>GDB <wbr>developing <wbr>platfor

现在需要重新进行配置,这里记录一下,备查!

(1)install MinGW

download mingw-get-inst application from:

http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/mingw-get-inst-20120426/

the installation procedure is quite simple, suggest to choose:"download latest repository catalogues".

How <wbr>to <wbr>construct <wbr>VIM <wbr>+ <wbr>GCC <wbr>+ <wbr>GDB <wbr>developing <wbr>platfor
In my work, I need the mingw-gcc, mingw-g++ and also msyssystem.

The application will automatically download any necessarypackages and install them into the designated folder, in my case,D:\MinGW.

Finally, add D:\MinGW\bin to system PATH environment.

(2) install VIM

download GVim 7.3 for windows from:

http://www.vim.org/download.php#pc

I have simplely choosen all features andinstalled to D:\Vim.

For ease of Vim usage, I have modified _vimrc according tovarious guidelines from the web, such as:

*The ultimate Vim configuration: http://amix.dk/vim/vimrc.html

*http://blog.csdn.net/laruence/article/details/2603031

*http://vim.wikia.com/wiki/Setting_the_font_in_the_GUI

*http://www.cnblogs.com/alphaqiu/archive/2012/04/12/2444147.html

*http://www.aujohn.com/post-200.html

My _vimrc looks like:


"change workdirectory
set autochdir
let location="d:/projects"
execute ":cd " . location

""""""""""""""""""""""""""""""""""""""""
"=>general
""""""""""""""""""""""""""""""""""""""""
"enable filetype plugins
filetype plugin on
filetype indent on

"set to auto read when a file is changedfrom the outside
set autoread

"maximize window at start
au GUIEnter * simalt ~x

""""""""""""""""""""""""""""""""""""""""
"=>vim user interface
""""""""""""""""""""""""""""""""""""""""
"show line number
set nu

"always show current position
set ruler

"height of the command bar
set cmdheight=2

"ignore case when searching
set ignorecase

"when searching try to be smart aboutcases
set smartcase

"highlight search results
set hlsearch

"makes search act like searching in modernbrowsers
set incsearch

"show matching brackets when textindicator is over them
set showmatch

""""""""""""""""""""""""""""""""""""""""
"=>colors and fonts
""""""""""""""""""""""""""""""""""""""""
"enable syntax highlighting
syntax enable

colorscheme desert
set background=dark

"set utf8 as standard encoding
set encoding=utf-8
set fileencodings=utf-8,chinese,latin-1
if has("win32")
 set fileencoding=chinese
else
 set fileencoding=utf-8
endif

source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim

set langmenu=zh_CN.UTF-8
language message zh_CN.UTF-8

"set fonts
set guifont=Courier_New:h9:cDEFAULT

""""""""""""""""""""""""""""""""""""""""
"=>text, tab and indent related
""""""""""""""""""""""""""""""""""""""""
"be smart when using tabs
set smarttab

"1 tab == 2 spaces
set shiftwidth=2
set tabstop=2

"linebreak on 500 characters
set lbr
set tw=500

set ai "auto indent
set si "smart indent
set wrap "wrap line
(3) install ctags

download ctags package from:

http://prdownloads.sourceforge.net/ctags/ctags-5.8.tar.gz

open msys, and change directory to the ctags source folder,execute:

./configure --prefix=/mingw&& make&& make install

now ctags is ready.

also, general usage of ctags within Vim/GVim:

:!ctags -R --c-kinds=+p --fields=+S.

for C source files.

(4)install taglist

download taglist from:

http://www.vim.org/scripts/script.php?script_id=273

and follow the installation details.

(5)install doxygen and doxygen for vim

The latest doxygen for windows platform can be downloadedfrom:

http://sourceforge.net/projects/doxygen/files/rel-1.8.3/

secondly, download doxygentoolkit.vim from:

http://www.vim.org/scripts/script.php?script_id=987

and follow the install details.

Configuration and usage of doxygen toolkit for vim can be foundfrom:

http://blog.csdn.net/clarkZHUO/article/details/1471573#title4.1

 (6) install pyclewn for GDB at Win32 platform

Pyclewn can be downloaded from:

http://pyclewn.sourceforge.net/ Ihave choosen: pyclewn-1.9.py3.win32.exe

Pyclewn depends on Python 3 and the win32 python package. Python3 can be downloaded from:

http://www.python.org/download/ Ihave choosen: python-3.2.3.msi

The win32 python package can be downloaded from:

http://starship.python.net/crew/mhammond/ Ihave choosen: pywin32-217.win32-py3.2.exe

Below is a comparison between vimGdb, clewn and pyclewn.

How <wbr>to <wbr>construct <wbr>VIM <wbr>+ <wbr>GCC <wbr>+ <wbr>GDB <wbr>developing <wbr>platfor

installation follows:

1, install python3.2

2, install python3.2 win32 extension package

3, (!!!IMPORTANT!!!)add vim to thePATH system environment. In my case, D:\Vim\Vim73.

4, install pyclewn 1.9.

5, You will have a Pyclewn shortcut on your desktop.

6, You may encounter below error when executing Pyclewn for thefirst time:

class<UnicodeDecodeError>
 'utf8' codec can't decode byte 0xd3 in position0: invalid continuation byte
...  xxx ... xxx gdb.py:303

You can follow the instruction from:

http://blog.csdn.net/zagfai/article/details/6582050

OK, now you have GVim + mingw-gxx + GDB with Pyclewn ready.Enjoy^_^

猜你喜欢

转载自blog.csdn.net/jeffyko/article/details/79333407