vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jun 06 2019 17:31:41)
Included patches: 1-1453
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by pkg-vim-maintainers@lists.alioth.debian.org
Huge version without GUI. Features included (+) or not (-):
+comments +libcall -python +vreplace
+conceal +linebreak +python3 +wildignore
我通过仅显示 -python 和 + python3 忽略了列表中的其他内容。
$ python --version
Python 3.6.9
在 vim 中我得到:
$vim test.py
:!python --version
Python 2.7.17
最佳答案
当您执行 :!cmd
时,您正在 shell 上运行 cmd。这个和vim没有太大关系。要检查 vim 内部使用的 python 版本,请执行 :python3 import sys; vim 内的 print(sys.version)
。
关于python - 为什么 Vim 使用 +python3 编译时运行 python2?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59448265/