Opening vim
from root of your source file and extending path
option to include all sub-directories therein.
For example set path+=/usr/include/c++/**
for C++ headers and set path+=**
for your source directory.
This ,then, opens a plethora of following possibilities.
1) Opening file by name or parts of it
:find file_name
You can use auto-completion and wildcard expansion with :find
reliably. You type the name, it will locate the name. This works language agnostic.I am sure you will like it.
2) Navigating to files under cusror:
if you want to go a file path like #include "project/path/classA.h
.
gf or gF - go to file under cursor.
Ctrl-6 - to come back to last cursor position after gf
or gF
3) API lookup and navigating to the API location
[i
or [I
can be used to look up your function signature for word under cursor without leaving your workspace. [<Tab>
to actually go to declaration. Use Ctrl-6 to come back to last location.
Without extending path
, you can start navigating files by :Ex
command and navigate and open your file. I prefer NerdTree
over this though.
NERDTree
– Sibilant