使用vim+cscope組合,搭建編程環境

來源:互聯網
上載者:User

 1. Download the latest vim version and build it as follows steps:

./configure --prefix=/home/tools                   //安裝目錄
--enable-perlinterp                                //perl整合
--enable-pythoninterp                              //python整合
--enable-cscope                                    //csope支援
--enable-multibyte                                 //雙位元組支援,一次可以跳過一個漢字
--enable-fontset                                         
--with-features=huge                               //最大特性

make
make install

2. taglist support
download taglist plugin (taglist_45.zip)
refer to:

http://easwy.com/blog/archives/advanced-vim-skills-taglist-plugin/

http://blog.chinaunix.net/u/15620/showart_174219.html

3. cscope support
download cscope-15.7.tar.bz2
./configure && make && make install

refer to:

http://lab.gracecode.com/manual/cscope_vim_tutorial_zh.html

http://cscope.sourceforge.net/large_projects.html

http://easwy.com/blog/archives/advanced-vim-skills-cscope/

4. cscope.files generation for linux kernel

#! /bin/sh
LNX=$PWD
cd /     
find  $LNX                                                                /
    -path "$LNX/arch/*" ! -path "$LNX/arch/arm*" -prune -o               /
    -path "$LNX/include/asm-*" ! -path "$LNX/include/asm-arm*" -prune -o /
    -path "$LNX/tmp*" -prune -o
/
    -path "$LNX/Documentation*" -prune -o
/
    -path "$LNX/scripts*" -prune -o
/
    -path "$LNX/drivers*" -prune -o
/
        -name "*.[chxsS]" -print > $LNX/cscope.files

Now, I don't use above shell script, just use following commands:
KBUILD_SRC=$PWD make cscope ARCH=arm

Linux kernel supports to build cscope files.

5. set CSCOPE_DB variable
modify ~/.bashrc:
CSCOPE_DB=/home/lanttor/Git/linux-2.6/cscope.out
export CSCOPE_DB
This step can be done manually ( I do: export CSCOPE_DB=xxx in the console for flexibility)

6. download cscope_maps.vim from

http://lab.gracecode.com/manual/cscope_vim_tutorial_zh.html

copy it to ~/.vim/plugin/ directory

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.