mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-18 10:22:00 +00:00
feat(vi-mode): add option to disable clipboard (#12037)
This commit is contained in:
parent
6165c257ae
commit
e0213342d1
2 changed files with 13 additions and 9 deletions
|
@ -37,6 +37,8 @@ plugins=(... vi-mode)
|
||||||
- `INSERT_MODE_INDICATOR`: controls the string displayed when the shell is in insert mode.
|
- `INSERT_MODE_INDICATOR`: controls the string displayed when the shell is in insert mode.
|
||||||
See [Mode indicators](#mode-indicators) for details.
|
See [Mode indicators](#mode-indicators) for details.
|
||||||
|
|
||||||
|
- `VI_MODE_DISABLE_CLIPBOARD`: If set, disables clipboard integration on yank/paste
|
||||||
|
|
||||||
## Mode indicators
|
## Mode indicators
|
||||||
|
|
||||||
*Normal mode* is indicated with a red `<<<` mark at the right prompt, when it
|
*Normal mode* is indicated with a red `<<<` mark at the right prompt, when it
|
||||||
|
|
|
@ -147,17 +147,19 @@ function wrap_clipboard_widgets() {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
wrap_clipboard_widgets copy \
|
if [[ -z "${VI_MODE_DISABLE_CLIPBOARD:-}" ]]; then
|
||||||
vi-yank vi-yank-eol vi-yank-whole-line \
|
wrap_clipboard_widgets copy \
|
||||||
vi-change vi-change-eol vi-change-whole-line \
|
vi-yank vi-yank-eol vi-yank-whole-line \
|
||||||
vi-kill-line vi-kill-eol vi-backward-kill-word \
|
vi-change vi-change-eol vi-change-whole-line \
|
||||||
vi-delete vi-delete-char vi-backward-delete-char
|
vi-kill-line vi-kill-eol vi-backward-kill-word \
|
||||||
|
vi-delete vi-delete-char vi-backward-delete-char
|
||||||
|
|
||||||
wrap_clipboard_widgets paste \
|
wrap_clipboard_widgets paste \
|
||||||
vi-put-{before,after} \
|
vi-put-{before,after} \
|
||||||
put-replace-selection
|
put-replace-selection
|
||||||
|
|
||||||
unfunction wrap_clipboard_widgets
|
unfunction wrap_clipboard_widgets
|
||||||
|
fi
|
||||||
|
|
||||||
# if mode indicator wasn't setup by theme, define default, we'll leave INSERT_MODE_INDICATOR empty by default
|
# if mode indicator wasn't setup by theme, define default, we'll leave INSERT_MODE_INDICATOR empty by default
|
||||||
if [[ -z "$MODE_INDICATOR" ]]; then
|
if [[ -z "$MODE_INDICATOR" ]]; then
|
||||||
|
|
Loading…
Reference in a new issue