Lvim(Version: 1.2)环境搭建

发布时间 2023-04-05 16:24:14作者: 迦洛德影歌

LunarVim开发环境搭建官方网站

Prerequisites (Ubuntu 20.04.4)

  • Neovim
wget https://github.com/neovim/neovim/releases/download/stable/nvim-linux64.tar.gz
  • git
    设置全局加速
git config --global url."https://gitclone.com/".insteadOf https://
  • make
  • python
  • pip
sudo apt install python3-pip
mkdir ~/.pip
vim ~/.pip/pip.conf

添加如下内容

[global]
index-url = http://pypi.douban.com/simple/
[install]
trusted-host = pypi.douban.com

更新pip3

sudo pip3 install --upgrade pip
  • node
curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
node --version

npm 加速

npm config set registry https://registry.npmmirror.com
npm config get registry

如果返回https://registry.npmmirror.com,说明镜像配置成功。

  • rust
    更改rust源,创建配置文件
mkdir ~/.cargo
vi ~/.cargo/config

添加文件内容

[source.crates-io]
replace-with = 'rsproxy'

[source.rsproxy]
registry = "https://rsproxy.cn/crates.io-index"

[registries.rsproxy]
index = "https://rsproxy.cn/crates.io-index"

[net]
git-fetch-with-cli = true

执行安装脚本

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"

安装Lvim

LV_BRANCH='release-1.2/neovim-0.8' bash <(curl -s https://raw.githubusercontent.com/lunarvim/lunarvim/fc6873809934917b470bff1b072171879899a36b/utils/installer/install.sh)

解决报错

[WARN]: skipping installing optional nodejs dependencies due to insufficient permissions.
check how to solve it: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally

解决办法

mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH
source ~/.profile
npm install -g jshint