为什么 MacVim 中的 Command-T 找不到文件?
我使用以下命令在 MacVim 中打开了 Rails 项目:
cd ~/development/book-examples/agile_web_dev_rails/worked_examples/depot
mvim .
我正在尝试使用 Command-T 来查找 ./test/fixtures/products.yml
;但是,我没有成功。下面的屏幕截图显示:
- NERDTree 可以看到
./test/fixtures/products.yml
- 在 Command-T 中输入
test/
甚至不显示fixtures< /code> 目录
对于为什么 Command-T 找不到 fixtures/products.yml
有什么想法吗?
更新
如果我只打开 MacVim 中的 test
目录而不是整个 Rails项目使用:
cd ~/development/book-examples/agile_web_dev_rails/worked_examples/depot/test
mvim .
然后,Command-T 能够找到fixtures/products.yml
。
I opened my rails project in MacVim using:
cd ~/development/book-examples/agile_web_dev_rails/worked_examples/depot
mvim .
I'm trying to use Command-T to find ./test/fixtures/products.yml
; however, I'm having no success. The screenshot below shows that:
- NERDTree can see
./test/fixtures/products.yml
- Typing
test/
into Command-T doesn't even show thefixtures
directory
Any thoughts on why fixtures/products.yml
isn't found by Command-T?
Update
If I open just the test
directory in MacVim instead of the entire Rails project using:
cd ~/development/book-examples/agile_web_dev_rails/worked_examples/depot/test
mvim .
Then, Command-T is able to find fixtures/products.yml
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这并不是你问题的真正答案,但你应该看看 Rails.vim,这允许您可以使用方便的命令(例如 :Rfixture products)(通过制表符补全完成)来浏览您的应用程序。
This is not really an answer to your question, but you ought to look at Rails.vim, this allows you to navigate through your app using conventient commands like :Rfixture products (complete with tab completion).
原因是您所在的目录中有很多文件。默认情况下,插件会读取 10 000 个文件。您可以在 .vimrc 中更改此值:
let CommandTMaxFiles = 20000
如果您处理包含大量文件的项目(如 Rails),它会很有用。
然而,最好使用
:cd
命令在 VIM 中设置当前目录,以使插件工作得更快。您可以使用
:pwd
命令检查您所在的位置。The reason is that you have lots of files in the directory you are in. By default plugin reads 10 000 files. You can change this value in your .vimrc:
let CommandTMaxFiles = 20000
It's useful if you work on project which contains tons of files (like Rails).
However it's always better to set current dir within VIM with
:cd
command to make plugin work faster.You can check where you are with
:pwd
command.