From 2d17a75972f2447574635981472bd6f4a06a775d Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Sun, 8 Jan 2023 10:48:34 +0530 Subject: [PATCH] Revert "nvim: init: Drop tmux configuration for copying to system clipboard" This reverts commit c37bd7d4513d83978a2ef63b983f637819d2636d. Copying to system clipboard seems to have broken again and need to revert this. See https://github.com/neovim/neovim/issues/21636. --- 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 e2b48bc..9405a20 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -74,6 +74,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 = "tmux", + copy = { + ["+"] = "tmux load-buffer -w -", + ["*"] = "tmux load-buffer -w -" + }, + paste = { + ["+"] = "tmux save-buffer -", + ["*"] = "tmux save-buffer -" + }, + 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