Local install vim in server without root

编译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-vimicon-default.png?t=N7T8https://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的版本

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值