# define some aliases Alt = AltLeft AltGr = AltRight Win = Meta Command = Meta # immediately forward common modifier keys (also used as mouse modifiers) @forward-modifiers Shift Control Alt # define a virtual "boss" key, which can be toggled using the scroll-lock key # when the boss key is "pressed", the keyboard should be intuitively useable Boss = Virtual1 ScrollLock >> Boss Boss{Any} >> Any # map Capslock to Backspace Control{CapsLock} >> CapsLock CapsLock >> Backspace # define an additional modifier "Ext" (angular bracket key on some keyboards) Ext = IntlBackslash # the Ext modifier alone should have no effect Ext >> # map Ext-S/D/F to Alt/Shift/Control Ext{S} >> Alt Ext{D} >> Shift Ext{F} >> Control Ext{A} >> Alt # also map A because of S/D rollover # Ext-W and the navigation keys should step in/out/over during debugging Ext{W{L}} >> debug_step_into Ext{W{J}} >> debug_step_out Ext{W{K}} >> debug_step_over Ext{W{Any}} >> # map Ext-I/J/K/L to cursor keys... Ext{I} >> ArrowUp Ext{K} >> ArrowDown Ext{J} >> ArrowLeft Ext{L} >> ArrowRight Ext{U} >> cursor_home Ext{O} >> cursor_end Ext{Y} >> PageUp Ext{H} >> PageDown Ext{Semicolon} >> Backspace Ext{Q} >> navigate_escape Ext{Space} >> Space Ext{M} >> Enter Ext{X} >> edit_cut Ext{C} >> edit_copy Ext{V} >> edit_paste Ext{E} >> find Ext{Z} >> edit_undo (Ext Shift){Z} >> edit_redo Ext{Comma} >> navigate_back Ext{Period} >> navigate_fore Ext{T} >> open_file Ext{G} >> go_to_definition Ext{BracketRight} >> AudioVolumeUp Ext{BracketLeft} >> AudioVolumeDown Ext{R} >> Delete Ext{B} >> build # map Ext-number keys to function keys Ext{1} >> F1 Ext{2} >> edit_rename Ext{3} >> F3 Ext{4} >> F4 Ext{5} >> F5 Ext{6} >> F6 Ext{7} >> F7 Ext{8} >> F8 Ext{9} >> F9 Ext{0} >> F10 Ext{Minus} >> F11 Ext{Equal} >> F12 # the Ext modifier together with other keys should have no effect Ext{Any} >> # add some Windows-key commands Win{C} >> open_terminal Win{Q} >> close_window Win{A} >> lower_window Win{Tab} >> next_tab (Win Shift){Tab} >> prev_tab (Win Control Alt){S} >> suspend_machine (Win Control Alt){P} >> poweroff_machine (Win Control Alt){R} >> reboot_machine # pass other Windows key combinations unmapped Win{Any} >> Win{Any} # colemak layout mapping (Shift AltGr){I} >> 'Ü' AltGr{I} >> 'ü' (Shift AltGr){A} >> 'Ä' AltGr{A} >> 'ä' (Shift AltGr){Semicolon} >> 'Ö' AltGr{Semicolon} >> 'ö' AltGr{D} >> 'ß' AltGr{Q} >> '@' AltGr{Backquote} >> '°' E >> F R >> P T >> G Y >> J U >> L I >> U O >> Z Z >> Y Shift{P} >> ':' P >> ';' S >> R D >> S F >> T G >> D J >> N K >> E L >> I Semicolon >> O N >> K Shift{Quote} >> '"' Quote >> "'" Shift{Comma} >> '<' Shift{Period} >> '>' Shift{BracketLeft} >> '{' BracketLeft >> '[' Shift{BracketRight} >> '}' BracketRight >> ']' Shift{Backquote} >> Shift{Equal} Space # dead key '`' Backquote >> '~' Shift{2} >> '@' Shift{3} >> '#' Shift{6} >> Backquote Space # dead key '^' Shift{7} >> '&' Shift{8} >> '*' Shift{9} >> '(' Shift{0} >> ')' Shift{Minus} >> '_' Minus >> '-' Shift{Equal} >> '+' Equal >> '=' Shift{Backslash} >> '|' Backslash >> '\' Shift{Slash} >> '?' Slash >> '/' # default mappings for abstract commands open_terminal >> Any suspend_machine >> Any poweroff_machine >> Any reboot_machine >> Any close_window >> Alt{F4} navigate_escape >> Escape cursor_home >> Home cursor_end >> End open_file >> Control{O} navigate_back >> Alt{ArrowLeft} navigate_fore >> Alt{ArrowRight} next_tab >> Control{PageUp} prev_tab >> Control{PageDown} edit_copy >> Control{C} edit_cut >> Control{X} edit_paste >> Control{V} edit_undo >> Control{Y} edit_redo >> Control{Z} find >> Control{F} build >> Control{B} debug_step_over >> F10 debug_step_into >> F11 debug_step_out >> Shift{F11} edit_rename >> F2 # system/application specific mappings for abstract commands [system="MacOS"] @macos-toggle-fn @macos-iso-keyboard close_window >> Command{Q} cursor_home >> Command{ArrowLeft} cursor_end >> Command{ArrowRight} edit_cut >> Command{X} edit_copy >> Command{C} edit_paste >> Command{V} edit_undo >> Command{Y} edit_redo >> (Command Shift){Y} find >> Command{F} [system="Linux"] lower_window >> (Alt Shift){PageDown} [system = "Linux", class = "Thunar", title != "Rename"] cursor_home >> Backspace cursor_end >> Enter open_terminal >> (Shift Control){C} [system="Linux" class="tilix"] close_window >> (Shift Control){W} edit_paste >> (Shift Control){V} open_terminal >> ContextMenu ^ Enter [system="Windows"] suspend_machine >> Win{X} 300ms U S poweroff_machine >> Win{X} 300ms U U reboot_machine >> Win{X} 300ms U R lower_window >> Alt{Escape} open_terminal >> $(start cmd) [system="Windows" class="CabinetWClass"] # Windows Explorer open_terminal >> F4 ^ Control{A} "cmd" Enter [title="Mozilla Firefox"] open_file >> Control{K} navigate_escape >> Escape Control{F} Escape go_to_definition >> Shift{Backslash} [title="Chromium"] open_file >> Control{L} navigate_escape >> Control{L} F6 [title="Qt Creator"] open_file >> Control{K} go_to_definition >> F2 edit_redo >> (Control Shift){Y} edit_rename >> (Control Shift){R} [title=/Code - OSS|Visual Studio Code/] go_to_definition >> F12 navigate_back >> (Control Alt){Slash} navigate_fore >> (Control Shift){Slash} build >> (Control Shift){B} [system="MacOS" class="Code"] go_to_definition >> F12 navigate_back >> (Control){Slash} navigate_fore >> (Control Shift){Slash} build >> (Control Shift){B} [title="Visual Studio"] go_to_definition >> F12 navigate_back >> Control{Slash} navigate_fore >> (Control Shift){Slash} build >> (Control Shift){B} [title="Geany"] go_to_definition >> (Control Shift){T} [stage] ? "std:;" >> ":"