使用命令-T 搜索
当我使用命令-T 搜索某个文件时,经常找不到它,因为我不在正确的目录中,所以我必须更改目录。
是否可以设置 command-T 首先在 Nerdtree
或其他地方添加书签的目录中进行搜索?
我可以将目录更改为 /
但此搜索的文件范围非常大。当我将目录更改为我的主目录并且正在寻找诸如 .bashrc
之类的普通文件时,我会发现相当多的文件位于 .wine
目录下。
在 99% 的时间里,我需要在我经常使用的项目目录中搜索文件。我可以在某些首选项中设置这些目录吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据文档,您可以从搜索中排除目录:
因此,如果您想排除备份目录,您可以
在 .vimrc 中
编写:另外,要忽略 dotfiles/dotdirs,您可以查看这些选项:
这些选项允许您:
- 完全忽略点文件;
- 停止在 dotdirs 中递归搜索;
- 指定 Command-T 应在什么深度停止扫描。
我在 作者的 git,但您可能可以通过在 vim 中发出以下命令来查看此文档:(
或类似的名称)
我没有在插件中看到任何对首选项或书签的引用。
但是,如果您通过打开所述项目目录中的文件来启动 vim,您可能需要将此行添加到 .vimrc 中:
此选项将在启动时将您的目录设置为当前文件的目录。
According to the documentation you can exclude directories from your search:
So if you wanted to exclude a backup dir, you would write:
in your .vimrc
In addition, to ignore dotfiles/dotdirs you can look into these options:
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:
(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:
This option will set on startup your directory to the current file's directory.
您可以尝试 Ctrl-P。我遇到了和你一样的问题,并且做出改变解决了这些问题。
我还忽略了一些文件夹(在 .vimrc 中):
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):