zsh-vi-more / evil-registers

Access external clipboards in vi-mode keymaps
ISC License
42 stars 2 forks source link

Set linewise mode for linewise yanks #2

Open xPMo opened 5 years ago

xPMo commented 5 years ago

Currently, yanks in zsh do not preserve trailing newlines when sent to vim/nvim. Vim and Nvim will use linewise-puts if the text in the register ends with a newline. Zsh will use linewise-puts if the register contains "a sequence of lines" [sic] according to man zshzle.

xPMo commented 5 years ago

After looking at Zsh's source code, the variable responsible for keeping track of this is vilinerange, and it is not exposed to ZLE widgets. This may be impossible unless the Zsh devs choose to make that available.

xPMo commented 5 years ago

We may be able to partially track this ourselves by wrapping the visual-line-mode and vi-yank-whole-line widgets. Tracking this for vi-yank (yy) will be tricker.