slimv 无法在 vim 中加载 *.lisp 文件

发布于 2024-12-01 05:00:41 字数 834 浏览 4 评论 0原文

我安装了 slimv.vim(首先通过 Archlinux 上的 yaourt,然后通过 vimana),通过这两种方法,当我打开 lisp 文件时,slimv.vim 不会加载。我已经在谷歌结果中搜索了调试帮助,这是我迄今为止检查过的内容:

  • :scriptnames does not show slimv.vim, so it's not be returned at all
  • < code>:filetype 显示设置为 ON 的所有选项
  • :set rtp? 显示 ~/.vim 作为第一个条目
  • vim 是用 python 编译的,显示+python
  • slimv.vim 及相关文件均在 ~/.vim/ftplugin/
  • :echo $HOME显示正确的主目录
  • slimv.vimfiletype=unix
  • 我已经尝试过使用和不使用 let g:slimv_python = 'python2'.vimrc,正如 slimv 的 AUR 注释所建议的
  • :messages 没有显示任何内容
  • :set ft? 显示该文件被识别为 lisp

我不知道没有任何其他插件,所以这可能是一个普遍的 vim 问题,我无法判断。接下来我应该尝试什么?

I installed slimv.vim (first through yaourt on Archlinux and then through vimana) and via both methods, slimv.vim doesn't load when I open a lisp file. I've scoured google results for debugging help, and here's what I have checked so far:

  • :scriptnames does not show slimv.vim, so it's not being loaded at all
  • :filetype shows all options set to ON
  • :set rtp? shows ~/.vim as the first entry
  • vim was compiled with python, shows +python
  • slimv.vim and related files are all in ~/.vim/ftplugin/
  • :echo $HOME shows the correct home directory
  • slimv.vim is of filetype=unix
  • I've tried both with and without let g:slimv_python = 'python2' in .vimrc, as suggested by the AUR comments for slimv
  • :messages shows nothing
  • :set ft? shows that the file is recognized as lisp

I don't have any other plugins, so it's possible that this is a general vim issue and I can't tell. What should I try next?

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

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

发布评论

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

评论(3

仙气飘飘 2024-12-08 05:00:41

即使 :filetype 显示所有设置为 ON 的选项,也许它们设置得太晚了(paredit.vim 设置它们),所以我建议在您的 .vimrc 中写入:

filetype plugin on
filetype indent on

您也可以通过使用 -V10 选项运行 vim 来设置详细模式:

vim -V10 test.lisp

这将打印有关搜索和获取的脚本的日志信息。

Slimv 附带了 paredit.vim,它是一个通用(不是文件类型)插件,因此应该为所有文件类型加载它。检查它是否通过以下方式加载

:echo g:paredit_loaded

您可能还想尝试安装另一个 vim 插件,只是为了测试它是否是一般 vim 问题或与 Slimv 相关的问题。

编辑:文件类型插件要么需要与文件类型本身同名(例如lisp.vim),要么需要驻留在与文件类型同名的子目录中。 Slimv 使用后一种逻辑,因此请确保有一个包含 slimv-lisp.vim 的 lisp 子目录:

~/.vim/ftplugin/lisp/slimv-lisp.vim

Even if :filetype shows all options set to ON, maybe they are set too late (paredit.vim sets them), so I suggest to write this in your .vimrc:

filetype plugin on
filetype indent on

Also you can set verbose mode by running vim with the -V10 option:

vim -V10 test.lisp

This prints log info on the scripts searched and sourced.

Slimv comes with paredit.vim that is a general (not a filetype) plugin, so it should be loaded for all filetypes. Check if it is loaded via

:echo g:paredit_loaded

You may also want to try to install another vim plugin just to test if it's a general vim problem or something related to Slimv.

EDIT: filetype plugins either need to have the same name as the filetype itself (e.g. lisp.vim) or they need to reside in a subdirectory having the same name as the filetype. Slimv uses the latter logic, so make sure that there is a lisp subdirectory containing slimv-lisp.vim:

~/.vim/ftplugin/lisp/slimv-lisp.vim
清君侧 2024-12-08 05:00:41

很难说你的问题到底出在哪里,但首先我会检查你的文件类型是否被正确识别。 :set ft? 应该输出类似 filetype=lisp 的内容,

之后您可以检查 :messages 是否有任何错误消息。

It's difficult to say where your problem is exactly but first I would check that your filetype is recognized properly. :set ft? should output something like filetype=lisp

After that you could check :messages for any error messages.

一萌ing 2024-12-08 05:00:41

我最终通过卸载 slimv.vim 并从 ~/.vim/ftplugin/ 中手动删除名为 lisp 的文件,然后使用 vimana 重新安装来解决了这个问题。现在效果很好。感谢您帮助我度过难关!

I eventually fixed this issue by uninstalling slimv.vim and manually removing the file named lisp from ~/.vim/ftplugin/, then reinstalling with vimana. It's working great, now. Thanks for helping me through it!

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