NERDTree vim 插件,尝试添加文件但没有成功

发布于 2024-09-11 00:26:31 字数 745 浏览 2 评论 0原文

据我了解,您可以使用 NERDTree 插件直接从 MacVim 添加文件。我导航到 NERDtree 并按“m”打开 NERDTree 文件系统菜单,如本文所述: vim 和 NERD 树扩展 - 添加文件

问题是,我在调用 'm' 后得到这个输出:

NERDTree Menu. Use j/k/enter and the shortcuts indicated
==========================================================
Error detected while processing function <SNR>14_showMenu..30..31:
line    4:
E716: Key not present in Dictionary: menuItems)-1)
E116: Invalid arguments for function len(self.menuItems)-1)
E116: Invalid arguments for function range(0, len(self.menuItems)-1)
E15: Invalid expression: range(0, len(self.menuItems)-1)
Press ENTER or type command to continue

To my understanding, you can add files directly from MacVim with the NERDTree plugin. I navigate to NERDtree and hit 'm' to bring up the NERDTree filesystem menu as described in this post: vim and NERD Tree extension - adding a file

The problem is, I get this output after invoking 'm':

NERDTree Menu. Use j/k/enter and the shortcuts indicated
==========================================================
Error detected while processing function <SNR>14_showMenu..30..31:
line    4:
E716: Key not present in Dictionary: menuItems)-1)
E116: Invalid arguments for function len(self.menuItems)-1)
E116: Invalid arguments for function range(0, len(self.menuItems)-1)
E15: Invalid expression: range(0, len(self.menuItems)-1)
Press ENTER or type command to continue

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

窗影残 2024-09-18 00:26:32

我一直在 MacVim 中使用 NERD_tree,并且添加新文件没有任何问题。检查您使用的 NERD_tree 版本。如果您查看文件:

~/.vim/plugins/NERD_tree.vim

如果您使用的是最新版本,您应该在顶部附近看到这一行:

let s:NERD_tree_version = '4.1.0'

另外请确保 fs_menu.vim 存在(文件系统命令需要此插件)

~/.vim/nerdtree_plugin/fs_menu.vim

I use NERD_tree with MacVim all of the time and I have no problems adding new files. Check what version of NERD_tree you are using. If you look in the file:

~/.vim/plugins/NERD_tree.vim

You should see this line near the top if you are using the latest version:

let s:NERD_tree_version = '4.1.0'

Also make sure that fs_menu.vim is present (this plugin is required for the file system commands)

~/.vim/nerdtree_plugin/fs_menu.vim
海之角 2024-09-18 00:26:32

如果您克隆 git 存储库,请确保从存储库内部运行“rake install”...我没有这样做,而是选择复制自己周围的东西,并且我错过了上面提到的 GWW 的 fs_menu.vim 文件这就是给我上面提到的错误的原因。我刚刚重新克隆了存储库并运行了“rake install”,现在一切正常。

If you clone the git repository, make sure you run "rake install" from inside the repo...I didn't do this, and chose to just copy things around myself, and I missed the fs_menu.vim file that GWW mentioned above and that's what was giving me the error mentioned above. I just cloned the repository anew and ran "rake install" and everything works perfectly now.

杀お生予夺 2024-09-18 00:26:32

这是 NERDTree 插件中的一个错误,您应该发送电子邮件给作者, 马蒂·格伦菲尔

This is a bug in the NERDTree plugin, you should send an email to the author, Marty Grenfell

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文