Skip to content
Cogno v0.4.0

Keybindings

A keybinding connects a key combination to an action. Each one is a keybind line in your config file:

keybind = Ctrl+M=minimize_window

Left of the second = is the key, right of it the action. Changes apply as soon as you save the file.

The examples on this page use Ctrl. On macOS you will usually want Command instead.

Find the action’s name in All actions and write a line for it:

keybind = Ctrl+Alt+D=split_right

Your lines are added to the defaults, so you only list what you change. Two rules decide what happens on a conflict:

  • One key per action. The last line that names an action sets its key. The line above moves split_right to Ctrl+Alt+D; its default key stops working.
  • One action per key. If two actions end up on the same key, the later line wins.

There is no way to remove a binding without replacing it. To free a key, bind its action to a different key.

A combination is any number of modifiers and one key, joined with +. The line must not contain spaces.

Modifiers — case and order do not matter:

ModifierAlso written as
CtrlControl
Shift
AltOption, Opt
CommandCmd, Meta, Super, Win

Keys — these are case-sensitive:

KeysWritten as
Lettersuppercase: A … Z
Digits0 … 9
Function keysF1, F2, …
ArrowsLeft, Right, Up, Down
NavigationHome, End, PageUp, PageDown, Insert, Delete
Other named keysEnter, Escape, Tab, Space, Backspace
Punctuationthe character itself: , . / ; ' [ ] - ` \

The characters =, > and : are part of the syntax and cannot be used as keys.

Chain combinations with > to require several key presses in a row:

keybind = Ctrl+B>Ctrl+S=open_config

Press Ctrl+B, release, then Ctrl+S.

Some actions take an argument after a :. new_tab takes the name of a shell profile:

keybind = Ctrl+Alt+B=new_tab:bash

Arguments may only contain letters, digits and _.

A trigger in front of the key changes when the binding fires and whether the terminal still receives the key. Without a trigger, the action runs and the key is not passed on to the terminal.

keybind = always:performable:Ctrl+C=copy
TriggerEffect
alwaysThe binding also works while a full-screen program such as vim or htop is running. Without it, the key goes to that program instead.
performableThe key is only taken if the action actually did something. Otherwise it goes to the terminal. This is how Ctrl+C copies when text is selected and interrupts the command when nothing is.
unconsumedThe action runs and the key is passed on to the terminal.
broadcastThe action runs in every terminal, not only the focused one — for example to clear the input line in all panes at once.

Triggers can be combined, each followed by a :.

# Give an action without a default key one
keybind = Ctrl+Alt+I=open_process_info
# Keep a shortcut working inside vim, htop and other full-screen programs
keybind = always:Ctrl+Shift+P=open_command_palette
# Clear the screen of every terminal at once
keybind = broadcast:Ctrl+Alt+L=clear_buffer
# A two-step sequence
keybind = Ctrl+B>Ctrl+W=close_all_tabs

If a line names an action that does not exist, Cogno shows a warning and ignores the line.