From 380b96a218ef33d1ff4a641850822f583e11131a Mon Sep 17 00:00:00 2001 From: Kuruyia <8174691+Kuruyia@users.noreply.github.com> Date: Sun, 26 Nov 2023 20:34:16 +0100 Subject: [PATCH] feat(editor): add zstyle configuration for WORDCHARS --- modules/editor/README.md | 11 +++++++++++ modules/editor/init.zsh | 3 ++- runcoms/zpreztorc | 3 +++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/modules/editor/README.md b/modules/editor/README.md index 9aef6ef..9c6b410 100644 --- a/modules/editor/README.md +++ b/modules/editor/README.md @@ -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 +``` + +Defaults to `*?_-.[]~&;!#$%^(){}<>`. + ### Key bindings To enable key bindings, add the following to _`${ZDOTDIR:-$HOME}/.zpreztorc`_, diff --git a/modules/editor/init.zsh b/modules/editor/init.zsh index 5b411f5..5798bc8 100644 --- a/modules/editor/init.zsh +++ b/modules/editor/init.zsh @@ -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 diff --git a/runcoms/zpreztorc b/runcoms/zpreztorc index b37c431..f004637 100644 --- a/runcoms/zpreztorc +++ b/runcoms/zpreztorc @@ -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'