🍅 automatoes.com

Consistent Keyboard Shortcuts Across Apps

In your karabiner.edn file

Define a froms section

Name and define the shortcut you want to use across all apps

:froms {
  :duplicate
    {:key :d :modi :left_command}
  :add-next-find-to-selection
    {:key :g :modi :left_control}
  :select-to-top-of-file
    {:key :up_arrow :modi [:left_command :left_shift]}
}

Define a list of apps to overwrite shortcuts

Define an applications section

:applications {
  :code ["com.microsoft.VSCode"]
  :webstorm ["com.jetbrains.Webstorm"]
}

Map the Shortcut Based on the App

You only have to override the shortcut in the app you want to change

:main [
  {:des "VS Code Shortcuts"
    :rules [
       :code ; this limits the below shortcuts to VS Code
         [:duplicate [:!Cc :!Cv]]
         [:add-next-find-to-selection :!Cd]
    ]
  }
  {:des "WebStorm Shortcuts"
    :rules [
       :webstorm
         [:select-to-start-of-file :!CShome] ;
    ]
  }
]

Tags:

Contributor: [John Lindquist]

Referred in

edit
Consistent Keyboard Shortcuts Across Apps