使用选项重新编译 VIM

bde*_*vic 16 vim compile installation

我安装了 VIM,但我需要使用特定选项编译它:

In addition to the most commonly used features, the plugin
       requires: +python or +python3, +clientserver and +conceal.
Run Code Online (Sandbox Code Playgroud)

在不破坏任何内容的情况下卸载和使用这些选项重新编译的步骤是什么?

bde*_*vic 17

编译 vim 时,您可以传递 option/flag --with-features,例如:

--with-features=huge
Run Code Online (Sandbox Code Playgroud)

这将确定安装中包含哪些功能。可以在此处 ( http://vimdoc.sourceforge.net/htmldoc/various.html )找到所有功能的列表,其中有一个字母表示该功能包含在哪个版本中:

Here is an overview of the features.
            The first column shows the smallest version in which
            they are included:
               T    tiny
               S    small
               N    normal
               B    big
               H    huge
               m    manually enabled or depends on other features
             (none) system dependent
            Thus if a feature is marked with "N", it is included
            in the normal, big and huge versions of Vim.
Run Code Online (Sandbox Code Playgroud)

例如,如果您想要阿拉伯语功能,则必须具有 --with-features=big

                            *+feature-list*

   *+ARP*       Amiga only: ARP support included

B  *+arabic*        |Arabic| language support

N  *+autocmd*       |:autocmd|, automatic commands

... etc
Run Code Online (Sandbox Code Playgroud)


Ing*_*kat 15

首先,您需要获取源代码,最简单的方法是通过 Vim 的Mercurial存储库;有关详细信息,请参阅vim.org

然后,您需要一个构建环境和开发库,尤其是对于所需的 Python。这在很大程度上取决于平台。在 Ubuntu / Debian 上,这很简单

$ sudo apt-get build-dep vim-gnome
Run Code Online (Sandbox Code Playgroud)

互联网搜索会告诉你更多。

要使用这些功能进行编译,您可以将它们传递给

$ ./configure --enable-pythoninterp --enable-python3interp
Run Code Online (Sandbox Code Playgroud)

密切观察其检测输出。

最后,您可以编译和安装:

$ make
$ sudo make install
Run Code Online (Sandbox Code Playgroud)

这将(在 Linux 上)将 Vim 安装到/usr/local/bin/vim,因此它不会干扰默认的/usr/bin/vim,并且您不需要卸载任何东西;只要确保前者在您的PATH.

  • 默认情况下,启用“大多数”功能(如果有开发库)。可以肯定的是,您可以通过 `--with-features=huge` 来包含所有内容。 (2认同)
  • `vim-gnome` 和 `vim-gtk` 都打包了 Vim 和你需要的一切。 (2认同)