Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where vim searches for its filename completion ctrl-x ctrl-f? [closed]

I have a bunch of files in (project)/src and (project)/inc.

When I press <C-x><C-f> vim should give me suggestions about filenames from there but I couldn't find how to set the directories it searches in.

The documentation I read says only that <C-p> and <C-n> moves inside the list but nothing about calibrating the search path.

like image 635
Dimitar Slavchev Avatar asked Aug 03 '12 12:08

Dimitar Slavchev


2 Answers

set autochdir

automatically sets the "current directory" to the one containing the current file. Put it in your vimrc, enjoy life.

like image 59
romainl Avatar answered Nov 08 '22 23:11

romainl


Its the pwd or the path from where the vim was launched.Its not configurable.

Although a new feature called path-support will be available in vim soon: http://vimdoc.sourceforge.net/htmldoc/options.html#%27path%27

That might help you configure more.

In the meantime try these vim plugins:

FuzzyFinder http://www.vim.org/scripts/script.php?script%5Fid=1984

zvim https://bitbucket.org/ZyX_I/zvim

t-command http://www.vim.org/scripts/script.php?script_id=3025

Or you can write your own vim plugin.

Refer:
http://vim.wikia.com/wiki/Searching_for_files_in_a_directory_listing
And
http://vim.wikia.com/wiki/Source_vimrc_and_use_tags_in_a_parent_directory

like image 24
askmish Avatar answered Nov 08 '22 22:11

askmish