最近我发现Vim中有许多隐藏的功能。
所以我决定重新编译它(版本7.4)以启用它的所有功能。
不幸的是,到目前为止我看到的文档主要是关于如何构建一个普通的vim,而不是一个具有完整功能的文档。
因此,任何人都可以推荐更多有关如何构建此信息的信息吗?
顺便说一句,我想知道为什么启用了完整功能的vim不是默认选择?
答案 0 :(得分:2)
如果您查看README
in Vim's source code repository,您会发现构建源代码的所有详细信息都包含在src/INSTALL
file中。听起来您很可能对可以启用的可选功能部分感兴趣。此外,您可以通过查看src/auto/configure
找到configure
可用的可选功能列表。这是我刚刚从源代码中获取的列表:
--disable-acl Don't check for ACL support.
--disable-darwin Disable Darwin (Mac OS X) support.
--disable-gpm Don't use gpm (Linux mouse daemon).
--disable-gtktest Do not try to compile and run a test GTK program
--disable-largefile omit support for large files
--disable-netbeans Disable NetBeans integration support.
--disable-nls Don't support NLS (gettext()).
--disable-option-checking ignore unrecognized --enable/--with options
--disable-selinux Don't check for SELinux support.
--disable-sysmouse Don't use sysmouse (mouse in *BSD console).
--disable-xsmp Disable XSMP session management
--disable-xsmp-interact Disable XSMP interaction
--enable-athena-check If auto-select GUI, check for Athena default=yes
--enable-carbon-check If auto-select GUI, check for Carbon default=yes
--enable-cscope Include cscope interface.
--enable-fail-if-missing Fail if dependencies on additional features
--enable-fontset Include X fontset output support.
--enable-gnome-check If GTK GUI, check for GNOME default=no
--enable-gtk2-check If auto-select GUI, check for GTK+ 2 default=yes
--enable-gui=OPTS X11 GUI default=auto OPTS=auto/no/gtk2/gnome2/motif/athena/neXtaw/photon/carbon
--enable-hangulinput Include Hangul input support.
--enable-luainterp=OPTS Include Lua interpreter. default=no OPTS=no/yes/dynamic
--enable-motif-check If auto-select GUI, check for Motif default=yes
--enable-multibyte Include multibyte editing support.
--enable-mzschemeinterp Include MzScheme interpreter.
--enable-nextaw-check If auto-select GUI, check for neXtaw default=yes
--enable-perlinterp=OPTS Include Perl interpreter. default=no OPTS=no/yes/dynamic
--enable-python3interp=OPTS Include Python3 interpreter. default=no OPTS=no/yes/dynamic
--enable-pythoninterp=OPTS Include Python interpreter. default=no OPTS=no/yes/dynamic
--enable-rubyinterp=OPTS Include Ruby interpreter. default=no OPTS=no/yes/dynamic
--enable-sniff Include Sniff interface.
--enable-tclinterp Include Tcl interpreter.
--enable-workshop Include Sun Visual Workshop support.
--enable-xim Include XIM input support.
--with-compiledby=NAME name to show in :version message
--with-developer-dir=PATH use PATH as location for Xcode developer tools
--with-ex-name=NAME what to call the Ex executable
--with-features=TYPE tiny, small, normal, big or huge (default: normal)
--with-global-runtime=DIR global runtime directory in 'runtimepath'
--with-gnome Specify prefix for GNOME files
--with-gnome-includes=DIR Specify location of GNOME headers
--with-gnome-libs=DIR Specify location of GNOME libs
--with-local-dir=PATH search PATH instead of /usr/local for local libraries.
--with-lua-prefix=PFX Prefix where Lua is installed.
--with-luajit Link with LuaJIT instead of Lua.
--with-mac-arch=ARCH current, intel, ppc or both
--with-modified-by=NAME name of who modified a release version
--with-motif-lib=STRING Library for Motif
--with-plthome=PLTHOME Use PLTHOME.
--with-python-config-dir=PATH Python's config directory
--with-python3-config-dir=PATH Python's config directory
--with-ruby-command=RUBY name of the Ruby command (default: ruby)
--with-tclsh=PATH which tclsh to use (default: tclsh8.0)
--with-tlib=library terminal library to be used
--with-view-name=NAME what to call the View executable
--with-vim-name=NAME what to call the Vim executable
--with-x use the X Window System
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--without-local-dir do not search /usr/local for local libraries.
如果您使用官方vim源的分支,您的发行版可能有不同的选项。运行configure --help
应该列出它们,而不要求你去挖掘源代码。
至于为什么这些并非全部默认启用,可能是因为它们被认为对每个人都不够广泛(或者它们需要默认情况下可用的支持库)。对于vim的维护者来说真是个问题,而不是SO。
答案 1 :(得分:1)
要构建功能齐全的Vim,您必须:
./configure
步骤检查这些库,例如,如果您没有安装Gnome库,则跳过Gnome UI)--with-features=huge
;请注意,huge
和big
之间的唯一区别是分析支持--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp
等您可以通过:version
输出验证结果功能集。
如果您只是等待稍后Vim版本中引入的功能,则可以更轻松地等待包管理器提供的官方Vim包的更新。
答案 2 :(得分:0)
如果你查看Vim的Google网上论坛邮件列表的档案,你会发现一个很长的线程,用剪贴板支持编译Vim(这是最近的)。
它并不像你想象的那么简单,但它并非不可克服......