What's the simplest way to "jump to a file somewhere in my source tree by name"? For example, if I'm working with "libfoo" that contains libfoo/foo/foo.py
, I'd like to be able to jump to foo.py
from anywhere within libfoo/**
[0].
Possibly some way to do this with a tags file?
[0]: that is, libfoo/
and its subdirectories.
Go to file Alternatively, you can visually select the file name, then type gf in which case Vim will use the selected text. When writing a program, it is helpful to set the 'path' option to list the directories with your include files. Then you can easily open an include file.
Add file directory to Vim path This can be modified using :set path^= instead of :set path+= , which prepends the new directory to the beginning of the path instead of appending it to the end. For this to work, you will need to remove the path being added first, because otherwise the path^= will take no action.
Add **
is to you comma-separated vim path
variable (not system path) and if you're in some parent dir of the project use:
:find foo.py
check out command-t, FuzzyFinder, or FuzzyFinder_Textmate
Personally, I find command-t has the best UI, but FuF_Textmate is best for quickly getting to the right place in very large projects (which is why I use it after trying all 3)
Note that fuzzyfinder_textmate is unmaintained by its origional author, so you may have to poke around the gh network tab to find who has the most up to date branch. also note it is a bit of a pain to install.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With