Zsh¶
Run bindkey to see all shortcut key bindings.
Keyboard shortcuts¶
| Action | ||||||
|---|---|---|---|---|---|---|
| Backward / forward one word | Ctrl | ◀▶ | ||||
| Undo (ctrl-underscore) | Ctrl | Shift | - | |||
| Swap with previous character | Ctrl | T | ||||
| Swap with previous word | Alt | T | ||||
| Previous / next line in history | Ctrl | P / N | ||||
| Clear screen | Ctrl | L | ||||
| Last argument of previous command | Alt | . | ||||
| Completion list (arguments, etc) | Ctrl | I | ||||
| Set mark (ctrl-@) | Ctrl | Shift | 2 | |||
| Kill region | Ctrl | [ | W | |||
which command |
Ctrl | [ | ? | |||
| Show help or manual | Ctrl | [ | H | |||
| Execute and go to next in history | Ctrl | O | ||||
| Expand alias | Ctrl | X | A | |||
| Cycle directory stack (dircycle) | Alt | ◀▶ | ||||
| Parent dir / first subdir | Alt | ▲▼ |
VTE uses the ctrl+shift+arrows¶
VTE — the widget behind Ptyxis, GNOME Terminal and Tilix — handles them.
| Keys | VTE action |
|---|---|
| CtrlShift ◀▶ | scroll_to_previous_prompt() / scroll_to_next_prompt() |
| CtrlShift ▲▼ | scroll_lines(-1) / scroll_lines(1) |
| Shift PgUpPgDn | scroll_pages(∓1) |
| Shift HomeEnd | Top / bottom of scrollback |
| CtrlShiftInsert | Paste clipboard |
OSC 133 prompt marks¶
VTE's prompt jumping searches the scrollback for rows whose cells carry
ShellIntegrationMode::ePROMPT (Ring::contains_prompt_beginning()). Those
tags come from OSC 133, which VTE parses as ITERM2_SHELL_INTEGRATION
(src/parser-osc.hh). With no shell emitting them, both searches run to the
ends of the buffer, so the keys just scroll to the top or bottom of the
scrollback — which looks random rather than broken.
Emitted from the midgard theme, so the feature actually works:
| Mark | Meaning |
|---|---|
D;<status> |
Previous command finished, with exit status |
A |
Prompt starts — the mark VTE searches for |
B |
User input starts |
C |
Command output starts (sent from preexec) |
A must precede the first visible character of the prompt, since VTE tags
cells drawn after it. Wrap the sequences in %{...%} so zsh counts them as
zero-width. Take the exit status from the %? prompt escape rather than a
precmd hook — a hook that runs any command overwrites the $? that
build_prompt reads for its error segment.
Commands¶
| Action | Command | Original |
|---|---|---|
| List visited directories | d |
dirs -v |
| Go 1..9 directory back | 1 .. 9 |
cd -1 .. cd -9 |
| Sudo | _ |
sudo |