0
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-09-19 04:01:21 +02:00

feat(vi-mode): copy to clipboard when using vi-change* and vi-yank* widgets (#11861)

This commit is contained in:
bretello 2023-10-02 20:41:01 +02:00 committed by GitHub
parent fea4584ceb
commit df80a2da54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 2 deletions

View file

@ -144,11 +144,17 @@ NOTE: this used to be bound to `v`. That is now the default (`visual-mode`).
- `c{motion}` : Delete {motion} text and start insert
- `cc` : Delete line and start insert
- `C` : Delete to the end of the line and start insert
- `P` : Insert the contents of the clipboard before the cursor
- `p` : Insert the contents of the clipboard after the cursor
- `r{char}` : Replace the character under the cursor with {char}
- `R` : Enter replace mode: Each character replaces existing one
- `x` : Delete `count` characters under and after the cursor
- `X` : Delete `count` characters before the cursor
NOTE: delete/kill commands (`dd`, `D`, `c{motion}`, `C`, `x`,`X`) and yank commands
(`y`, `Y`) will copy to the clipboard. Contents can then be put back using paste commands
(`P`, `p`).
## Known issues
### Low `$KEYTIMEOUT`

View file

@ -147,8 +147,15 @@ function wrap_clipboard_widgets() {
done
}
wrap_clipboard_widgets copy vi-yank vi-yank-eol vi-backward-kill-word vi-change-whole-line vi-delete vi-delete-char
wrap_clipboard_widgets paste vi-put-{before,after}
wrap_clipboard_widgets copy \
vi-yank vi-yank-eol vi-yank-whole-line \
vi-change vi-change-eol vi-change-whole-line \
vi-kill-line vi-kill-eol vi-backward-kill-word \
vi-delete vi-delete-char vi-backward-delete-char
wrap_clipboard_widgets paste \
vi-put-{before,after}
unfunction wrap_clipboard_widgets
# if mode indicator wasn't setup by theme, define default, we'll leave INSERT_MODE_INDICATOR empty by default