Skip to content

makoto-developer/pc-setup

Repository files navigation

macOS開発環境構築

iterm2をインストール

ここ↓からitem2をインストール

https://iterm2.com/

※macOS純正のterminalを使っても良いが、brewがうまく機能しない場合があるのでiterm2を使ったほうがよい。

brewをインストール

ここ↓からbrewをインストールする

https://brew.sh/

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

作業ディレクトリを作成しておく

mkdir -p ~/work/github ~/work/gitlab ~/opt

brewで必要なツールをインストール

必須ツール

brew install --cask google-chrome
brew install --cask google-japanese-ime

makoto-developerが入れているツール

GUIアプリ

caskでインストール可能なappの一覧はこちら -> https://github.com/Homebrew/homebrew-cask/tree/master/Casks

brew install --cask warp
brew install --cask clipy
brew install --cask alt-tab
brew install --cask rectangle
brew install --cask karabiner-elements
brew install --cask jetbrains-toolbox
brew install --cask visual-studio-code
brew install --cask chromium
brew install --cask notion
brew install --cask discord
brew install --cask slack
brew install --cask openlens

# 開発が終了したのでインストールしないでください
~~brew install --cask bloomrpc~~
brew install --cask postman

必要であれば入れる

# デザイン
brew install --cask itsycal
brew install --cask figma

# Amazon
brew install --cask kindle

# online meeting
brew install --cask skype
brew install --cask zoom

# Network
brew install --cask wireshark

# office
brew install --cask microsoft-excel
brew install --cask microsoft-office
brew install --cask microsoft-openjdk
brew install --cask microsoft-outlook
brew install --cask microsoft-powerpoint
brew install --cask microsoft-remote-desktop
brew install --cask microsoft-teams
brew install --cask microsoft-word
brew install --cask android-file-transfer

その他

# other
brew install ghq
brew install fzf
brew install peco
brew install tig
brew install bat
brew install exa
brew install jupyterlab

common lisp

brew install roswell

transrate

brew install --cask deepl

aws

# cask-drivers
brew tap homebrew/cask-drivers
brew install localstack
brew install aws-cdk
brew install saml2aws
brew install awscli
brew install --cask dynamodb-local
brew install --cask aws-vault
brew install kube-aws
brew install aws-apigateway-importer
brew install aws-auth
brew install aws-cfn-tools
brew install aws-console
brew install aws-elasticbeanstalk
brew install aws-es-proxy
brew install aws-google-auth
brew install aws-iam-authenticator
brew install aws-keychain
brew install aws-nuke
brew install aws-okta
brew install aws-rotate-key
brew install aws-sdk-cpp
brew install aws-shell
brew install aws-sso-util
brew install aws-vault
brew install aws2-wrap
brew install awscli@1
brew install awscurl
brew install awslogs
brew install awsume

mas(Apple Store上のアプリをコマンドラインからインストールできる) おすすめしていません 普通にApple Storeからインストールした方がいいです。

# mas-cliをインストール
brew install mas
# インストール済み
mas list
# 探す
mas search <search app name>
# install
mas install <app id>
mas install 539883307 # LINE

Apple Storeからインストール

Line App
XCode

Google Driveを入れる

インターネットでGoogle Drive macOSで検索してインストール。同期してバックアップファイルを取得する。

セキュリティソフトを入れる

入れても、入れなくてもどっちでもいいが。念の為入れておく。

カスペルスキー(会社で指定されていなかったら入れておく)

開発用のフォントをインストール

こちら↓を参照

https://github.com/yuru7/HackGen

brew tap homebrew/cask-fonts
brew install font-hackgen  font-hackgen-nerd

power fontをインストール(preztoのテーマの設定で必要になるの今のうちに入れる)

  1. 公式↓を参考にインストール

https://github.com/powerline/fonts

git clone https://github.com/powerline/fonts.git --depth=1

cd fonts
./install.sh

cd ..
rm -rf fonts
  1. poworline-shellをインストール

https://github.com/b-ryan/powerline-shell

[!TIP] asdf install python 3.9.18でインストールしたのち、python setup.py installを実行。 macos m1だpython v2系がなくなったので手順書通りやってもできない可能性が高い。

Gitのバージョンを上げる

こちら↓を参考に

https://qiita.com/normalsalt/items/f200ba50363ebfd46df0

brew install git

sshを設定

$ cd ~
$ mkdir .ssh
$ cd $_
$ ssh-keygen -t ed25519 -C "<<<your email>>>"

# Generating public/private ed25519 key pair.
# Enter file in which to save the key (/Users/user/.ssh/id_ed25519): id_github <<<githubを例に。ドメインごとにsshkeyを作成する。流用しない。>>>
# Enter passphrase (empty for no passphrase): <<<パスフレーズを設定(Githubでは設定することを推奨している)>>>
# Enter same passphrase again: <<<パスフレーズを設定(Githubでは設定することを推奨している)>>>
# Your identification has been saved in id_github
# Your public key has been saved in id_github.pub
# The key fingerprint is:
# The key's randomart image is:
# +--[ED25519 256]--+
# |                 |
# |                 |
# |                 |
# |                 |
# |                 |
# |                 |
# |             ..  |
# +----[SHA256]-----+

# コピーしてsshキーをgithubに登録
pbcopy < ~/.ssh/id_github.pub
# ssh configを設定
touch ~/.ssh/config

vi ~/.ssh/config
# 中身は↓のように
Host github.com
  HostName github.com
  User <<<your name>>>
  Port 22
  IdentityFile ~/.ssh/id_github
  IdentitiesOnly yes

# 疎通確認
ssh -T [email protected]

# パスフレーズの入力を省略
ssh-add -K ~/.ssh/id_github

# 登録できたか確認
ssh-add -l

dotfilesを取得して、READMEに従って設定する

git clone [email protected]:makoto-developer/dotfiles.git

# README.mdをみて設定をする

iterm

itermのprofileから↓のパスの設定ファイルをimportする

~/dotfiles/iterm/

cmd + enterで最大化しないようにする

Keys -> Key Bindings -> +ボタン -> 'CMD + ENTER' is disabled`

itermのフォントをpowerlineのフォントに変更しておく

itermを開いて profiles -> text -> font -> 「power」がつくフォントを選ぶ

キーボード設定

image

キーリピート設定変更

入力速度を速くする

defaults write -g InitialKeyRepeat -int 11
defaults write -g KeyRepeat -int 1
# 緊急時、元に戻すコマンド
defaults delete -g InitialKeyRepeat
defaults delete -g KeyRepeat

Fish shell

参考: https://zenn.dev/sawao/articles/0b40e80d151d6a

brew install fish

# fishを追加
sudo vi /etc/shells
# 最後に追加 /usr/local/bin/fish

# デフォルトのシェルを変更
chsh -s /usr/local/bin/fish

# fish shell configを作成
rm ~/.config/fish/config.fish
ln -s ~/dotfiles/fish/config.fish ~/.config/fish/
ln -s ~/dotfiles/fish/init.fish ~/.config/fish/
ln -s ~/dotfiles/fish/conf.d/  ~/.config/fish/


# パッケージマネージャー(fisher)
curl https://git.io/fisher --create-dirs -sLo ~/.config/fish/functions/fisher.fish

# 文字化け対策
fisher install oh-my-fish/theme-bobthefish


# oh-my-fishをインストール
curl https://raw.githubusercontent.com/oh-my-fish/oh-my-fish/master/bin/install | fish

# oh-my-fishのプラグインをインストール
omf install agnoster
omf theme agnoster
ln -s ~/dotfiles/fish/init.fish ~/.config/omf/

バージョン管理ツール

こちら↓を参照しながらインストールする。

https://asdf-vm.com/#/core-manage-asdf

brew install asdf

asdfのパスを通す config.fishに取り込まれているはず

. $(brew --prefix asdf)/asdf.sh
. $(brew --prefix asdf)/libexec/asdf.sh

プラグインを入れる(使いそうにないやつは削除)

asdf plugin add haskell
asdf plugin add erlang
asdf plugin add elixir
asdf plugin add nodejs
asdf plugin add golang
asdf plugin add rust
asdf plugin add zig
asdf plugin add clojure
asdf plugin add julia
asdf plugin add terraform
asdf plugin add bun

install

cd ~
asdf install

動作確認

以下のコマンドが使えるかチェック

iex
erl
mix
node -v
go version
rustc

homerow

macOS上の画面に映るあらゆるオブジェクトを選択できるツール

https://www.homerow.app/

ショートカットをcmd + opt + ctrl + shift + ↓で設定している

chromeの拡張で入れているもの

  • Octotree GitHub code tree (githubにtree形式でフォルダ構造がみえるようにする)
  • Vimium (vimライクにchromeの移動が可能)
  • ColorPick Eyedropper (画面のドットの色を抽出)
  • Fonts Ninja (画面で見えているフォントを調べる)
  • ブックマーク検索 (ブックマークを検索する)

Chromeのブックマーク検索を楽にする

ツールを入れなくても検索可能。

cmd + lでアドレスバーに移動、@ブックマーク <検索したい文字>で検索できる

ちなみにタブを検索することも可能@タブ <検索したい文字>

@タブ@ブックマークなど日本語から英語@tabs, @bookmarkにしたい場合は英語版のChromeを入れると可能、らしい(試してない)。

そんなことしなくても、Chromeの拡張機能Vimiumを入れればoまたはbを押すだけでブックマークやヒストリーを検索することが可能。実務ではほぼこれに頼っている。

docker + lima環境構築 Rancher DeskTopを入れる

まずはdockerを入れる

brew install docker docker-compose

Rancher DeskTopがあるので現在はこちらを使っている

brew install --cask rancher

(.docker_lima.md に過去の手順を残した)

個人開発では普通にDocker Desktopで問題ない

brew install --cask docker

macOS Systemの設定

  • 言語を英語(US)に変更する(日本語モードにするとctrl + spaceで検索がやりにくい。エンジニアなら英語に慣れろ)
  • 端末の名前を変更する
  • ファイヤーウォールをONにする
  • Caps Lockをctrlに変更する
  • 時間
    • 秒を表示する
    • 24時間表示にする
  • メニューバーにバッテリーの残量を表示する
  • メニューバーにボリュームを表示する
  • メニューバーからSpotlightとsiriを削除する
  • siriは無効化する
  • Mission Controlにある使わないアプリはひとつにまとめてどける
  • Dock
    • Dockを自動で表示する
    • 不要なアプリをDockから削除する
    • 最近使ったアプリを表示しない
    • 位置を左側に変更する
    • スケールエフェクトでウィンドウをしまう
  • Finder
    • 左ナビバーにホームディレクトリを追加
    • Air Dropを削除
    • 不要なディレクトリを削除
    • 拡張子を表示する
    • 隠しファイル/ディレクトリを表示する(cmd + shift + .)
  • ホットコーナーを無効化する
  • spotlight
    • アプリケーションとシステム環境設定以外はすべて無効化
    • ショートカットをctrl + spaceに変更
  • キーボード
    • 数字の全角入力をオフにする
    • シングルクォーテーション、ダブルクオーテーションの自動変換をオフにする
    • スペルの自動変換をオフにする
  • スクリーンショットの保存先を変更する
    • cmd + shift + 5でスクリーンショットを出す。オプションを選択して「フローティングサムネールを表示」をクリックしてオフにする

↑全部コマンドで変えることができる。が、一般的な方法でないためテキストで何を変えたかだけ記載する

macos_setting_disable_animation.mdを参照

gqh

gqhはローカルにあるリポジトリを探すツール

brew install ghq
git config --global ghq.root '~/work/'
brew install fzf

dotfilesリポジトリでシンボリックリンクを貼り付けたので↓の作業は不要。

vi ~/.config/fish/conf.d/ghq.fishでファイルを作成して↓を貼り付ける。

function ghq_fzf_repo -d 'Repository search'
  ghq list --full-path | fzf --reverse --height=100% | read select
  [ -n "$select" ]; and cd "$select"
  echo " $select "
  commandline -f repaint
end

# fish key bindings
function fish_user_key_bindings
  bind \cg ghq_fzf_repo
end


function ghq_fzf_repo -d 'Repository search'
  ghq list --full-path | fzf --reverse --height=100% | read select
  [ -n "$select" ]; and cd "$select"
  echo " $select "
  commandline -f repaint
end

# fish key bindings
function fish_user_key_bindings
  bind \cg ghq_fzf_repo
end

About

macOSの環境構築

Resources

Stars

Watchers

Forks