如何让 python.vim 与 vim 一起工作?

发布于 2024-09-11 12:37:14 字数 513 浏览 2 评论 0原文

我正在使用 vim,听说 python.vim 对 python 有一些漂亮的设置。

链接到 python.vim http://www.vim.org/scripts/script.php?script_id= 790

Q1:如何将 python.vim 与 vim 集成? Q2:因为我不熟悉vim,如果我使用像python.vim这样的东西,它会对非python文件产生疯狂的影响还是这些设置只适用于python文件?


更新:

我已经按照我发布的链接的指示将该文件放置在适当的目录中。它似乎不适用于 vim。我必须从 vim 获取它吗?从 vim 外部?我觉得我两种都试过了,但都不起作用。

另外 ~/.vim/syntax/ 文件夹的目录也不存在。我必须创造它。

仅供参考 - 我正在 MAC 上执行此操作。

I am playing around with vim and I heard that python.vim has some nifty settings for python.

Link to python.vim
http://www.vim.org/scripts/script.php?script_id=790

Q1: How do I integrate python.vim with vim?
Q2: Because I am not familiar with vim, if I use something like python.vim will it have a crazy effect on non-python files or will the settings just apply to python files?


Update:

I already places the file in the appropriate directory as instructed by the link I posted. It doesn't appear to be working with vim. Do I have to source it some how from vim? From outside of vim? I feel like I have tried both and neither are working.

Also the directory the ~/.vim/syntax/ folder did not exist. I had to create it.

FYI - I'm doing this on a MAC.

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

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

发布评论

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

评论(2

樱娆 2024-09-18 12:37:14

Q1:

按照 python.vim 文件描述

“安装详细信息” 中的安装详细信息进行操作
将 python.vim 文件放在 ~/.vim/syntax/ 文件夹中。”

Q2:

python.vim 是一个文件类型插件,因此它仅在您编辑 .py 文件时才起作用。

关于您的更新:

尝试发出命令:

:syntax on

这将变成如果您希望始终启用此功能,可以将其添加到 ~/.vimrc

除此之外,您可能还需要将其添加到 .vimrc 中:

filetype plugin on

Q1:

Follow the installation details in the python.vim files description

"install details
Place python.vim file in ~/.vim/syntax/ folder."

Q2:

python.vim is a filetype plugin so it will only work when you are editing .py files.

Regarding your update:

Try issuing the command:

:syntax on

This will turn on syntax highlighting. If you want this to always be on you can add it to ~/.vimrc

In addition to this you may need to add this to your .vimrc as well:

filetype plugin on
思念绕指尖 2024-09-18 12:37:14

安装详细信息

将 python.vim 文件放在 ~/.vim/syntax/ 文件夹中。

引用自 http://www.vim.org/scripts/script.php? script_id=790

并且它仅适用于 .py 文件。

install details

Place python.vim file in ~/.vim/syntax/ folder.

Quoted from http://www.vim.org/scripts/script.php?script_id=790

And it only applies to .py files.

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