2020-06-17 10:08:43 +03:00
|
|
|
*since: 20200607-144723-74889cd4*
|
2020-06-05 18:19:23 +03:00
|
|
|
|
2020-06-05 18:07:46 +03:00
|
|
|
Copy mode allows you to make selections using the keyboard; no need to reach
|
2021-04-26 02:27:39 +03:00
|
|
|
for your mouse or trackpad. Copy mode is similar to [quick select
|
|
|
|
mode](quickselect.md) but is geared up for describing selections based on
|
|
|
|
keyboard control, whereas quick select mode is used to quickly select and
|
2022-07-30 04:00:03 +03:00
|
|
|
copy commonly used patterns. The [colors](config/appearance.md#defining-your-own-colors)
|
|
|
|
of the highlighted/selected text can be configured.
|
2020-06-05 18:07:46 +03:00
|
|
|
|
|
|
|
The `ActivateCopyMode` key assignment is used to enter copy mode; it is
|
|
|
|
bound to `CTRL-SHIFT-X` by default.
|
|
|
|
|
|
|
|
When copy mode is activated, the title is prefixed with "Copy Mode" and
|
|
|
|
the behavior of the tab is changed; keyboard input now controls the
|
|
|
|
cursor and allows moving it through the scrollback, scrolling the viewport
|
|
|
|
as needed, in a style similar to that of the Vim editor.
|
|
|
|
|
|
|
|
Move the cursor to the start of the region you wish to select and press `v` to
|
|
|
|
toggle selection mode (it is off by default), then move the cursor to the end
|
2023-01-25 17:47:02 +03:00
|
|
|
of that region. You can then use `Copy` (by default: `CTRL-SHIFT-C`) to copy
|
2020-06-05 18:07:46 +03:00
|
|
|
that region to the clipboard.
|
|
|
|
|
|
|
|
### Key Assignments
|
|
|
|
|
2023-01-19 19:11:53 +03:00
|
|
|
The default key assignments in copy mode are as follows:
|
2020-06-05 18:07:46 +03:00
|
|
|
|
|
|
|
| Action | Key Assignment |
|
|
|
|
|---------|-------------------|
|
2023-01-19 09:11:23 +03:00
|
|
|
| Activate copy mode | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>X</kbd> |
|
|
|
|
| Copy and exit copy mode | <kbd>y</kbd> |
|
|
|
|
| Exit copy mode | <kbd>Esc</kbd> |
|
|
|
|
| | <kbd>Ctrl</kbd> + <kbd>C</kbd> |
|
|
|
|
| | <kbd>Ctrl</kbd> + <kbd>G</kbd> |
|
|
|
|
| | <kbd>q</kbd> |
|
|
|
|
| Cell selection | <kbd>v</kbd> |
|
2023-01-19 19:11:53 +03:00
|
|
|
| Line selection | <kbd>Shift</kbd> + <kbd>V</kbd> |
|
2023-01-19 09:11:23 +03:00
|
|
|
| Rectangular selection | <kbd>Ctrl</kbd> + <kbd>V</kbd> (*since: 20220624-141144-bd1b7c5d*)|
|
|
|
|
| Move Left | <kbd>LeftArrow</kbd> |
|
|
|
|
| | <kbd>h</kbd> |
|
|
|
|
| Move Down | <kbd>DownArrow</kbd> |
|
|
|
|
| | <kbd>j</kbd> |
|
|
|
|
| Move Up | <kbd>UpArrow</kbd> |
|
|
|
|
| | <kbd>k</kbd> |
|
|
|
|
| Move Right | <kbd>RightArrow</kbd> |
|
|
|
|
| | <kbd>l</kbd> |
|
|
|
|
| Move forward one word | <kbd>Alt</kbd> + <kbd>RightArrow</kbd> |
|
|
|
|
| | <kbd>Alt</kbd> + <kbd>F</kbd> |
|
|
|
|
| | <kbd>Tab</kbd> |
|
|
|
|
| | <kbd>w</kbd> |
|
|
|
|
| Move backward one word| <kbd>Alt</kbd> + <kbd>LeftArrow</kbd> |
|
|
|
|
| | <kbd>Alt</kbd> + <kbd>B</kbd> |
|
|
|
|
| | <kbd>Shift</kbd> + <kbd>Tab</kbd> |
|
|
|
|
| | <kbd>b</kbd> |
|
2023-01-25 17:47:02 +03:00
|
|
|
| Move forward one word end | <kbd>e</kbd> (*since: nightly builds only*)|
|
2023-01-19 09:11:23 +03:00
|
|
|
| Move to start of this line | <kbd>0</kbd> |
|
2023-02-05 19:20:01 +03:00
|
|
|
| | <kbd>Home</kbd> |
|
2023-01-19 09:11:23 +03:00
|
|
|
| Move to start of next line | <kbd>Enter</kbd> |
|
|
|
|
| Move to end of this line | <kbd>$</kbd> |
|
2023-02-05 19:20:01 +03:00
|
|
|
| | <kbd>End</kbd> |
|
2023-01-19 09:11:23 +03:00
|
|
|
| Move to start of indented line | <kbd>Alt</kbd> + <kbd>M</kbd> |
|
|
|
|
| | <kbd>^</kbd> |
|
2023-01-19 19:11:53 +03:00
|
|
|
| Move to bottom of scrollback | <kbd>Shift</kbd> + <kbd>G</kbd> |
|
2023-01-19 09:11:23 +03:00
|
|
|
| Move to top of scrollback | <kbd>g</kbd> |
|
2023-01-19 19:11:53 +03:00
|
|
|
| Move to top of viewport | <kbd>Shift</kbd> + <kbd>H</kbd> |
|
|
|
|
| Move to middle of viewport | <kbd>Shift</kbd> + <kbd>M</kbd> |
|
|
|
|
| Move to bottom of viewport | <kbd>Shift</kbd> + <kbd>L</kbd> |
|
2023-01-19 09:11:23 +03:00
|
|
|
| Move up one screen | <kbd>PageUp</kbd> |
|
|
|
|
| | <kbd>Ctrl</kbd> + <kbd>B</kbd> |
|
2023-01-25 17:47:02 +03:00
|
|
|
| Move up half a screen | <kbd>Ctrl</kbd> + <kbd>U</kbd> (*since: nightly builds only*)|
|
2023-01-19 09:11:23 +03:00
|
|
|
| Move down one screen | <kbd>PageDown</kbd> |
|
|
|
|
| | <kbd>Ctrl</kbd> + <kbd>F</kbd> |
|
2023-01-25 17:47:02 +03:00
|
|
|
| Move down half a screen | <kbd>Ctrl</kbd> + <kbd>D</kbd> (*since: nightly builds only*)|
|
2023-01-19 09:11:23 +03:00
|
|
|
| Move to other end of the selection| <kbd>o</kbd> |
|
2023-01-19 19:11:53 +03:00
|
|
|
| Move to other end of the selection horizontally| <kbd>Shift</kbd> + <kbd>O</kbd> (useful in Rectangular mode) |
|
2020-06-05 18:07:46 +03:00
|
|
|
|
2022-05-07 05:47:42 +03:00
|
|
|
### Configurable Key Assignments
|
|
|
|
|
2022-06-25 00:58:18 +03:00
|
|
|
*Since: 20220624-141144-bd1b7c5d*
|
2022-05-07 05:47:42 +03:00
|
|
|
|
|
|
|
The key assignments for copy mode are specified by the `copy_mode` [Key Table](config/key-tables.md).
|
|
|
|
|
2022-09-07 20:17:01 +03:00
|
|
|
You may provide your own definition of this key table if you wish to customize
|
|
|
|
it.
|
|
|
|
|
|
|
|
You may use
|
|
|
|
[wezterm.gui.default_key_tables](config/lua/wezterm.gui/default_key_tables.md)
|
|
|
|
to obtain the defaults and extend them. In earlier versions of wezterm there
|
|
|
|
wasn't a way to override portions of the key table, only to replace the entire
|
|
|
|
table.
|
2022-05-07 05:47:42 +03:00
|
|
|
|
2022-08-04 16:31:40 +03:00
|
|
|
The default configuration at the time that these docs were built (which
|
|
|
|
may be more recent than your version of wezterm) is shown below.
|
|
|
|
|
|
|
|
You can see the configuration in your version of wezterm by running
|
|
|
|
`wezterm show-keys --lua --key-table copy_mode`.
|
2022-05-07 05:47:42 +03:00
|
|
|
|
2023-03-16 05:22:51 +03:00
|
|
|
{% include "examples/default-copy-mode-key-table.markdown" %}
|