Linux ,c/c++, web,前端,php,js
分类:
2011-07-22 22:27:08
[root@localhost ctags-5.6]# ./configure
[root@localhost ctags-5.6]# make
[root@localhost ctags-5.6]# ./mkinstalldirs
[root@localhost ctags-5.6]# make install
cp ctags /usr/local/bin/ctags && chmod 755 /usr/local/bin/ctags
cp ./ctags.1 /usr/local/man/man1/ctags.1 && chmod 644 /usr/local/man/man1/ctags.1
[root@localhost ctags-5.6]# ctags
ctags: No files specified. Try "ctags --help".
taglist的安装:
[root@localhost ctags-5.6]# cd ~
[root@localhost ~]# pwd
/root
[root@localhost ~]# mkdir -p .vim/plugin
[root@localhost ~]# cd .vim
[root@localhost .vim]# ll ../taglist_4.2.zip
-rw-r--r-- 1 root root 48384 8月 7 09:20 ../taglist_4.2.zip
[root@localhost .vim]# unzip ../taglist_4.2.zip
Archive: ../taglist_4.2.zip
inflating: plugin/taglist.vim
inflating: doc/taglist.txt
[root@localhost .vim]# ls
doc plugin
[root@localhost .vim]# vim
1 ~ VIM - Vi IMproved
~
~ 版本 7.3.29
~ 维护人 Bram Moolenaar 等
~ 修改者
~ Vim 是可自由分发的开放源代码软件
~
~ 赞助 Vim 的开发!
~ 输入 :help sponsor
~
~ 输入 :q
~ 输入 :help
~ 输入 :help version7
~
:helptags~/.vim/doc,然后回车
1
~
~ VIM - Vi IMproved
~
~ 版本 7.3.29
~ 维护人 Bram Moolenaar 等
~ 修改者
~ Vim 是可自由分发的开放源代码软件
~
~ 帮助乌干达的可怜儿童!
~ 输入 :help iccf
~
~ 输入 :q
~ 输入 :help
~ 输入 :help version7
~
:Tlist
" Press
|~
~ |~
~ |~
~ |~
~ |~
~ |~
~ |~
~ |~
~ |~
~ |~
~ |~
~ |~
~ |~
~ |~
~ |~
~ |~
~ |~
~ |~
~ |~
~ |~
~ |~
__Tag_List__ 1,1 全部 [未命名]
0,0-1 全部
说明Taglist安装成功了
下面修改一个文件,使Ctags和Taglist联系起来:
[root@localhost .vim]# vim ~/.vim/plugin/taglist.vim
在:63 if !exists('loaded_taglist') 上面一行加上一句,如下:
63 let Tlist_Ctags_cmd="/usr/local/bin/ctags"
64 if !exists('loaded_taglist')
65 " First time loading the taglist plugin
66 "
[root@localhost .vim]# cd /home/ruanjian/vim_Taglisht_Ctags/
[root@localhost vim_Taglisht_Ctags]# ls
ctags-5.6 ctags-5.6.tar.gz taglist_4.2.zip zebra-0.95a.tar.gz
[root@localhost vim_Taglisht_Ctags]# tar zxvf zebra-0.95a.tar.gz
[root@localhost vim_Taglisht_Ctags]# cd zebra-0.95a
[root@localhost zebra-0.95a]# ls
aclocal.m4 configure INSTALL NEWS SERVICES
AUTHORS configure.ac install-sh ospf6d TODO
bgpd COPYING lib ospfd tools
ChangeLog COPYING.LIB Makefile.am README update-autotools
config.guess depcomp Makefile.in REPORTING-BUGS vtysh
config.h.in doc missing ripd zebra
config.sub init mkinstalldirs ripngd
[root@localhost zebra-0.95a]# ctags -R
[root@localhost zebra-0.95a]# ls -l tags
-rw-r--r-- 1 root root 728313 8月 7 09:42 tags
[root@localhost zebra-0.95a]# vim bgpd/bgp_main.c
1 /* Main routine of bgpd.
2 Copyright (C) 1996, 97, 98, 1999 Kunihiro Ishiguro
3
4 This file is part of GNU Zebra.
5
6 GNU Zebra is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
9 later version.
10
11 GNU Zebra is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU Zebra; see the file COPYING. If not, write to the Free
18 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19 02111-1307, USA. */
20
21 #include
22
23 #include "vector.h"
:TlistToggle
" Press
| 2 Copyright (C) 1996, 97, 98, 1999 Kunihiro
- bgp_main.c (/home/ruanjian/| Ishiguro
|- variable | 3
|| longopts | 4 This file is part of GNU Zebra.
|| config_current | 5
|| config_default | 6 GNU Zebra is free software; you can redistrib
|| retain_mode | ute it and/or modify it
|| master | 7 under the terms of the GNU General Public Lic
|| config_file | ense as published by the
|| pid_file | 8 Free Software Foundation; either version 2, o
|| vty_port | r (at your option) any
|| vty_addr | 9 later version.
| | 10
|- function | 11 GNU Zebra is distributed in the hope that it
|| usage | will be useful, but
|| sighup | 12 WITHOUT ANY WARRANTY; without even the implie
|| sigint | d warranty of
|| sigusr1 | 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR P
|| signal_set | URPOSE. See the GNU
|| signal_init | 14 General Public License for more details.
|| main | 15
__Tag_List__ 3,1 顶端 bgpd/bgp_main.c 1,1 顶端
左面是函数列表,右边是源文件(这个时候就可以使用h,j,k,l来移动并加上回车就行了)
然后可以按下ctrl+w切换了
按下crtl+]可以查看函数的定义,按下ctrl+o可以调回原文件
就介绍这么多吧。。。