macOSパワーユーザー向けセットアップ
MacをLinuxと同じくらい素早く操作・作業できるように設定しました。主に使ったのは次のものです。
- Karabiner Elements (詳しくは こちら)
- Raycast
- Rectangle
いちばんシンプルなのはRectangleで、単なるウィンドウマネージャーです。使うのはほぼ、ウィンドウをフルスクリーンにして中央に配置するためのleft_option + left_control + enterだけです。
ここで重要なのは、macOSのデスクトップや標準のフルスクリーン機能を絶対に使わないことです。使うとアプリ間の移動が大幅に遅くなります。アプリはフルスクリーンにして、cmd + tabとRaycastを開くショートカットで切り替えましょう。
次の重要な要素はKarabiner Elementsです。これを使ってCaps Lockをhyper keyにしています。単押しではescape、ほかのキーと同時に押すとcontrol + option + shift + commandとして動作するようにバインドしています。特にRaycastと組み合わせると、操作や作業でとてつもなく強力です。
Raycastはhyper + space(実際にはcaps lock + space)にバインドしています。Raycastでextensionsを検索してからアプリケーションを検索すると、そのアプリのキーバインドを設定できます。自分のものはすべてhyper + 任意のキーです。全部こちらで見られます。
超簡単な設定
Macを設定したとき、tmux、Ghostty、Cursor向けにかなりいろいろカスタマイズしました。どの設定ファイルも読まず、OpenCode用のちょっとしたコマンドを作って、AIに設定を書かせただけです。複雑ではありませんが、参考に自分の設定が欲しければ:
Ghostty
~/.opencode/command/ghostty.md
---
description: Help make changes to my terminal emulator
agent: build
---
Run "ghostty +show-config --default --docs" to see the full guide on how to configure my terminal emulator Ghostty. In this session I want you to help me get it configured. When I tell you to make a change, reference the docs on how to do it, and then write the changes to: "~/Library/Application Support/com.mitchellh.ghostty/config"Cursor
~/.opencode/command/cursor.md
---
description: Help fine tune my Cursor keybindings
agent: build
---
My Cursor (VSCode) keybindings are located at: "~/Library/Application Support/Cursor/User/keybindings.json". In this session your job is to help me fine tune them.tmux
~/.opencode/command/tmux.md
---
description: Help fine tune tmux config
agent: build
---
My tmux config is located at: ~/.tmux.conf Your job is to make the changes I describe to that config file. Every time you make a change, make sure to end by giving me the command I need to restart my current tmux instance and use the changes immediatelyこれらを配置してルートディレクトリでOpenCodeを起動すれば、/tmux でtmuxの設定をカスタマイズできます。新たな設定方法をあれこれ考える必要はありません。