gvim 病原体问题

发布于 2024-11-05 08:37:29 字数 475 浏览 2 评论 0原文

我从github下载了pathogen.vim并将其放在~/.vim下的“autoload”目录中。然而现在当我启动 gvim 并执行 :helptags 时,它说“需要参数”。我的 ~/.vimrc 文件的内容是:

call pathogen#runtime_append_all_bundles()
call pathogen#helptags()

我缺少什么?

谢谢。

Andy

PS:我这样做是为了安装 Nerdtree

--- 编辑 1 ---

根据我到目前为止所看到的,github 上的 Pathogen.vim 插件对我不起作用,所以我必须从vim.org,它成功了。然而现在当我执行“unzip nerd_tree -d ~/.vim/bundle”然后启动gvim时,我仍然找不到nerdtree。

- - -结尾 - - - - -

I downloaded pathogen.vim from github and put it in "autoload" directory under ~/.vim. However now when I fire up gvim, and do :helptags, it says "Argument required". The contents of my ~/.vimrc file are:

call pathogen#runtime_append_all_bundles()
call pathogen#helptags()

What am I missing?

Thanks.

Andy

PS: I am doing this so that I can install Nerdtree

--- EDIT 1 ---

Based on what I have seen so far, the pathogen.vim plugin from github did not work for me, so I had to download it from vim.org, and it worked. However now when I do "unzip nerd_tree -d ~/.vim/bundle" and then start up gvim, I can still not find nerdtree.

-----End ---------

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

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

发布评论

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

评论(3

最冷一天 2024-11-12 08:37:29

根据github站点上的病原体README,您应该使用:Helptags而不是 :helptags。执行 :Helptags 命令后,pathogen 现在应该生成 ~/.vim/bundle 目录下的所有文档。

According to the pathogen README on github site, you should use :Helptags instead of :helptags. With :Helptags command executed, pathogen should generate all the documentations under directory ~/.vim/bundle now.

尹雨沫 2024-11-12 08:37:29

helptags是一个vim命令,与病原体无关。 vim 中的 helptags 命令将目录作为参数,它将在其中处理 .txt 文件并生成标签文件。

要判断病原体是否正确加载,您应该能够尝试:调用pathogen#helptags()。如果手动运行没有失败,那么病原体就会被加载(如果你在启动 vim 时没有收到错误,这实际上是不必要的,因为你的 .vimrc 已经在运行这些命令)。

您需要完成的下一步是阅读此处提供的文档如何将插件安装为捆绑包。总结一下:

  • 创建一个名为 ~/.vim/bundle 的目录,
  • 将上游源中的文件解压缩/克隆/复制到 ~/.vim/bundle/plugin-name/ 中。这可能包含许多文件和目录(ftplugin、autoload、doc 等)。
  • 启动 vim 并测试插件名称提供的功能是否可用。如果没有,请检查您是否正确完成了上述步骤。

如果您遇到病原体问题,请记住安装捆绑包与以正常方式安装插件没有什么不同。优点是您可以将与该特定插件相关的所有文件和文件夹保存在自己的目录中。这使您可以单独管理每个插件,并确信您只触及与该插件相关的文件。

helptags is a vim command which has nothing to do with pathogen. The helptags command in vim takes a directory as an argument where it will process .txt files and generate the tags file.

To tell if pathogen is loading correctly you should be able to attempt to :call pathogen#helptags(). If running that manually does not fail, then pathogen is loaded (this is actually unnecessary if you are not getting an error when you start vim because your .vimrc is already running these commands).

The next step for you to complete is to read the documentation provided here on how to install a plugin as a bundle. To summarize:

  • Make a directory called ~/.vim/bundle
  • Unzip/clone/copy files from an upstream source into ~/.vim/bundle/plugin-name/. This may contain many files and directories (ftplugin, autoload, doc, etc.).
  • Fire up vim and test that the functionality provided by plugin-name is available. If not, check that you have completed the above steps correctly.

If you're having problems with pathogen, just remember installing a bundle is not all that different than installing a plugin the normal way. The advantage is you get to keep all files and folders related to that specific plugin in their own directory. This allows you to manage each plugin individually and be confident you are only touching files related to that plugin.

卸妝后依然美 2024-11-12 08:37:29

我使用病原体,我发现它很棒,但使用 NERDTree 根本不需要病原体。

只需像这样放置文件,然后发出 :helptags ~/.vim/doc ,它就会起作用:

~/.vim/doc/NERD_tree.txt
~/.vim/nerdtree_plugin/exec_menuitem.vim
~/.vim/nerdtree_plugin/fs_menu.vim
~/.vim/plugin/NERD_tree.vim

我对病原体的设置非常标准:

~/.vim/bundle/NERD_tree/doc/NERD_tree.txt
~/.vim/bundle/NERD_tree/nerdtree_plugin/exec_menuitem.vim
~/.vim/bundle/NERD_tree/nerdtree_plugin/fs_menu.vim
~/.vim/bundle/NERD_tree/nerdtree_plugin/insert_image.vim <-- a custom script not included with the distribution
~/.vim/bundle/NERD_tree/plugin/NERD_tree.vim

并且效果很好。

它有帮助,这是我的 ~/.vimrc 的第一行:

" This must be first, because it changes other options as side effect
set nocompatible

" Use pathogen to easily modify the runtime path to include all plugins under
" the ~/.vim/bundle directory
filetype off                    " force reloading *after* pathogen loaded
call pathogen#helptags()
call pathogen#runtime_append_all_bundles()
filetype plugin indent on       " enable detection, plugins and indenting in one step

I use pathogen and I find it great, but you don't need pathogen at all to use NERDTree.

Just put the files like this then issue :helptags ~/.vim/doc and it will work:

~/.vim/doc/NERD_tree.txt
~/.vim/nerdtree_plugin/exec_menuitem.vim
~/.vim/nerdtree_plugin/fs_menu.vim
~/.vim/plugin/NERD_tree.vim

My setup with pathogen is very standard:

~/.vim/bundle/NERD_tree/doc/NERD_tree.txt
~/.vim/bundle/NERD_tree/nerdtree_plugin/exec_menuitem.vim
~/.vim/bundle/NERD_tree/nerdtree_plugin/fs_menu.vim
~/.vim/bundle/NERD_tree/nerdtree_plugin/insert_image.vim <-- a custom script not included with the distribution
~/.vim/bundle/NERD_tree/plugin/NERD_tree.vim

and works like a charm.

It it helps, here are the first lines of my ~/.vimrc:

" This must be first, because it changes other options as side effect
set nocompatible

" Use pathogen to easily modify the runtime path to include all plugins under
" the ~/.vim/bundle directory
filetype off                    " force reloading *after* pathogen loaded
call pathogen#helptags()
call pathogen#runtime_append_all_bundles()
filetype plugin indent on       " enable detection, plugins and indenting in one step
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文