What OS are you running this on?
I usually do the following:
cd /root/dir/where/php/is
dir /s/b *.php > cscope.files (Windows)
find -name *.php > cscope.files (Unix)
cscope -b (create the cscope database)
In Vim:
:cd /root/dir/where/php/is
:cs add cscope.out . -C
" I use the -C for case insensitivity
Then I primarily use these 2 mappings:
nnoremap g<C-\> :silent! cs find 0
<C-R>=expand("<cword>")<CR><CR>:cwindow<CR>
vnoremap <silent> g<c-\> :<C-U>
\:let old_reg=getreg('"')<bar>
\:let old_regmode=getregtype('"')<cr>
\gvy
\:silent! cs find s <C-R>=@"<cr><cr>
\:call setreg('"', old_reg, old_regmode)<cr>:cwindow<CR>
Notice this is using the cs find command, since cscope doesn't
understand PHP, it can be used to find the methods and what not
though. I do the same for SQL files and Perl.
You can map the above to anything you want, it is hard to find key
combinations which are not already useful though!
HTH,
Dave
> find -name *.php > cscope.files (Unix)
Shouldn't be
find -name '*.php' > cscope.files
?
% tree
.
|-- b.c
|-- y
| `-- r.c
`-- z
`-- b.c
% find -name *.c
./b.c
./z/b.c
% find -name '*.c'
./b.c
./z/b.c
./y/r.c
%
--
Nicolas Sebrecht
> find -name *.php > cscope.files (Unix)
Shouldn't be
This may come as a surprise to you, but on the topic of Vim, and topics
related to it, Google is rarely the best place to find help.
The places to find Vim help are:
- Vim's own help system (using the :help command, possibly with help tag
completion, and the :helpgrep command)
see:
:help
:help :help
:help {subject}
:help 'wildmenu'
:help 'wildmode'
:help :helpgrep
- The Vim Tips Wiki http://vim.wikia.com/
- This mailing list / Google group.
I'm listing them in the order in which I recommend checking them. This
ML may have more answers than the other two together, but unlike them,
it depends on the constant goodwill of flesh-and-bones people, while the
other two are their accumulated knowledge and require only minimal updating.
Best regards,
Tony.
--
If you took all the students that fell asleep in class and laid them
end to end, they'd be a lot more comfortable.
-- "Graffiti in the Big Ten"