Vim编译支持Python

2020-04-07  本文已影响0人  夙小叶

  1. GitHub下载最新源代码
  2. 创建安装位置
  3. 编译(./configure --help查看具体要求)
  4. 安装
  5. 设置环境变量

下载源代码:

https://github.com/vim/vim/releases

创建安装目录或直接安装到 /usr/local

mkdir -p /usr/local/vim8

查看说明:

./configure --help

编译选项:

Optional Features:
  --disable-option-checking  ignore unrecognized --enable/--with options
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --disable-darwin        Disable Darwin (Mac OS X) support.
  --disable-smack     Do not check for Smack support.
  --disable-selinux   Do not check for SELinux support.
  --disable-xsmp          Disable XSMP session management
  --disable-xsmp-interact Disable XSMP interaction
  --disable-netbeans      Disable NetBeans integration support.
  --disable-channel       Disable process communication support.
  --disable-rightleft     Do not include Right-to-Left language support.
  --disable-arabic        Do not include Arabic language support.
  --disable-farsi         Deprecated.
  --disable-gtktest       Do not try to compile and run a test GTK program
  --disable-icon-cache-update        update disabled
  --disable-desktop-database-update  update disabled
  --disable-largefile     omit support for large files
  --disable-canberra      Do not use libcanberra.
  --disable-acl           No check for ACL support.
  --disable-gpm           Don't use gpm (Linux mouse daemon).
  --disable-sysmouse      Don't use sysmouse (mouse in *BSD console).
  --disable-nls           Don't support NLS (gettext()).


  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --enable-fail-if-missing    Fail if dependencies on additional features 
        specified on the command line are missing.
  --enable-luainterp=OPTS      Include Lua interpreter.  default=no OPTS=no/yes/dynamic
  --enable-mzschemeinterp      Include MzScheme interpreter.
  --enable-perlinterp=OPTS     Include Perl interpreter.  default=no OPTS=no/yes/dynamic
  --enable-pythoninterp=OPTS   Include Python interpreter. default=no OPTS=no/yes/dynamic
  --enable-python3interp=OPTS  Include Python3 interpreter. default=no OPTS=no/yes/dynamic
  --enable-tclinterp=OPTS      Include Tcl interpreter. default=no OPTS=no/yes/dynamic
  --enable-rubyinterp=OPTS     Include Ruby interpreter.  default=no OPTS=no/yes/dynamic
  --enable-cscope         Include cscope interface.
  --enable-terminal       Enable terminal emulation support.
  --enable-autoservername Automatically define servername at vim startup.
  --enable-multibyte      Include multibyte editing support.
  --enable-xim            Include XIM input support.
  --enable-fontset        Include X fontset output support.
  --enable-gui=OPTS       X11 GUI. default=auto OPTS=auto/no/gtk2/gnome2/gtk3/motif/athena/neXtaw/haiku/photon/carbon
  --enable-gtk2-check     If auto-select GUI, check for GTK+ 2 default=yes
  --enable-gnome-check    If GTK GUI, check for GNOME default=no
  --enable-gtk3-check     If auto-select GUI, check for GTK+ 3 default=yes
  --enable-motif-check    If auto-select GUI, check for Motif default=yes
  --enable-athena-check   If auto-select GUI, check for Athena default=yes
  --enable-nextaw-check   If auto-select GUI, check for neXtaw default=yes
  --enable-carbon-check   If auto-select GUI, check for Carbon default=yes

编译:

$ ./configure --with-features=huge \
--enable-python3interp \
--enable-pythoninterp \
--enable-rubyinterp \
--with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu/ \
--with-python3-config-dir=/usr/lib/python3.7/config-3.7m-x86_64-linux-gnu \
--prefix=/usr/local/vim8/

# 若是直接安装到 /usr/local
--prefix=/usr/local

$ make

注意 python3 对应的版本(python3有多个版本)

ls /usr/lib/ | grep python

python2.7
python3
python3.7

安装:

make install

设置环境变量(安装到 /usr/local 则跳过):

# 临时
export PATH=/usr/local/vim8/bin:$PATH

# 永久
echo -e "export PATH=/usr/local/vim8/bin:$PATH" >> ~/.bashrc 或者 ~/.zshrc

卸载:

make uninstall

截屏2020-04-07 13.08.43.png 截屏2020-04-07 13.52.04.png
上一篇下一篇

猜你喜欢

热点阅读