用+python编译所需的vim

2024-05-13 23:28:28 发布

您现在位置:Python中文网/ 问答频道 /正文

当我在一个python文件中输入raw并点击<C-x><C-o>时,我得到一个错误:需要用+python编译的vim。但是根据command:version的结果,在python前面有一个+而不是-的,我应该怎么做来解决这个问题?

+arabic          +cursorbind      -footer          +mksession       +path_extra      +startuptime     +visual
+autocmd         +cursorshape     +fork()          +modify_fname    -perl            +statusline      +visualextra
-balloon_eval    +dialog_con      +gettext         +mouse           +persistent_undo -sun_workshop    +viminfo
-browse          +diff            -hangul_input    -mouseshape      +postscript      +syntax          +vreplace
++builtin_terms  +digraphs        +iconv           +mouse_dec       +printer         +tag_binary      +wildignore
+byte_offset     -dnd             +insert_expand   -mouse_gpm       +profile         +tag_old_static  +wildmenu
+cindent         -ebcdic          +jumplist        -mouse_jsbterm   +python/dyn      -tag_any_white   +windows
+clientserver    +emacs_tags      +keymap          +mouse_netterm   +python3/dyn     -tcl             +writebackup
+clipboard       +eval            +langmap         +mouse_sgr       +quickfix        +terminfo        +X11
+cmdline_compl   +ex_extra        +libcall         -mouse_sysmouse  +reltime         +termresponse    +xfontset
+cmdline_hist    +extra_search    +linebreak       +mouse_urxvt     +rightleft       +textobjects     -xim
+cmdline_info    +farsi           +lispindent      +mouse_xterm     -ruby            +title           -xsmp
+comments        +file_in_path    +listcmds        +multi_byte      +scrollbind      -toolbar         +xterm_clipboard
+conceal         +find_in_path    +localmap        +multi_lang      +signs           +user_commands   -xterm_save
+cryptv          +float           -lua             -mzscheme        +smartindent     +vertsplit
+cscope          +folding         +menu            +netbeans_intg   -sniff           +virtualedit

谢谢


Tags: 文件pathinrawtag错误evalbyte
2条回答

对于Ubuntu16.04,在安装插件之后,请执行以下操作来解决问题:

sudo apt-get install vim-gnome-py2

标记为^{}的功能可能可用,也可能不可用。对这些功能的支持不是内置的。它取决于专用共享对象的存在。

To some of the features "/dyn" is added when the feature is only available when the related library can be dynamically loaded.

要检查vim是否可以使用动态功能,例如python请执行以下操作:

:echo has('python')

它将打印0(false)或1(true)

另请参见python-dynamic

更新:

如果从源安装了vim,则必须重新生成它。使用--enable-pythoninterp--with-python-config-dir选项。还要确保安装了python开发头和库(devel包)。

相关问题 更多 >