When I search some file with command-T it often failes to find it because I'm not in the right directory, so I have to change the directory.
Is it possible to set that command-T will search first in the directories that are bookmarked in Nerdtree
or somewhere else?
I could change the directory to /
but this search very large scope of files. When I change the dir to my home directory and I'm looking for something ordinary like .bashrc
I will find rather many files that are located under .wine
directory.
In 99 % of time I need to search files in project directories that I actively work with. Can I set these directories in some preferences?
According to the documentation you can exclude directories from your search:
*command-t-wildignore* |'wildignore'| string (default: '') Vim's |'wildignore'| setting is used to determine which files should be excluded from listings. This is a comma-separated list of glob patterns. It defaults to the empty string, but common settings include "*.o,*.obj" (to exclude object files) or ".git,.svn" (to exclude SCM metadata directories). For example: :set wildignore+=*.o,*.obj,.git A pattern such as "vendor/rails/**" would exclude all files and subdirectories inside the "vendor/rails" directory (relative to directory Command-T starts in).
So if you wanted to exclude a backup dir, you would write:
set wildignore+=project/backup
in your .vimrc
In addition, to ignore dotfiles/dotdirs you can look into these options:
g:CommandTNeverShowDotFiles
g:CommandTScanDotDirectories
g:CommandTMaxDepth
These allow you to:
- ignore dotfiles completely;
- stop searching recursively in dotdirs;
- specify at what depth should Command-T stop scanning.
I found this information in the author's git, but you can probably see this document by issuing in vim:
:help Command-T
(or a similar name)
I did not see any reference to preferences or bookmarks in the plugin.
However if you start vim by opening a file in said project directory you might want to add this line to your .vimrc:
set autochdir
This option will set on startup your directory to the current file's directory.
You could try Ctrl-P. I had the same problems as you do and making the change solved them.
I also ignore some folders (in .vimrc):
let g:ctrlp_custom_ignore = {
\ 'dir': '\.git$\|\.hg$\|\.svn$',
\ 'file': '\.exe$\|\.so$\|\.dll$' }
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