LoginSignup
10
15

More than 5 years have passed since last update.

WSL → Linuxbrew → fish → fisher → VSCode

Last updated at Posted at 2019-02-25

https://brew.sh/2019/02/02/homebrew-2.0.0/

LinuxbrewがWSLで正式サポートYATTA! YATTA!

ということでWSLの開発環境構築をリニューアルするいい機会なので備忘をば。

最終目標はVSCodeのターミナルでWSL::fishでニンマリ。です。

WSL

Windows Subsystem for Linux Installation Guide for Windows 10

上記手順でUbuntuをインストール後パッケージをアップデート

$ sudo apt update
$ sudo apt upgrade

Linuxbrew

$ sudo apt-get install build-essential curl file git
$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
$ echo 'eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)' >> ~/.profile
$ . ~/.profile

brew doctorを実行してWarningを指示内容に従って解決

$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don\'t worry or file an issue; just ignore this. Thanks!

Warning: The following directories do not exist:
/home/linuxbrew/.linuxbrew/var/homebrew/linked

You should create these directories and change their ownership to your account.
  sudo mkdir -p /home/linuxbrew/.linuxbrew/var/homebrew/linked
  sudo chown -R $(whoami) /home/linuxbrew/.linuxbrew/var/homebrew/linked

Warning: umask is currently set to 000. Directories created by Homebrew cannot
be world-writable. This issue can be resolved by adding umask 002 to
your ~/.bash_profile
  echo 'umask 002' >> ~/.bash_profile

$ sudo mkdir -p /home/linuxbrew/.linuxbrew/var/homebrew/linked
$ sudo chown -R $(whoami) /home/linuxbrew/.linuxbrew/var/homebrew/linked
$ echo 'umask 002' >> ~/.bash_profile
$ . ~/.bash_profile
$ brew doctor
Your system is ready to brew.

fish

Friendly interactive shell

デフォルトが最高すぎるShell、ものぐさなワタシにピッタリ。

$ brew install fish
$ sudo sh -c "echo /home/linuxbrew/.linuxbrew/bin/fish >> /etc/shells"
$ chsh -s /home/linuxbrew/.linuxbrew/bin/fish

ターミナルを再起動し、LinuxbrewのPathを通します。

$ echo 'eval (/home/linuxbrew/.linuxbrew/bin/brew shellenv)' >> ~/.config/fish/config.fish
$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don\'t worry or file an issue; just ignore this. Thanks!

Warning: umask is currently set to 000. Directories created by Homebrew cannot
be world-writable. This issue can be resolved by adding umask 002 to
your ~/.config/fish/config.fish
  echo 'umask 002' >> ~/.config/fish/config.fish

$ echo 'umask 002' >> ~/.config/fish/config.fish
$ . ~/.config/fish/config.fish
$ brew doctor
Your system is ready to brew.

fisher

fishのplugin管理ツールです。今回はfishにPowerline-styleを導入します。

$ curl https://git.io/fisher --create-dirs -sLo ~/.config/fish/functions/fisher.fish

ターミナルを再起動し、テーマをインストール。

$ fisher add oh-my-fish/theme-agnoster

VSCode

VSCodeはインストールしてある前提です。

ターミナル用に"Source Code Pro for Powerline"をインストールします。

# 任意のwindowsのディレクトリにgit clone
$ git clone https://github.com/powerline/fonts

エクスプローラでfonts/SourceCodeProを開き、Source Code Pro for Powerline.otfをインストール

VSCodeのsettngs.jsonに以下を記述

settings.json
{
  "terminal.integrated.shell.windows": "C:/WINDOWS/system32/wsl.exe",
  "terminal.integrated.fontFamily": "'Source Code Pro for Powerline'",
}

VSCodeのターミナルを再起動して完了です。
image.png

Linuxbrewで開発環境つくれるようになって嬉しい

10
15
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
15