概要
- Karabiner-Elementsのインストール&設定(主にキーバインド)&アンインストールの方法について簡単にまとめてみました。
- 動作環境
- macOS Ventura 13.1
- Homebrew 3.6.16
- Karabiner-Elements 14.10.0
Karabiner-Elementsとは
macOSのキーボードをカスタマイズするためのツールで、キーバインド設定などができます。
インストール
公式サイトからダウンロードしてインストールすることも可能ですが、今回はHomebrewでインストールすることにします。
brew install --cask karabiner-elements
キーカスタマイズ
私自身がよく使う以下の3つのキーバインド設定を行います。個別のデバイスに対して設定することも可能ですが、今回は全てのデバイス(「For all devices」)に対して設定します。
- caps lock to ctrl
- ctrl + hjkl to Arrow Keys
- ctrl + [ to escape
caps lock to ctrl
caps lock
キーをctrl
キーに変えるための設定です。US配列のキーボードを使っていますが、JIS配列とは違ってctrlキーが左下にあるからです。
「Simple Modifications」の「Add item」をクリックします。
「Modifier keys」から「caps_lock」と「left_control」を選択します。
ctrl + hjkl to Arrow Keys & ctrl + [ to escape
ctrl + hjkl to Arrow Keysはctrl
+ h
j
k
l
を方向キーに変えるための設定です。例えばVimのINSERTモードでカーソルを動かしたい場合、Vimのデフォルトのカーソル移動用のキー(hjkl)をそのまま使えるので、便利かなと思います。またVimだけでなく、ターミナル等の操作時にも使えます。
ctrl + [ to escapeはctrl
+ [
をecs
キーに変えるための設定です。主にVimを使う際の設定です。
「Complex Modifications」の「Add rule」をクリックします。
「Import more rules from the Internet」をクリックするとブラウザが開きます。
「vim」と検索すれば該当設定が出てくるので、そのまま「Import」をクリックします。
また、既存の設定をインポートするだけでなく自分で作成することも可能です。詳細は公式ドキュメントをご覧ください。
アンインストール
brewでインストールした場合は以下のコマンドでアンインストールできます。
brew uninstall karabiner-elements
公式サイトからダウンロードした場合は、インストール後アプリにロックがかかるため、通常の方法では削除できないようです。
アンインストールするには、アプリ内のuninstallerを使います。