2021-05-04 01:59:31 +00:00
|
|
|
# Editor
|
2013-05-18 20:49:09 +00:00
|
|
|
|
2018-10-12 08:55:55 +00:00
|
|
|
Sets editor specific key bindings options and variables.
|
|
|
|
|
2021-05-04 01:59:31 +00:00
|
|
|
## Options
|
2018-10-12 08:55:55 +00:00
|
|
|
|
2021-05-04 01:59:31 +00:00
|
|
|
- `BEEP` beep on error in line editor.
|
2018-10-12 08:55:55 +00:00
|
|
|
|
2021-05-04 01:59:31 +00:00
|
|
|
## Variables
|
2018-10-12 08:55:55 +00:00
|
|
|
|
2021-05-04 01:59:31 +00:00
|
|
|
- `WORDCHARS` treat a given set of characters as part of a word.
|
2013-05-18 20:49:09 +00:00
|
|
|
|
2021-05-04 01:59:31 +00:00
|
|
|
## Settings
|
2013-05-18 20:49:09 +00:00
|
|
|
|
2023-11-30 20:12:57 +00:00
|
|
|
### Wordchars
|
2023-11-26 19:34:16 +00:00
|
|
|
|
|
|
|
To change what characters are considered part of a word, add the following to
|
|
|
|
_`${ZDOTDIR:-$HOME}/.zpreztorc`_.
|
|
|
|
|
|
|
|
```sh
|
|
|
|
zstyle ':prezto:module:editor' wordchars <chars>
|
|
|
|
```
|
|
|
|
|
|
|
|
Defaults to `*?_-.[]~&;!#$%^(){}<>`.
|
|
|
|
|
2013-05-18 20:49:09 +00:00
|
|
|
### Key bindings
|
|
|
|
|
2021-05-05 17:59:01 +00:00
|
|
|
To enable key bindings, add the following to _`${ZDOTDIR:-$HOME}/.zpreztorc`_,
|
|
|
|
and replace `'<bindings>'` with `'emacs'` or `'vi'`.
|
2013-05-18 20:49:09 +00:00
|
|
|
|
2017-07-21 01:07:29 +00:00
|
|
|
```sh
|
2021-05-05 17:59:01 +00:00
|
|
|
zstyle ':prezto:module:editor' key-bindings '<bindings>'
|
2017-07-21 01:07:29 +00:00
|
|
|
```
|
2013-05-18 20:49:09 +00:00
|
|
|
|
|
|
|
### Dot Expansion
|
|
|
|
|
|
|
|
To enable the auto conversion of .... to ../.., add the following to
|
2021-05-05 17:59:01 +00:00
|
|
|
_`${ZDOTDIR:-$HOME}/.zpreztorc`_.
|
2013-05-18 20:49:09 +00:00
|
|
|
|
2017-07-21 01:07:29 +00:00
|
|
|
```sh
|
|
|
|
zstyle ':prezto:module:editor' dot-expansion 'yes'
|
|
|
|
```
|
2013-05-18 20:49:09 +00:00
|
|
|
|
2017-04-02 19:09:58 +00:00
|
|
|
### PS Context
|
|
|
|
|
2021-05-05 17:59:01 +00:00
|
|
|
To enable the prompt context to be set, add the following to
|
|
|
|
_`${ZDOTDIR:-$HOME}/.zpreztorc`_.
|
2017-04-02 19:09:58 +00:00
|
|
|
|
2017-07-21 01:07:29 +00:00
|
|
|
```sh
|
|
|
|
zstyle ':prezto:module:editor' ps-context 'yes'
|
|
|
|
```
|
2017-04-02 19:09:58 +00:00
|
|
|
|
2021-05-04 01:59:31 +00:00
|
|
|
## Theming
|
2013-05-18 20:49:09 +00:00
|
|
|
|
|
|
|
To indicate when the editor is in the primary keymap (emacs or viins), add
|
|
|
|
the following to your `theme_prompt_setup` function.
|
|
|
|
|
2017-07-21 01:07:29 +00:00
|
|
|
```sh
|
|
|
|
zstyle ':prezto:module:editor:info:keymap:primary' format '>>>'
|
|
|
|
```
|
2013-05-18 20:49:09 +00:00
|
|
|
|
|
|
|
To indicate when the editor is in the primary keymap (emacs or viins) insert
|
|
|
|
mode, add the following to your `theme_prompt_setup` function.
|
|
|
|
|
2017-07-21 01:07:29 +00:00
|
|
|
```sh
|
|
|
|
zstyle ':prezto:module:editor:info:keymap:primary:insert' format 'I'
|
|
|
|
```
|
2013-05-18 20:49:09 +00:00
|
|
|
|
|
|
|
To indicate when the editor is in the primary keymap (emacs or viins) overwrite
|
|
|
|
mode, add the following to your `theme_prompt_setup` function.
|
|
|
|
|
2017-07-21 01:07:29 +00:00
|
|
|
```sh
|
|
|
|
zstyle ':prezto:module:editor:info:keymap:primary:overwrite' format 'O'
|
|
|
|
```
|
2013-05-18 20:49:09 +00:00
|
|
|
|
|
|
|
To indicate when the editor is in the alternate keymap (vicmd), add the
|
|
|
|
following to your `theme_prompt_setup` function.
|
|
|
|
|
2017-07-21 01:07:29 +00:00
|
|
|
```sh
|
|
|
|
zstyle ':prezto:module:editor:info:keymap:alternate' format '<<<'
|
|
|
|
```
|
2013-05-18 20:49:09 +00:00
|
|
|
|
|
|
|
To indicate when the editor is completing, add the following to your
|
|
|
|
`theme_prompt_setup` function.
|
|
|
|
|
2017-07-21 01:07:29 +00:00
|
|
|
```sh
|
|
|
|
zstyle ':prezto:module:editor:info:completing' format '...'
|
|
|
|
```
|
2013-05-18 20:49:09 +00:00
|
|
|
|
2021-05-05 17:59:01 +00:00
|
|
|
Then add `$editor_info[context]`, where context is _keymap_, _insert_, or
|
|
|
|
_overwrite_, to `$PROMPT` or `$RPROMPT`.
|
2013-05-18 20:49:09 +00:00
|
|
|
|
2021-05-04 01:59:31 +00:00
|
|
|
## Convenience Functions
|
2017-07-06 06:05:31 +00:00
|
|
|
|
|
|
|
### bindkey-all
|
|
|
|
|
2021-05-05 17:59:01 +00:00
|
|
|
Provides a function `bindkey-all` which can be useful for checking how all of
|
|
|
|
the keys are bound. Normal `bindkey` command will only list the keys bound for
|
|
|
|
one keymap, which is not as useful if you want to grep through the output. The
|
|
|
|
keymap's names go to stderr so when you grep through `bindkey-all`'s output you
|
2017-07-06 06:05:31 +00:00
|
|
|
will still see the headings and can tell which keymap each binding goes to.
|
|
|
|
|
|
|
|
It will also pass through arguments so you can use bindkey-all to set bindings
|
2021-05-05 17:59:01 +00:00
|
|
|
for all keymaps at once. If provided arguments it will _not_ print out the
|
2017-08-16 18:47:58 +00:00
|
|
|
names of each of the keymaps, and just run the command for each keymap.
|
2017-07-06 06:05:31 +00:00
|
|
|
|
2021-05-04 01:59:31 +00:00
|
|
|
## Authors
|
2013-05-18 20:49:09 +00:00
|
|
|
|
2021-05-05 17:59:01 +00:00
|
|
|
_The authors of this module should be contacted via the [issue tracker][1]._
|
2013-05-18 20:49:09 +00:00
|
|
|
|
2021-05-04 01:59:31 +00:00
|
|
|
- [Sorin Ionescu](https://github.com/sorin-ionescu)
|
2013-05-18 20:49:09 +00:00
|
|
|
|
2020-01-20 15:50:42 +00:00
|
|
|
[1]: https://github.com/sorin-ionescu/prezto/issues
|