From a64baccca1a6aabfeea7abad74902520a911daa7 Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Thu, 19 Jan 2023 11:44:17 +0530 Subject: [PATCH] nvim: Reintroduce clipboard settings clipboard support just seems to be completely flaky right now. Add previous settings but instead of tmux specific commands use wayland clipboard tools. This should make it work everywhere. One downside of this setting is we go back to polluting system clipboard every time & does not really matter if we copy to + or * register. Both will result in a call to wl-copy. --- nvim/.config/nvim/init.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index 7a05a0c..39d00f6 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -72,6 +72,20 @@ vim.g.matchup_surround_enabled = 1 -- textobj-word-column vim.g.textobj_wordcolumn_no_default_key_mappings = 1 +-- See :help clipboard and https://github.com/neovim/neovim/issues/14545 +vim.g.clipboard = { + name = "clipboard", + copy = { + ["+"] = "wl-copy", + ["*"] = "wl-copy" + }, + paste = { + ["+"] = "wl-paste", + ["*"] = "wl-paste" + }, + cache_enabled = true +} + -- No default mappings for tmux navigator vim.g.tmux_navigator_no_mappings = 1 -- Write the current buffer, but only if changed before navigating from Vim to tmux pane