在Ubuntu上安装最新的neovim(with LinuxBrew)


tags: Ubuntu Server Tips Vim

写在前面

之前一直是在mac上写程序的, 后来有了阿里云服务器, 想把环境都部署到服务器上, (毕竟架构是x86_64, 适配性好), 首先是编辑器, 习惯了nvim, 当然要整上, 直接apt Install neovim发现安装的竟然是0.4版本, 太低了…

后来看Reddit, 大家都在推荐一款包管理器LinuxBrew, 虽然也有说路径混乱等问题的, 但是毕竟在MacOS上成功实践过, 那么就先来安一下这款包管理器吧.

安装LinuxBrew

安装倒是不费事, 一行命令:(导入镜像快一些, 随后这三条应该加入到.bashrc中)

export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles"

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

不过由于homebrew官方的Ruby更新了, 运行科大的镜像时候就会出现404, 我直接从本地下载了一份2.6.8_1版本, 然后sftp到服务器了. 然后执行安装即可.

安装中可能会出现一些小插曲:

fatal: unable to access ‘https://github.com/Homebrew/brew/’: GnuTLS recv error (-110): The TLS connection was non-properly terminated.

这里的修复莫名其妙, 好像重试一次就可以了… 参考12. (2太过复杂,没有用)

最后就是配置环境变量:

echo '# Set PATH, MANPATH, etc., for Homebrew.' >> /home/test/.bash_profile
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/test/.bash_profile
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"

镜像:

echo '# Set PATH, MANPATH, etc., for Homebrew.' >> /home/test/.bash_profile
echo 'export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git"' >> /home/test/.bash_profile
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git"

安装nvim

brew update
brew install neovim

可以看到安装的nvim就是最新版(0.8):

brew info nvim
==> neovim: stable 0.8.1 (bottled), HEAD
Ambitious Vim-fork focused on extensibility and agility
https://neovim.io/
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.8.1 (1,674 files, 26.7MB) *
  Poured from bottle on 2022-12-04 at 14:08:19

配置

这里可以参考我之前的文章, 参考了大佬的配置方法, 加了自己的改动.

ref


  1. ubuntu - How to fix git error: RPC failed; curl 56 GnuTLS - Stack Overflow; ↩︎

  2. [Solution] Gnutls_handshake() Failed GIT Repository - AWS Codecommit (devopscube.com); ↩︎ ↩︎

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

zorchp

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值