Chinaunix首页 | 论坛 | 博客
  • 博客访问: 101015333
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类: LINUX

2008-03-21 21:46:21

来源:赛迪网    作者:korn

其实这套组合很实用了 基本上到了不用鼠标的source insight境界了,最重要的是可以在text模式下运行

使用的平台是Fedora 8

Vim和Ctags在F8安装完后系统已经具备

Taglist需要自己下载

1.下载一个Taglist的zip文件,然后解压缩,将taglist.vim复制到~/.vim/plugin目录下。

2.修改~/.vim/plugin/taglist.vim

在 if !exists('loaded_taglist')上面加入

let Tlist_Ctags_Cmd="/usr/bin/ctags"

结果为:

" Line continuation used here
let s:cpo_save = &cpo
set cpo&vim

let Tlist_Ctags_Cmd="/usr/bin/ctags"

if !exists('loaded_taglist')
" First time loading the taglist plugin
"
" To speed up the loading of Vim, the taglist plugin uses autoload
" mechanism to load the taglist functions.
" Only define the configuration variables, user commands and some
" auto-commands and finish sourcing the file

" The taglist plugin requires the built-in Vim system() function. If this
" function is not available, then don't load the plugin.
if !exists('*system')
echomsg 'Taglist: Vim system() built-in function is not available. ' .
\ 'Plugin is not loaded.'
let loaded_taglist = 'no'
let &cpo = s:cpo_save
finish
endif

此时Ctags和Taglist已经结合起来。

3.在相应的源码目录运行ctags -R产生相应的tags文件

4.将tags文件在vim运行时导入。可以修改~/.vimrc,以后每次启动vim将自动导入此tags文件

:set tags=/root/develop/honeyids/tags

并设置语法高亮

syntax enable

syntax on

5.运行vim, 激活Taglist时用:TaglistToggle命令。在左边的tags区域和正常编辑区域切换时用ctrl+2个w。

6.使用ctags时, ctrl+]可查看函数的定义。 ctrl+o返回源文件。

阅读(173) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~