如何测试我的 vim 插件?

发布于 2024-12-09 23:37:53 字数 373 浏览 0 评论 0原文

大家好:我最近(不小心)从 mac os x(主目录)中的 .vim 文件夹中删除了所有文件夹/文件。

我正在尝试添加 Clojure Vim 插件 (VimClojure) - 它只是一个您应该“放入 .vim/plugins”的文件夹。

我已经添加了它,但是当我启动 vim 时,我没有看到语法突出显示有任何变化。我不确定 vim 是否“看到”该插件。

我在 OS X 上。

关于如何调试插件有什么想法吗?特别是

1) VIM 如何寻找插件?
2) $HOME/.vim/ 中是否有需要的文件?
3) 安装标准 vim 插件时,只需将解压的新插件文件转储到 $HOME/.vim/plugins 中就足够了吗?

谢谢

Hi guys : I recently (accidentally) removed all folders/files from my .vim folder in mac os x (home directory).

I am trying to add in the Clojure Vim plugin (VimClojure) - its simply a folder which you are supposed to "drop into .vim/plugins".

I have added it, but I don't see any changes to the syntax highlighting when I launch vim. I'm not sure wether vim "sees" the plugin or not.

I'm on OS X .

Any ideas on how to debug the plugin ? In particular

1) How does VIM look for plugins ?
2) Are there files which need to be in $HOME/.vim/ ?
3) Is it sufficient to simply dump the unzip a new plugin file into $HOME/.vim/plugins when installing a standard vim plugin ?

Thanks

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

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

发布评论

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

评论(3

暮年 2024-12-16 23:37:53

关于调试:为了查看 vim 是否已加载您的插件,您可以使用 :scriptnames 以及 breakadd file /path/to/your/plugin (或 breakadd file *your_plugin_name.vim:我从未使用过绝对路径,所以我不知道在这种情况下breakadd会做什么)。其他问题:

  1. :h初始化中描述,确切地说是:h load-plugins
  2. Vim 根本不需要任何文件(除了 vim 可执行文件、使用的共享库、动态链接器和内核)。
  3. 按照安装说明进行操作。通常,插件要么提取到 ~/.vim ,要么作为单个文件分发到 ~/.vim/plugin (没有 s >!)、~/.vim/colors~/.vim/ftplugin 等。我想你应该尝试将其解压到 ~/.vim/plugin 中,但是如果存档包含一些特殊目录,例如 plugin/ftplugin/ , colors/, after/ (参见 /usr/share/vim/vim73 获取列表)它可能应该转到 <代码>~/.vim。如果插件发布在 vim 上,还可以考虑使用 vim-addon-manager .org VAM 很可能能够安装它。

About debugging: in order to see whether vim has loaded your plugin you can use :scriptnames and also breakadd file /path/to/your/plugin (or breakadd file *your_plugin_name.vim: I never used absolute paths so I do not know what breakadd will do in this case). Other questions:

  1. Described in :h initialization, precisely :h load-plugins.
  2. Vim does not need any files at all (except vim executable, used shared libraries, dynamic linker and the kernel of course).
  3. Follow installation instructions. Normally plugins are either extracted to ~/.vim or distributed as a singe file that should go to either ~/.vim/plugin (no s!), ~/.vim/colors, ~/.vim/ftplugin or such. I guess you should try to extract it to ~/.vim/plugin, but if archive contains some special directories like plugin/, ftplugin/, colors/, after/ (see /usr/share/vim/vim73 for a list) it is likely that it should go to ~/.vim. Also consider using vim-addon-manager, if plugin was posted on vim.org VAM is likely to be able to install it.
泛泛之交 2024-12-16 23:37:53

几点。

  1. vim 如何寻找插件?请参阅 :helpstartup 了解 vim 何时何地查找要加载的文件。
  2. 并不真地。任何东西都只是个人定制。如果没有 .vim 文件夹,Vim 也能正常运行。
  3. 这一切都取决于插件。在我看来,VimClojure 插件可能有点误导。您有您正在使用的来源的链接吗?

无论如何,在尝试调试脚本时我总是采取的第一步是检查 :scriptnames 的输出。该命令将显示 vim 为当前会话加载了哪些脚本。如果您没有看到 VimClojure 附带的任何文件,则您可能在安装过​​程中犯了错误。

另一个提示是,您确实应该考虑使用插件管理器,例如 vundlevim-addon-manager,或者至少是 runtimepath 管理器 病原体。这似乎是当今 vim 配置的未来方式,它使安装和管理插件变得更加容易。它们还有助于保持 .vim 文件夹干净且井井有条。

A few points.

  1. How does vim look for plugins? See :help startup so see where and when vim looks for files to load.
  2. Not really. Anything there is just personal customization. Vim will run fine without a .vim folder.
  3. That all depends on the plugin. It sounds to me like the VimClojure plugin may be a little misleading. Do you have a link to the source you are using?

In any case, the first step I always take when attempting to debug a script is check the output of :scriptnames. This command will show you what scripts vim has loaded for the current session. If you see none of the files shipped with VimClojure, you probably made a mistake during the installation.

Another tip is that you really should look in to using a plugin manager such as vundle or vim-addon-manager, or at least the runtimepath manager pathogen. This seems to be the way of the future for vim configuration these days and it makes installing and managing plugins much easier. They also help to keep your .vim folder clean and organized.

拧巴小姐 2024-12-16 23:37:53

VimClojure 目录应该提取在 .vim 文件夹的顶部,或者如果您使用 病原体(你应该这么做!)。如果你是从头开始,请考虑从 vimclojure-easy 开始(不要自吹自擂)这是 VimClojure 的基本完整安装,附有说明。

The VimClojure directory should either be extraction on top of your .vim folder, or in a bundle folder if your using something like pathogen (which you should!). If you're starting from scratch, consider starting with vimclojure-easy (not to toot my own horn) which is a basic, full install of VimClojure with instructions.

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