Jeenu:
>
> Hi,
>
> This thought came to mind when I was browsing source code. I know find
> command finds files of a name using 'path' option, and prefixing a
> count 'n' would give you the nth occurrence of the file with same
> name.
>
> I often find that I open a file using find, and realize it's not the
> file that I looked for. Then I use 2find, 3find so on, until I reach
> the actual file I wanted. Wouldn't it be nice if there is a command
> like :ts where VIM lists all files by the name, and then let the use
> choose one he wants? I'm assuming that such a feature is not present
> currently - I couldn't find any with ":h :find". I might be able to
> use the find utility, but something inside VIM would be nice.
>
> Please share your thoughts.
> :J


To find files, you can use ":ts filename".  But you need to pass
the command line option --extra=+f  when you build your tags
with exuberant ctags.

This is how I build tags and the cscope DB for vim sources for
example:

=========================================
#!/bin/sh
TMP_FILE=/tmp/build-tags.$$

find ~/sb/vim7/src -name '*.[ch]' -print > $TMP_FILE
ctags -e -L $TMP_FILE --language-force=c --fields=+S --extra=+f+q -f ~/tags

rm -f cscope.*
cscope -i $TMP_FILE -b -q -f ~/cscope.out

rm -f $TMP_FILE
=========================================

in my ~/.vimrc, I have:

set tags=~/tags

if has('cscope')
  if filereadable(expand("$HOME/cscope.out"))
    cs kill -1
    cs add ~/cscope.out
  endif
  set cscopeverbose
  set cscopequickfix=s-,c-,d-,i-,t-,e-,g-
endif


Then I can jump to a file with...

:ts screen.c

Or using cscope, I can also do:

:cs find f screen.c

-- Dominique

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to