Skip to content

Commit

Permalink
feat(editor): add zstyle configuration for WORDCHARS
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuruyia authored and indrajitr committed Nov 30, 2023
1 parent f04191a commit 380b96a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
11 changes: 11 additions & 0 deletions modules/editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ Sets editor specific key bindings options and variables.

## Settings

## Wordchars

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 `*?_-.[]~&;!#$%^(){}<>`.

### Key bindings

To enable key bindings, add the following to _`${ZDOTDIR:-$HOME}/.zpreztorc`_,
Expand Down
3 changes: 2 additions & 1 deletion modules/editor/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ setopt BEEP # Beep on error in line editor.
#

# Treat these characters as part of a word.
WORDCHARS='*?_-.[]~&;!#$%^(){}<>'
zstyle -s ':prezto:module:editor' wordchars 'WORDCHARS' \
|| WORDCHARS='*?_-.[]~&;!#$%^(){}<>'

# Use human-friendly identifiers.
zmodload zsh/terminfo
Expand Down
3 changes: 3 additions & 0 deletions runcoms/zpreztorc
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ zstyle ':prezto:load' pmodule \
# Editor
#

# Set the characters that are considered to be part of a word.
# zstyle ':prezto:module:editor' wordchars '*?_-.[]~&;!#$%^(){}<>'

# Set the key mapping style to 'emacs' or 'vi'.
zstyle ':prezto:module:editor' key-bindings 'emacs'

Expand Down

0 comments on commit 380b96a

Please # to comment.