如何让 python.vim 与 vim 一起工作?
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Q1:
按照 python.vim 文件描述
“安装详细信息” 中的安装详细信息进行操作
将 python.vim 文件放在 ~/.vim/syntax/ 文件夹中。”
Q2:
python.vim 是一个文件类型插件,因此它仅在您编辑 .py 文件时才起作用。
关于您的更新:
尝试发出命令:
这将变成如果您希望始终启用此功能,可以将其添加到 ~/.vimrc
除此之外,您可能还需要将其添加到 .vimrc 中:
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:
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:
引用自 http://www.vim.org/scripts/script.php? script_id=790
并且它仅适用于 .py 文件。
Quoted from http://www.vim.org/scripts/script.php?script_id=790
And it only applies to .py files.