Is there a way to replace clipboard contents instead of adding to it? #2397
-
NvimTree has the feature where you can add multiple files to your "clipboard" then paste them all at once. Is there a way to configure NvimTree to replace the contents of the clipboard on every Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
The clipboard is additive, without an option to replace. You can clear the clipboard Create a function: local function clear_and_copy()
api.fs.clear_clipboard()
api.fs.copy.node()
end Map it in your on_attach: vim.keymap.set('n', 'c', clear_and_copy, opts('Clear And Copy')) |
Beta Was this translation helpful? Give feedback.
The clipboard is additive, without an option to replace.
You can clear the clipboard
:help nvim-tree-api.fs.clear_clipboard()
Create a function:
Map it in your on_attach: