LoginSignup
9
12

More than 1 year has passed since last update.

M1 Mac 必要最低限の初期設定 (WEBエンジニア)

Last updated at Posted at 2021-11-17

はじめに

開発用にM1Macをお借りしたので、自分用に初期設定のメモです。

OS: MacBook Pro (13-inch, M1, 2020)

コンピュータ名の変更

システム環境設定 > 共有 > コンピュータ名 からコンピュータ名を変更します。
初期設定だと長いので短くします。

ファイルの拡張子を表示する

Finder > 環境設定 > 詳細 > すべてのファイル名拡張子を表示 にチェックする

Dockを自動的に非表示にする

システム環境設定 > Dockとメニューバー > Dockを自動的に表示/非表示にチェックする

インストール

Xocde

とりあえずApp StoreからXcodeをインストールします。

Homebrew

公式のサイトに行き、インストールコマンドをターミナルに入力します。

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

M1のMacだとインストールコマンドを入力した後、下記のコマンドを入力しないと動きません。
インストールコマンドを入力した後、次に入力するコマンドが表示されているのですが、見落としていて気づくまで時間がかかりました。

$ echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/コンピューター名/.zprofile
$ eval "$(/opt/homebrew/bin/brew shellenv)"

下記のコマンドが通ればOKです!

$ brew ls

Visual Studio Code(VSCode)のインストール

テキストエディタとしてVSCodeを使っているので、VSCodeをインストールします。

$ brew install --cask visual-studio-code

ターミナルから起動できるように下記の記事を参考に設定します。

よく使うアプリのインストール

homebrewを使ってよく使うアプリをインストールします。

$ brew install mysql
$ brew install awscli
$ brew install --cask iterm2
$ brew install --cask google-chrome
$ brew install --cask discord
$ brew install --cask clipy
$ brew install --cask slack
$ brew install --cask zoom
$ brew install --cask alfred
$ brew install --cask docker
$ brew install --cask sourcetree
$ brew install --cask appcleaner
$ brew install --cask mysqlworkbench
$ brew install --cask session-manager-plugin

Git Hub

Git Hubにssh接続して利用するため下記の記事を参考に設定します。その後、git cloneができるか確認します。

oh my zsh

何も考えずにzshをいい感じにしてくれるoh-my-zshをインストールします。

$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

oh-my-zshをインストールした後、便利なプラグインを使えるようにします。

$ code .zshrc

色々書かれてますが、pluginの箇所を下記に修正します。

.zshrc
plugins=(git z zsh-syntax-highlighting zsh-autosuggestions)

プラグインを下記の場所にgit cloneします

$ cd /Users/コンピューター名/.oh-my-zsh/plugins
$ git clone git@github.com:zsh-users/zsh-syntax-highlighting.git
$ git clone git@github.com:zsh-users/zsh-autosuggestions.git 

nodeのインストール

anyenvを使ってnodeをインストールします。

pythonのインストール

anyenvを使ってpythonをインストールします。

pecoのインストール

ターミナルで履歴等の検索を快適にしてくれるpecoをインストールします。

$ brew install peco

.zshrcの一番下に、下記を追加します。

.zshrc
# peco
function peco-select-history() {
    local tac
    if which tac > /dev/null; then
        tac="tac"
    else
        tac="tail -r"
    fi
    BUFFER=$(\history -n 1 | \
        eval $tac | \
        peco --query "$LBUFFER")
    CURSOR=$#BUFFER
    zle clear-screen
}
zle -N peco-select-history
bindkey '^r' peco-select-history

Ctr+r でpecoが起動できればOKです。

おまけ

App StoreからRun Catをインストールします。画面の上でねこが可愛く走り出します。

9
12
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
9
12