LoginSignup
2
5

More than 5 years have passed since last update.

ずっと Windows ユーザだったフロントエンドの人が Mac へ移行する手順 CLI編

Posted at

ターミナル、シェルなど

Windows のとき

Mac

  • iTerm brew install Caskroom/cask/iterm2
  • fishshell brew install fish
    • 事前に zsh, oh-my-zsh など聞いてたんですが一方で重くなるとも言われいろいろあって、なぜか fish になった
    • ログインシェル変更はこのあたり
    • oh-my-fish も最初いれたが、パッケージマネージャ的なのは fisherman だけでよい(といっても万能でもない、後述)。
    • fisher omf/theme-bobthefish bobthefish というテーマ。テーマはいろいろある

テーマで足りないフォント出て来るはず。Powerline てやつ。
https://github.com/powerline/fonts.git
./install.sh でインストール。

開発環境もろもろ

Ruby, Python, Node.js, Go あたり。
Windowsだとバージョンマネージャみたいなのはなかったですね。
Node.js だけ nodist でバージョン変えたりしてました。

Mac では

brew install rbenv
brew install pyenv
brew install go

go は後述の ghq のために入れてる。
go はパス通す必要があるがbashとちょっと違う。
config.fish に下記

# golang path
set -x GOPATH $HOME/.go
set -x PATH $GOPATH/bin $PATH

rbenv,pyenv は fisherman で自動設定

fisher rbenv
fisher pyenv

バージョン選択後、グローバルでの指定などは適宜。

この流れで、インターフェース合わせて nodenv 入れたいところなんですが、残念 fishshell で動かないらしい。fisher には fnm なるものがあるそうでこちらに。
※ fnm については若干不安な運用

Git

Windows はずっとSourceTreeでした。だって楽だもの(その代わり重い)。
Mac デフォルトで入ってたんですが

brew install git

brew で入れ直す。

など基礎的なところを再度。SourceTree も入れておく。
リベース進行に必要な git-now, diff をいい感じに diff-so-fancy なども入れておく。

brew install git-now
brew install diff-so-fancy
.gitconfig
[alias]
  graph = log --decorate --graph --name-status --oneline
  diff = diff --color | diff-so-fancy

こんなの入れておいてる。

ghq

リポジトリへのアクセスやクローンを素早くできるようにする cli ツール。

go get github.com/motemen/ghq

デフォルトだと ~/.ghq が対象ディレクトリ。追加は .gitconfig へ。

.gitconfig
[ghq]
    root = ~/.ghq
    root = ~/project

peco を入れて

brew install peco
config.fish
function repo
    ghq list --full-path | peco | read dist
    cd $dist
end

repo で瞬時にリポジトリ選択できるようにしてる。

ここまで来てセットアップファイルがないことに気づく

これを使って、

こんな風に自動化。Brewfile はオワコンなんですかね。
セットアップファイル、ドットファイル、設定など一括化してどこかおいておきたい。

2
5
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
2
5