幸福なプログラマ

プログラマは幸福になれる。

iterm2インストールからfish導入まで

mac新調したのでターミナル環境を一から構築してみた備忘録です。

  1. iterm2インストール
  2. hot key設定
    • Controlダブルタップで起動するように設定
      f:id:javabayashi:20191224183512p:plain
      Preferences->Keys->Hotkey->Create a Dedicated Hotkey Window...
      f:id:javabayashi:20191224183922p:plain
      Double-tap key: ^Control->OK
    • Mojave だとこのままでは有効にならない
      • システム環境設定->セキュリティとプライバシー->プライバシー->アクセシビリティからiterm2を許可する
  3. fishインストール
    • brew install fish
  4. fish有効化
    • sudo vi /etc/shells
    • chsh -s /usr/local/bin/fish
  5. prompt変更
    • fish_configで設定画面表示
    • promptタブで minimalist を選択して Set Promot ボタン押す
  6. パッケージマネージャ(fisher)インストール
    • curl https://git.io/fisher --create-dirs -sLo ~/.config/fish/functions/fisher.fish
  7. プラグイン追加
    1. bobthefish
      • $ fisher add oh-my-fish/theme-bobthefish
      • フォント導入
        • git clone https://github.com/powerline/fonts.git
        • cd fonts -> ./install.sh
        • Preferences->Profiles->Hotkey Window->Text->Font でRoboto Mono for Powerline を選択
        • cloneしたリポジトリは不要なので削除
      • Draculaテーマインストール
        • git clone https://github.com/dracula/iterm.git
        • cd iterm
        • open ./iterm/Dracula.itermcolors
        • Preferences->Profiles->Colors->Color Presets からDraculaを選択
        • cloneしたリポジトリは不要なので削除
    2. peco
      • brew install peco
      • fisher add oh-my-fish/plugin-peco
        • 上記コマンドでエラーが出る場合は fisher omf/plugin-peco を試す
      • vi ~/.config/fish/config.fish
function fish_user_key_bindings
  bind \cr 'peco_select_history (commandline -b)'
end
    * control + r でコマンド履歴検索できる