ubuntu搭建nvim开发环境准备工作

以下代码,仅供方便复制使用的。想了解细节,可以参考:
《windows10安装子系统Ubuntu 20.04》
https://blog.csdn.net/lxyoucan/article/details/119893763

#使用国内的源
cp /etc/apt/sources.list /etc/apt/sources.list_bak
sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
apt-get update
# oh my zsh
apt-get install -y zsh curl git
chsh -s /usr/bin/zsh
# 国内加速oh my zsh ITKEY个性化配置版
bash -c "$(curl -fsSL https://gitee.com/lxyoucan/tools/raw/master/common/ohmyzsh_itkey.sh)"
zsh
# 配置中文环境
apt install -y language-pack-zh-hans
locale-gen
echo 'export LANG="zh_CN.UTF-8"' >> ~/.zshrc
source ~/.zshrc
# 安装nvim 0.5.1
apt-get install -y wget
##下载
wget https://hub.fastgit.org/neovim/neovim/releases/download/v0.5.1/nvim-linux64.tar.gz
##解压
tar -xvf nvim-linux64.tar.gz
mv nvim-linux64 /usr/local/
##创建软链接
ln -s /usr/local/nvim-linux64/bin/nvim /bin/nvim
## 安装ranger
sudo apt-get -y install python3-pip
mkdir ~/.pip
echo '[global]' >> ~/.pip/pip.conf
echo 'index-url = https://mirrors.aliyun.com/pypi/simple' >> ~/.pip/pip.conf
pip3 install ranger-fm
#安装python3支持的neovim
pip3 install --user --upgrade pynvim
#安装neovim配置
sudo apt install -y unzip
mkdir -p ~/.config
cd ~/.config
git clone https://hub.fastgit.org/lxyoucan/nvim.git
# 安装tree-sitter
wget https://hub.fastgit.org/tree-sitter/tree-sitter/releases/download/v0.20.1/tree-sitter-linux-x64.gz
gzip -d  tree-sitter-linux-x64.gz
mv tree-sitter-linux-x64 /bin/tree-sitter
chmod +x /bin/tree-sitter
#install node js 14
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt install nodejs
# 使用nrm工具切换淘宝源
npx nrm use taobao

命令行程序安装

typescript lsp

yarn global add typescript typescript-language-server

eslint lsp

npm i -g vscode-langservers-extracted

lua代码格式化

npm i -g lua-fmt

ripgrep

安装方法见:
https://github.com/chinanf-boy/ripgrep-zh

猜你喜欢

转载自blog.csdn.net/lxyoucan/article/details/121602812