- window 11
- 开启
适用与 Linx 的 Windows 子系统
- 到微软商店下载
Ubuntu
系统 - 这里我使用的是
WSL1
,wsl --set-default-version <Version>
echo $SHELL
cat /etc/shells
sudo apt install zsh
chsh -s /bin/zsh
git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
GitHub
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
Gitee
git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
在 ~/.zshrc
中添加
ZSH_THEME="powerlevel10k/powerlevel10k"
使配置生效。
source ~/.zshrc
p10k configure
安装插件后要使用
source .zshrc
使配置生效
-
git
显示 git 的一些功能,默认已经安装
plugins=(git)
-
z
跳转目录,直接在 plugins 里面添加 z
plugins=( git z)
-
sudo
偶尔输入某个命令,提示没有权限,需要加sudo,这个时候按两下ESC,就会在命令行头部加上 sudo 默认已经安装
plugins=( git sudo z)
-
zsh-autosuggestions
会记录你之前输入过的所有命令,并且自动匹配你可能想要输入命令,然后按 Tab 补全
https://github.com/zsh-users/zsh-autosuggestions/blob/master/INSTALL.md#oh-my-zsh
克隆仓库
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
添加配置
plugins=( git sudo z zsh-autosuggestions)
-
zsh-syntax-highlighting
直接在输入过程中就会提示你,当前命令是否正确,错误红色,正确绿色
https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/INSTALL.md#oh-my-zsh
克隆仓库
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
添加配置
plugins=( git sudo z zsh-autosuggestions zsh-syntax-highlighting)
sudo apt install npm
sudo npm i n -g
sudo n lts
也可以使用
npm
直接安装,我这样安装是为了webstorm
可以更好的找到路径
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn
类似于
cnpm
,个人感觉比cnpm
好用
sudo npm i tyarn -g
yarn config set -- --emoji true