源码编译vim

目录

  • 获取最新版 vim 源码
    • 1 git仓库clone
    • 2, 源码包下载,里面有各个版本的vim压缩包
  • vim 配置选项
  • 配置示例
    • 参考文章
    • tip

获取最新版 vim 源码

1 git仓库clone

git clone https://github.com/vim/vim.git

2, 源码包下载,里面有各个版本的vim压缩包

https://ftp.nluug.nl/pub/vim/unix/

Unix
The best way to install Vim on Unix is to use the sources. This requires a compiler and its support files. Compiling Vim isn't difficult at all. You can simply type "make install" when you are happy with the default features. Edit the Makefile in the "src" directory to select specific features.

vim 配置选项


Optional Features:
  --disable-option-checking  ignore unrecognized --enable/--with options
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --enable-fail-if-missing    Fail if dependencies on additional features
     specified on the command line are missing.
  --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
  --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-workshop       Include Sun Visual Workshop support.
  --disable-netbeans      Disable NetBeans integration support.
  --disable-channel       Disable process communication support.
  --enable-terminal       Enable terminal emulation support.
  --enable-autoservername Automatically define servername at vim startup.
  --enable-multibyte      Include multibyte editing support.
  --enable-hangulinput    Include Hangul input 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/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
  --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-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()).

Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-mac-arch=ARCH    current, intel, ppc or both
  --with-developer-dir=PATH    use PATH as location for Xcode developer tools
  --with-local-dir=PATH   search PATH instead of /usr/local for local libraries.
  --without-local-dir     do not search /usr/local for local libraries.
  --with-vim-name=NAME    what to call the Vim executable
  --with-ex-name=NAME     what to call the Ex executable
  --with-view-name=NAME   what to call the View executable
  --with-global-runtime=DIR    global runtime directory in 'runtimepath'
  --with-modified-by=NAME       name of who modified a release version
  --with-features=TYPE    tiny, small, normal, big or huge (default: huge)
  --with-compiledby=NAME  name to show in :version message
  --with-lua-prefix=PFX   Prefix where Lua is installed.
  --with-luajit           Link with LuaJIT instead of Lua.
  --with-plthome=PLTHOME   Use PLTHOME.
  --with-python-command=NAME  name of the Python 2 command (default: python2 or python)
  --with-python-config-dir=PATH  Python's config directory (deprecated)
  --with-python3-command=NAME  name of the Python 3 command (default: python3 or python)
  --with-python3-config-dir=PATH  Python's config directory (deprecated)
  --with-tclsh=PATH       which tclsh to use (default: tclsh8.0)
  --with-ruby-command=RUBY  name of the Ruby command (default: ruby)
  --with-x                use the X Window System
  --with-gnome-includes=DIR Specify location of GNOME headers
  --with-gnome-libs=DIR   Specify location of GNOME libs
  --with-gnome            Specify prefix for GNOME files
  --with-motif-lib=STRING Library for Motif
  --with-tlib=library     terminal library to be used

特性解释
--with-features=huge:支持最大特性
--enable-multibyte:打开多字节支持,可以在Vim中输入中文
--enable-rubyinterp:打开对ruby编写的插件的支持
--enable-python3interp:打开对python3编写的插件的支持
--enable-perlinterp:打开对perl编写的插件的支持
--enable-luainterp:打开对lua编写的插件的支持
--enable-gui=gtk2:gtk2支持,也可以使用gnome,表示生成gvim
--enable-cscope:打开对cscope的支持
--prefix=/usr/local/vim:指定将要安装到的路径(自行创建)
---------------------
原文:https://blog.csdn.net/XiaoApr/article/details/82837553

配置示例


卸载vim
yum -y remove vim*

安装依赖
yum -y install ncurses-devel

配置vim
./configure --with-features=huge \
            --enable-python3interp=yes \
            --enable-fontset=yes \
            --enable-cscope=yes \
            --enable-multibyte \
            --enable-fail-if-missing \
            --enable-gui=gtk2 \
            --prefix=/usr/local 

安装vim
make
make install

参考文章

Joit简书
https://www.jianshu.com/p/48749100614d

https://www.cnblogs.com/shinemic/p/8409827.html

tip

The latest news about Vim can be found on the Vim home page: http://www.vim.org/
If you have problems, have a look at the Vim documentation or tips: http://www.vim.org/docs.php http://vim.wikia.com/wiki/Vim_Tips_Wiki
If you still have problems or any other questions, use one of the mailing lists to discuss them with Vim users and developers: http://www.vim.org/maillist.php
If nothing else works, report bugs directly: Bram Moolenaar [email protected]

转载于:https://www.cnblogs.com/ims-/p/10074397.html

你可能感兴趣的:(源码编译vim)