`
yaojingguo
  • 浏览: 212533 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Use vim, cscope and ctags for linux 2.6 kernel source code (memo)

阅读更多

 

Install cscope

 

sudo apt-get install cscope

 

Generate cscope.files

 

LNX=/home/jing/data/road/linux/linus
cd /    
find  $LNX                                                                \
-path "$LNX/arch/*" ! -path "$LNX/arch/x86*" -prune -o               \
-path "$LNX/Documentation*" -prune -o                                 \
-path "$LNX/scripts*" -prune -o                                       \
-path "$LNX/drivers*" -prune -o                                       \
      -name "*.[chxsS]" -print >$LNX/cscope.files

 

 Generate the Cscope database

   cscope -b -q -k

 Copy the following text to .vimrc

 

if has("cscope")
  set csprg=cscope
  set csto=0
  set cst
  set nocsverb
  " add any database in current directory
  if filereadable("cscope.out")
      cs add cscope.out
  " else add database pointed to by environment
  elseif $CSCOPE_DB != ""
      cs add $CSCOPE_DB
  endif
  set csverb

  " mapping	
  nmap <C-_>s :cs find s <C-R>=expand("<cword>")<CR><CR>
	nmap <C-_>g :cs find g <C-R>=expand("<cword>")<CR><CR>
	nmap <C-_>c :cs find c <C-R>=expand("<cword>")<CR><CR>
	nmap <C-_>t :cs find t <C-R>=expand("<cword>")<CR><CR>
	nmap <C-_>e :cs find e <C-R>=expand("<cword>")<CR><CR>
	nmap <C-_>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
	nmap <C-_>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
	nmap <C-_>d :cs find d <C-R>=expand("<cword>")<CR><CR>
endif

  Script to generate tags:

 

#!/bin/bash
LNX=.
ctags -R \
  --exclude=arch/alpha \
  --exclude=arch/arm \
  --exclude=arch/avr32 \
  --exclude=arch/blackfin \
  --exclude=arch/c6x \
  --exclude=arch/cris \
  --exclude=arch/frv \
  --exclude=arch/h8300 \
  --exclude=arch/hexagon \
  --exclude=arch/ia64 \
  --exclude=arch/m32r \
  --exclude=arch/m68k \
  --exclude=arch/microblaze \
  --exclude=arch/mips \
  --exclude=arch/mn10300 \
  --exclude=arch/openrisc \
  --exclude=arch/parisc \
  --exclude=arch/powerpc \
  --exclude=arch/s390 \
  --exclude=arch/score \
  --exclude=arch/sh \
  --exclude=arch/sparc \
  --exclude=arch/tile \
  --exclude=arch/um \
  --exclude=arch/unicore32 \
  --exclude=arch/xtensa \
  --exclude=Documentation \
  --exclude=scripts \
  --exclude=drivers \
  $LNX
 
分享到:
评论

相关推荐

    linux-tools:vim73 cscope ctags .vimrc

    "linux-tools:vim73 cscope ctags .vimrc" 提到的是一组工具和配置,旨在提升使用Vim编辑器的体验。下面我们将详细探讨这些工具及其在编程工作中的应用。 **Vim73**: Vim73指的是Vim编辑器的第7.3版本。Vim(Vi ...

    vim+ctags+cscope 配置文件

    自己的vim配置文件, 内含: 1. _vimrc 2. plugin: TagList, SuperTab, OmniCppComplete, Code_Complete 3. tags for glibc, C++(stl,stream), Unix98 system, glib-2.0 4. ftplugin for Pro*C/C++

    vim+ctags+cscope一键安装(使用)

    vim+ctags+cscope一键安装(使用)

    vim+ctags+cscope

    linux下面vim+ctags+cscope的使用方法,功能非常强大 linux下面vim+ctags+cscope的使用方法,功能非常强大

    一键安装 ctags和cscope的方法

    "一键安装 ctags和cscope的方法"这个主题是关于如何利用Vim的插件系统,高效地配置Vim环境,使其功能接近于Source Insight这样的专业代码浏览和分析工具。以下将详细介绍ctags和cscope这两个工具,以及如何通过特定...

    vim经典插件cscope-15.8a-for linux

    vim的经典插件cscope,号称超频的ctags,此版本为linux版本

    windows下ctags、cscope

    代码的话需要用cscope和ctags的组合,可以达到类似sourceinsight的效果。这次上传的是cscope.exe和ctags.exe。这个是编译好的版本,在windows下直接用,非常方便。 请放在vim的目录下, 并且将这个目录设置在环境变量...

    vim plug taglist cscope

    总的来说,"vim plug ubuntu" 指的是在基于 Ubuntu 的 Linux 发行版上利用 Vim Plug 管理插件,而 "vim plug taglist cscope" 则是在这个环境中安装并使用 TagList 和 Cscope 插件,以提升代码编辑和浏览的体验。...

    VIM IDE and CSCOPE 配置

    VIM IDE和CSCOPE是两个强大的开发工具,它们结合在一起可以为程序员提供一个高效、功能丰富的代码编辑环境。VIM(Vi Improved)是一个高度可配置的文本编辑器,而CSCOPE则是一个源码浏览工具,专为C/C++等编程语言...

    linux源代码阅读工具vim+ctag+cscope

    Vim、ctags和cscope是Linux开发人员常用的代码阅读工具,它们能够帮助开发者更高效地理解和导航源代码。以下是对这些工具的详细介绍: 1. **Vim**:Vim是一款高度可配置的文本编辑器,它具有强大的文本操作能力和...

    vim + ctags + cscope + nerdtree + taglist + vundle

    "vim + ctags + cscope + nerdtree + taglist + vundle"的组合,是Vim高效开发环境的经典搭建方案,尤其适合进行大型代码库的管理和调试。 首先,`Vim` 是一个高度可配置的文本编辑器,它支持命令行模式,提供丰富...

    windows-use-vim-ctags-and-git

    有人推荐直接下载一个windows下的vim安装包,或者有人推荐使用source insight,notpad++, sublime, ultraedit 或其他IDE工具等等,但是我尝试了使用这些工具查看代码以后,感觉都不习惯,后来才发现自己是个linux中毒...

    ctags,cscope,taglist.vim,cscope_maps.vim

    这里提到的"ctags", "cscope", "taglist.vim" 和 "cscope_maps.vim" 是针对Windows环境下Vim编辑器的几个强大插件,它们极大地提升了程序员的工作效率。下面将详细阐述这些工具的功能和使用方法。 1. **ctags**:...

    适用于windows下vim的cscope和ctag

    代码的话需要用cscope和ctags的组合, 可以达到类似sourceinsight的效果。这次上传的是cscope.exe和ctags.exe。这个是编译好的版本,在windows下直接用。不需要cygwin.dll的参与 我在vim6 vim7都用了很久, 非常方便...

    用vim+ctags+taglist+cscope打造文本模式下的Kscope

    但是,使用 Kscope 需要图形化界面,然而,在 Linux 系统下,我们可以使用 Vim 编辑器结合 ctags、taglist 和 cscope 工具来打造一个文本模式下的 Kscope。 ctags简介 ctags 是一种能为多种语言源程序的函数、变量...

    vim+ctag+cscope快速生成ctags cscope等索引文件shell脚本

    代码阅读,vim插件使用,根据自己指定的目录生成ctags cscope等索引文件,shell脚本,仅供参考。

    VIM IDE and CSCOPE 配置(修改版本)

    在"VIM IDE and CSCOPE配置(修改版本)"中,主要涉及了两个关键的增强功能:Supertab和C语言函数补全。Supertab是一款VIM插件,它允许用户通过按下Tab键来进行智能补全,使得代码编写更加流畅。在描述中提到,这个...

    vim插件ctags安装

    **vim插件ctags安装详解** vim作为一款强大的文本编辑器,因其高度可定制性和高效的操作方式深受程序员喜爱。在日常开发中,尤其对于大型项目,快速定位代码和跳转到函数定义是必不可少的功能。这就是ctags插件发挥...

    vim ctags安装和使用

    【vim ctags安装和使用】 CTags是一款强大的源代码导航工具,它能够遍历源代码文件,生成tags文件,帮助开发者快速定位代码中的符号,如变量、函数等。这对于大型项目或者频繁查阅代码的开发环境尤其有用。Taglist...

Global site tag (gtag.js) - Google Analytics