前言
最新版 win10 已經加入了 linux 子系統功能,嘗試後一週的開發後,個人感覺已經完全可以取代 macos 了,linux 環境下終端工具易用性、環境穩定性與 win10 的海量的軟件相結合,再看看 PC 電腦的選擇寬泛性,簡直不要太贊,是時候放棄osx 選用 win10 作爲 web 開發者生產力工具平臺了。
參考
windows 10 linux子系統oh-my-zsh與Cmder配置-2018
打開 win10 linux 功能
步驟1:打開程序與功能
步驟2:勾選 linux 功能並確定
安裝 linux 發行版
- 打開 win10 應用商店
- 搜索 linux 關鍵字
- 安裝 ubuntu18
- 打開 ubuntu18 應用圖標
- powershell 管理員模式啓用功能
- 再次打開 ubuntu 等待幾分鐘的安裝
ubuntu 切換爲 Ali 源
\cp -f /etc/apt/sources.list /etc/apt/sources.list_bak_`date +"%Y_%m_%d_%H_%M_%S"`;
echo 'deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse' >/etc/apt/sources.list;
apt-get update
apt-get upgrade
安裝 nodejs
sudo su
apt update
apt install nodejs
node -v
apt install npm
npm i -g n
n lts
安裝 zsh
sudo apt-get install zsh
安裝 oh-my-zsh
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
修改 zsh 主題
vim ~/.zshrc
ZSH_THEME="agnoster"
啓動 bash 默認進入 zsh
vim ~/.bashrc
if test -t 1; then
exec zsh
fi
終端字體補全
sudo apt-get install fonts-powerline
VSCode 配置
{
"workbench.iconTheme": "vscode-icons",
"terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\bash.exe",
"terminal.external.windowsExec": "C:\\\\Windows\\\\sysnative\\\\bash.exe",
"files.autoSave": "onFocusChange",
"files.exclude": {
"._*": true
}
}
PS: 後續再把相關的圖補上,上面的教程已經滿足入門嘗試了。