初始化WSL 2 + nodejs

发行版:Ubuntu 20.04

系统更新

# cat EOF 用法:https://blog.csdn.net/lym152898/article/details/83306993

mv /etc/apt/sources.list /etc/apt/sources.list.bak

sudo su
cat > /etc/apt/sources.list <<EOF
# 中科大 @see https://www.cnblogs.com/leeyazhou/p/12976814.html
deb https://mirrors.ustc.edu.cn/ubuntu/ focal main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ focal-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
EOF

exit

sudo apt update
sudo apt upgrade

编译安装vim

安装zsh

sudo apt install zsh

安装nvm&node

https://github.com/nvm-sh/nvm

下载install.sh,然后执行: bash install.sh

安装vim套件

mkdir Applications && cd Applications

git clone git@git.zhlh6.cn:vim/vim.git  # github加速插件提供的加速地址
git clone git@github.com:ilaipi/k-vim.git
git clone git@github.com:ilaipi/k-tmux.git

https://github.com/ohmyzsh/ohmyzsh/tree/master/tools
# 先下载 install.sh 然后执行
sh -c install.sh

git clone git@git.zhlh6.cn:ilaipi/dotfiles.git
cd dotfiles && sh -x intall.sh

git clone git@git.zhlh6.cn:tmux/tmux.git
# install tmux @see https://github.com/tmux/tmux

sudo apt install automake
sudo apt install build-essential
sudo apt-get install pkg-config
sudo apt install libevent-dev
sudo apt-get install ncurses-dev
sudo apt install bison

# install k-vim
# after install k-vim, need compile YouCompleteMe
cd ~/.vim/bundle/YouCompleteMe
python3 install.py --clang-completer --clangd-completer --ts-completer

# install k-tmux
clone and install (ln -s)
ln -sf tmux.conf ~/.tmux.conf

# install tmux tpm
# 需要先clone下来tpm包管理器才能安装其它插件
git clone git@git.zhlh6.cn:tmux-plugins/tpm.git ~/.tmux/plugins/tpm

Leave a Reply

Your email address will not be published. Required fields are marked *