Help us understand the problem. What is going on with this article?

WSL → Linuxbrew → fish → fisher → VSCode

More than 1 year has passed since last update.

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

http://linuxbrew.sh/

$ 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

https://github.com/jorgebucaran/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"をインストールします。

https://github.com/powerline/fonts

# 任意の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で開発環境つくれるようになって嬉しい

noanoamn
ゲームが趣味で色々やってます。 気になったことを書いていきます。
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした