cd ~/.config
touch karabiner/karabiner.json
touch karabiner.edn
{
:layers {
; implement caps lock mode
:caps_layer {:key :caps_lock :alone {:key :escape}}
; make tab a layer if/when it is held
:tab_layer {:key :tab :alone {:key :tab}}
}
; implement vs code mode
:applications {
:code ["com.microsoft.VSCode"]
}
:main [
{:des "capslock layer"
:rules [
:caps_layer
; vim keys
; navigation
[:##h :left_arrow] ; even with f, still do left arrow
[:##k :up_arrow]
[:##j :down_arrow]
[:##l :right_arrow]
[:##3 :home]
[:##4 :end]
[:##s :return_or_enter]
[:##f :delete_or_backspace]
[:##g :escape]
[:##x :delete_forward]
]}
{:des "tab+d opens mission control"
:rules [
:tab_layer
[:##e :mission_control] ; make command + space space + space space
[:##d :!Cspacebar]
]}
{
:des "z is command when held"
; :rules [[:##z :!CTOleft_command nil {:alone :##z}]]
:rules [[:##z :left_command nil {:alone :##z}]]
}
{
:des "/ is command when held"
; :rules [[:##slash :!CTOleft_command nil {:alone :##slash}]]
:rules [[:##slash :left_command nil {:alone :##slash}]]
}
;; {:des "these only work when you are inside vscode"
;; :rules [
;; :code
;; [:p :m] ; remap p to m INSIDE VSCODE
;; ]}
{:des "switch control and command"
:rules [
[:##left_control :left_command]
[:##left_command :left_control]
]
}
]
}
goku
which will read ~/.config/karabiner.edn
and output ~/.config/karabiner/karabiner.json