Chinaunix首页 | 论坛 | 博客
  • 博客访问: 46497
  • 博文数量: 7
  • 博客积分: 310
  • 博客等级: 二等列兵
  • 技术积分: 75
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-29 14:10
文章分类
文章存档

2012年(1)

2009年(6)

我的朋友

分类: LINUX

2009-10-25 16:34:40

Read the source code using vim
hi all, I am a vim user.After 3 year's work under linux, I get some
experiences about how to read source code using vim.Here I am very
glad to share for it.
1. ctags plugin
ctags ­R *
generate the tags file,edit the tags file using shell,make it easily
be read
Ctrl+]  Ctrl+t
jump to and back the  function defined
2.foldermethod setting
nmap zf zf}a
“fold all
nmap fa :set foldermethod=syntax :set foldermethod=manual
set the foldermethod option in  .vimrc,make it can folder the whole
file.
3.taglist plugin
nmap tl :Tlist
4.screen
using screen,you can easily to get through the terminal you open
Ctrl+a+S  split the current terminal in two
Ctrl+a+Q close other terminals,and remain the current terminal
Ctrl+a+Tab  alternate between the terminals
5.MiniBufExplorer plugin
let mapleader=”,”
let g:mapleader=”,”
nmap b :MiniBufExplorer
 
6.grep, quickfix window
nnoremap :Grep
search char under the current directory
7.cscope,CCtree
cscope * ­Rbq
:cs add the­whole­path­of­cscope.out  the­whole­path­of­current­
directory
8.:tags :redir!>filename
:redir!>filename  remember the vim quickfix window's output
:tags under vim can get the trace you get through,and then you can
get the relationship a function is
used.
9.drawit plugin
use drawit plugin you can draw the data structures of the file,it
make you easily to understand the code.
Or the uml graph
10.:find
find the file under $path
11.write document for the code

-----
sorry about my poor english,just as too poor to use it
 
阅读(1554) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:my vimrc

给主人留下些什么吧!~~