Closed mikepqr closed 1 year ago
Is there any chance this feature could be a configurable option?
You don't need to configure anything, the statement above assumes set clipboard=
is unset, if you have set clipboard=unnamedplus
(or unnamed
) your clipboard polution will continue uninterrupted :-)
And would it be possible to document more precisely what "dd and similar operations" mean? And what
clipboard = { enabled = true }
does.
When clipboard is enabled and the event TextYankPost
is triggered (neovim event, AFAIK vim doesn't have it), the plugin checks that vim.v.operator == y
, i.e. that you yanked with a y
motion and then copies the contents of the yank register 0
into the clipboard register +
.
If you're using set clipboard=...
you can safely disable clipboard as you obviously don't need this, your content should be automatically copied into the clipboatd.
If you're using set clipboard=... you can safely disable clipboard as you obviously don't need this, your content should be automatically copied into the clipboard.
I don't think it's "obvious" because I'm not sure what "this" is! :-)
Is this correct?
set clipboard=
, and smartyank with clipboard = { enabled = true }
for users who have set clipboard=unnamedplus
, and smartyank clipboard = { enabled = true }
:
for users who have set clipboard=unnamedplus
, and smartyank clipboard = { enabled = false }
:
Right now, smartyank does not have a way to get delete motions on remote hosts to the system clipboard (this is really what my original question is about, and the option I'm looking for!)
if you set clipboard = { enabled = false }
the only thing smartyank does is enable yank highlighting
I don't think it's "obvious" because I'm not sure what "this" is! :-)
I apologize, was answring rushed from a mobile device :-)
What I meant was you can safely set clipboard = { enabled = false }
TextYankPost
, when an event is triggered it does 3 things (in this order):
clipboard
is enabled, copy to the +
register (system clipboard)osc52
is enabled, send OSC52 sequence to the terminaltmux
is enabled, copy to a tmux buffer using tmux set-buffer -w ...
highlight
is enabled, highlight the yanked selection using vim.highlight.on_yank
y
operator: https://github.com/ibhagwan/smartyank.nvim/blob/cd191d9629d620ccc608e6b4e60f3541264d0323/lua/smartyank/init.lua#L145this is really what my original question is about, and the option I'm looking for!
I'll add an override for this.
https://github.com/ibhagwan/smartyank.nvim/commit/054d69dd9e61a745f58c556ff0a2a91b621c8b0f - update to the latest commit and use:
require("smartyank").setup({ validate_yank=false })
lmao "copy indiscriminately" :-)
Thank you very much for the quick and clear response, and for the new feature!
lmao "copy indiscriminately" :-)
consistent with “clipboard pollution” :)
The docs say:
"Minimum clipboard/register pollution: only copy to clipboard when I intent on doing so (i.e. do not overwrite my clipboard on neovim's dd and similar operations)"
I like all the features except this one! As a longime vim user I am too used to deletes (including
dd
) going to my vim clipboard. I am fine with them overwriting my system clipboard. They are not pollution for me.Is there any chance this feature could be a configurable option?
(And would it be possible to document more precisely what "dd and similar operations" mean? And what
clipboard = { enabled = true }
does.)