编译vim
1. 下载vim
git clone https://github.com/vim/vim.git
2. local install
cd <path_to_vim>
./configure --prefix=$HOME/usr/local #add any options you like
make
make install
如果有如下报错
no terminal library found
checking for tgetent()... configure: error: NOT FOUND!
You need to install a terminal library; for example ncurses.
Or specify the name of the library with --with-tlib.
参考:
https://askubuntu.com/questions/158344/no-terminal-library-found-when-compiling-vimhttps://askubuntu.com/questions/158344/no-terminal-library-found-when-compiling-vim在官网下载最新ncurses,之后运行下列命令重新install
mkdir ~/usr/local
cd <path_to_ncurses>
tar xzvf <ncurses>.tar.gz # change the tar command if it is not a tar.gz
cd <ncurses>
./configure --prefix=$HOME/usr/local
make
make install
cd <path_to_vim>
LDFLAGS=-L$HOME/usr/local/lib ./configure # then add any options e.g. --prefix=$HOME/usr/local
make
make install
3. vim设置alias指向local install的版本
alias vim="$HOME/local/bin/vim"
或者也可以通过添加$PATH的方法直接调用local install的版本