jeffreytse / zsh-vi-mode

💻 A better and friendly vi(vim) mode plugin for ZSH.
MIT License
2.94k stars 102 forks source link

feat: integration with clipboard #216

Closed MuXiu1997 closed 7 months ago

MuXiu1997 commented 1 year ago

This is a simple and common implementation for integrating with the clipboard, allowing users to define the ZVM_CLIP_COPY and ZVM_CLIP_PASTE environment variables to determine what command to use for clipboard integration.

Essentially, it assigns the result of executing ZVM_CLIP_PASTE to the CUTBUFFER variable before reading the CUTBUFFER function, and sends the CUTBUFFER through a pipeline to ZVM_CLIP_COPY after writing the CUTBUFFER function. It is also very easy to use with https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/clipboard.zsh.

MuXiu1997 commented 1 year ago

I've been using this solution for several years now and it works as I expected. However, whenever a new version comes out, I need to modify the plugin code again, which is why I considered submitting a PR. If you think this solution is not what you want, feel free to close this PR.

jeffreytse commented 7 months ago

Hi @MuXiu1997

Currently, I'm considering this PR, if you have any further concern, please let me know.

Thanks & Regards