使用Python支持构建自定义Vim二进制文件

zazmityj  于 12个月前  发布在  Python
关注(0)|答案(1)|浏览(121)

后台

Debian 11 vim软件包不包括python3支持。请参阅下面标题为“No python support in Debian 11 Vim - evidence”的部分
我需要YouCompleteMe vim plugin支持python3vim。为了构建一个新的vim,我在Debian 11系统上下载了Vim 9.0 tarball到/opt/中,并显式地解压缩它:

$ cd /opt
$ sudo wget http://ftp.vim.org/pub/pub/vim/unix/vim-9.0.tar.bz2
$ sudo bunzip2 ./vim-9.0.tar.bz2
$ sudo chown -R mpenning:mpenning vim/

字符串
我用...

$ cd /opt/vim
$ ./configure \
 --enable-python3interp=yes \
 --with-python3-command=python3.9 \
 --with-features=huge \
 --with-compiledby="[email protected]"
$ make
$ sudo cp src/vim /usr/bin/vim


但是,现在我在启动vim时看到这些错误。

$ vim foo.py
2022-10-24 09:08:31 [INFO] Editing 'foo.py'.
failed to load colors/lists/default.vim
failed to load colors/lists/default.vim
Press ENTER or type command to continue


问题
如何使用python3构建Debian vim二进制文件?

Debian 11 Vim - evidence不支持python

$ vim --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Oct 01 2021 01:51:08)
Included patches: 1-2434
Extra patches: 8.2.3402, 8.2.3403, 8.2.3409, 8.2.3428
Modified by [email protected]
Compiled by [email protected]
Huge version without GUI.  Features included (+) or not (-):
+acl               -farsi             +mouse_sgr         +tag_binary
+arabic            +file_in_path      -mouse_sysmouse    -tag_old_static
+autocmd           +find_in_path      +mouse_urxvt       -tag_any_white
+autochdir         +float             +mouse_xterm       -tcl
-autoservername    +folding           +multi_byte        +termguicolors
-balloon_eval      -footer            +multi_lang        +terminal
+balloon_eval_term +fork()            -mzscheme          +terminfo
-browse            +gettext           +netbeans_intg     +termresponse
++builtin_terms    -hangul_input      +num64             +textobjects
+byte_offset       +iconv             +packages          +textprop
+channel           +insert_expand     +path_extra        +timers
+cindent           +ipv6              -perl              +title
-clientserver      +job               +persistent_undo   -toolbar
-clipboard         +jumplist          +popupwin          +user_commands
+cmdline_compl     +keymap            +postscript        +vartabs
+cmdline_hist      +lambda            +printer           +vertsplit
+cmdline_info      +langmap           +profile           +virtualedit
+comments          +libcall           -python            +visual
+conceal           +linebreak         -python3           +visualextra
+cryptv            +lispindent        +quickfix          +viminfo
+cscope            +listcmds          +reltime           +vreplace
+cursorbind        +localmap          +rightleft         +wildignore
+cursorshape       -lua               -ruby              +wildmenu
+dialog_con        +menu              +scrollbind        +windows
+diff              +mksession         +signs             +writebackup
+digraphs          +modify_fname      +smartindent       -X11
-dnd               +mouse             -sound             -xfontset
-ebcdic            -mouseshape        +spell             -xim
+emacs_tags        +mouse_dec         +startuptime       -xpm
+eval              +mouse_gpm         +statusline        -xsmp
+ex_extra          -mouse_jsbterm     -sun_workshop      -xterm_clipboard
+extra_search      +mouse_netterm     +syntax            -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -Wdate-time -g -O2 -ffile-prefix-map=/build/vim-DtwDbo/vim-8.2.2434=. -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim -lm -ltinfo -lselinux -lacl -lattr -lgpm -ldl
$

gzszwxb4

gzszwxb41#

我需要Vim与python语法突出显示
Python语法高亮是内置的,所以你不需要手动构建Vim来获得它。你在浪费你和每个人的时间。
“Python支持”与语法突出显示无关。它指的是Python脚本接口,允许用户(部分)用Python编写Vim插件。在:version中包含-python-python3对Vim突出显示Python的能力没有影响。
FWIW,如果您安装vim-nox Debian包而不是依赖于vim Debian包,则不必构建新的Vim二进制文件。vim-noxvim.nox二进制构建中嵌入了几种脚本语言。

相关问题