-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add clipboard provider configuration (#8826)
This change adds the `clipboard-provider` setting to the `editor` section of configuration. This option can have values of: - `none` (on windows only) - `windows` (use native windows clipboard) - `pasteboard` (use pbcopy/pbpaste) (on neiter of the above) - `wayland` - `x-clip` - `x-sel` - `win-32-yank` (for wsl) - `termux` - `tmux` (on all targets with "term") - `termcode` (osc codes) - `custom` (see below for the configuration) Note for a custom provider the configurations should look like: ```toml [editor.clipboard-provider.custom] yank = { command = "cat", args = ["test.txt"] } paste = { command = "tee", args = ["test.txt"] } primary-yank = { command = "cat", args = ["test-primary.txt"] } # optional primary-paste = { command = "tee", args = ["test-primary.txt"] } # optional ``` This can be configured at runtime with the usual: ``` set clipboard-provider term ``` Note: I was unable to work out a syntax expression for setting a `custom` provider at runtime. In my opinion this is probably a fine limitation to have but I am curious if there is a correct way I couldn't work out. This ports over the previous provider selection logic so hopefully the same default behaviour should apply. I updated the health command to reflect the provider. Note: this required reading the user configurations within the health command which warrants discussion as this seems to not have been done before. This is my first contribution, I am a C++ developer by profession and a rust hobyist at best so nits and style updates very welcome.
- Loading branch information
Showing
7 changed files
with
488 additions
and
358 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.