Keybindings
A keybinding connects a key combination to an action. Each one is
a keybind line in your config file:
keybind = Ctrl+M=minimize_windowLeft 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.
Change or add a key
Section titled “Change or add a key”Find the action’s name in All actions and write a line for it:
keybind = Ctrl+Alt+D=split_rightYour 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_righttoCtrl+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:
| Modifier | Also written as |
|---|---|
Ctrl | Control |
Shift | |
Alt | Option, Opt |
Command | Cmd, Meta, Super, Win |
Keys — these are case-sensitive:
| Keys | Written as |
|---|---|
| Letters | uppercase: A … Z |
| Digits | 0 … 9 |
| Function keys | F1, F2, … |
| Arrows | Left, Right, Up, Down |
| Navigation | Home, End, PageUp, PageDown, Insert, Delete |
| Other named keys | Enter, Escape, Tab, Space, Backspace |
| Punctuation | the character itself: , . / ; ' [ ] - ` \ |
The characters =, > and : are part of the syntax and cannot be used as keys.
Key sequences
Section titled “Key sequences”Chain combinations with > to require several key presses in a row:
keybind = Ctrl+B>Ctrl+S=open_configPress Ctrl+B, release, then Ctrl+S.
Actions with an argument
Section titled “Actions with an argument”Some actions take an argument after a :. new_tab takes the name of a
shell profile:
keybind = Ctrl+Alt+B=new_tab:bashArguments may only contain letters, digits and _.
Triggers
Section titled “Triggers”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| Trigger | Effect |
|---|---|
always | The binding also works while a full-screen program such as vim or htop is running. Without it, the key goes to that program instead. |
performable | The 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. |
unconsumed | The action runs and the key is passed on to the terminal. |
broadcast | The 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 :.
Examples
Section titled “Examples”# Give an action without a default key onekeybind = Ctrl+Alt+I=open_process_info
# Keep a shortcut working inside vim, htop and other full-screen programskeybind = always:Ctrl+Shift+P=open_command_palette
# Clear the screen of every terminal at oncekeybind = broadcast:Ctrl+Alt+L=clear_buffer
# A two-step sequencekeybind = Ctrl+B>Ctrl+W=close_all_tabsIf a line names an action that does not exist, Cogno shows a warning and ignores the line.