Chinaunix首页 | 论坛 | 博客
  • 博客访问: 565451
  • 博文数量: 204
  • 博客积分: 245
  • 博客等级: 二等列兵
  • 技术积分: 1293
  • 用 户 组: 普通用户
  • 注册时间: 2012-03-16 10:29
文章分类

全部博文(204)

文章存档

2024年(1)

2023年(4)

2022年(21)

2021年(7)

2020年(5)

2019年(1)

2018年(6)

2017年(11)

2016年(15)

2015年(52)

2014年(37)

2013年(26)

2012年(18)

我的朋友

分类: LINUX

2020-01-03 17:17:24

原文地址:linux环境下cscope使用 作者:xqzhao206


shell下生成cscope文件

find . -name "*.[ch]" > cscope.files
cscope -bk -i cscope.files
或者
cscope -Rbq

gvim cscope Keybindings:

nmap s :cs find s =expand("")
nmap g :cs find g =expand("")
nmap c :cs find c =expand("")
nmap t :cs find t =expand("")
nmap e :cs find e =expand("")
nmap f :cs find f =expand("")
nmap i :cs find i ^=expand("")
nmap d :cs find d =expand("")


emacs cscope Keybindings:
;;
;; All keybindings use the "C-c s" prefix, but are usable only while
;; editing a source file, or in the cscope results buffer:
;;
;;      C-c s s         Find symbol.
;;      C-c s d         Find global definition.
;;      C-c s g         Find global definition (alternate binding).
;;      C-c s G         Find global definition without prompting.
;;      C-c s c         Find functions calling a function.
;;      C-c s C         Find called functions (list functions called
;;                      from a function).
;;      C-c s t         Find text string.
;;      C-c s e         Find egrep pattern.
;;      C-c s f         Find a file.
;;      C-c s i         Find files #including a file.
;;
;; These pertain to navigation through the search results:
;;
;;      C-c s b         Display *cscope* buffer.
;;      C-c s B         Auto display *cscope* buffer toggle.
;;      C-c s n         Next symbol.
;;      C-c s N         Next file.
;;      C-c s p         Previous symbol.
;;      C-c s P         Previous file.
;;      C-c s u         Pop mark.
;;
;; These pertain to setting and unsetting the variable,
;; `cscope-initial-directory', (location searched for the cscope database
;;  directory):
;;
;;      C-c s a         Set initial directory.
;;      C-c s A         Unset initial directory.
;;
;; These pertain to cscope database maintenance:
;;
;;      C-c s L         Create list of files to index.
;;      C-c s I         Create list and index.
;;      C-c s E         Edit list of files to index.
;;      C-c s W         Locate this buffer's cscope directory
;;                      ("W" --> "where").
;;      C-c s S         Locate this buffer's cscope directory.
;;                      (alternate binding: "S" --> "show").
;;      C-c s T         Locate this buffer's cscope directory.
;;                      (alternate binding: "T" --> "tell").
;;      C-c s D         Dired this buffer's directory.


附一个简要的vimrc文件:

cat ~/.vimrc
set nocompatible
set backspace=2
"set enc=utf-8
set fencs=ucs-bom,utf-8,utf-16,gbk,big5,gb18030,latin1
set fenc=utf-8
syntax on
set nobackup
set nu
set hlsearch
set incsearch
set noswapfile
set pastetoggle=
set tabstop=4
set expandtab
set smarttab
set shiftwidth=4
set softtabstop=4
set autoindent
set smartindent
set cindent
set ruler
set shortmess=atI

set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ %{strftime(\"%d/%m/%y\ -\ %H:%M\")}
set laststatus=1

colorscheme evening
set guifont=文泉驿等宽正黑\ 11
"set guifont=DejaVu\ Sans\ Mono\ 10

nmap s :cs find s =expand("")
nmap g :cs find g =expand("")
nmap c :cs find c =expand("")
nmap t :cs find t =expand("")
nmap e :cs find e =expand("")
nmap f :cs find f =expand("")
nmap i :cs find i ^=expand("")
nmap d :cs find d =expand("")



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