Friday, June 22, 2007

Ayuda de cscope en vim

Copio aqui la ayuda de cscope en vim.

find : Query cscope. All cscope query options are available
except option #5 ("Change this grep pattern").

USAGE :cs find {querytype} {name}

{querytype} corresponds to the actual cscope line
interface numbers as well as default nvi commands:

0 or s: Find this C symbol
1 or g: Find this definition
2 or d: Find functions called by this function
3 or c: Find functions calling this function
4 or t: Find this text string
6 or e: Find this egrep pattern
7 or f: Find this file
8 or i: Find files #including this file

EXAMPLES >
:cscope find c vim_free
:cscope find 3 vim_free

Tuesday, June 19, 2007

Creando una lista de archivos C y manejandola con cscope

Cscope es una maravilla.

Usando los siguientes comandos se puede navegar bien un conjunto de archivos fuente:

find . -name "*.c" -o -name "*.h" > list
ctags -L list
cscope -b -i list
vim -t <nombre de funcion>

Y una vez en vim, hay los comandos

:cscope find 0 <nombre de variable / funcion>