Fix automatic Neovim yanks in remote sessions

This commit is contained in:
David Heinemeier Hansson committed 2026-09-12 16:48:59 +02:00
1 parent 31bd80daa4
commit 7270ee5021
2 files changed
+61

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
echo "Enable automatic Neovim clipboard yanks in remote sessions"
nvim_provider="$HOME/.config/nvim/lua/config/remote_clipboard.lua"
if [[ -f $nvim_provider ]] &&
grep -qF 'name = "OmarchyRemoteClipboard"' "$nvim_provider" &&
! grep -qF 'vim.opt.clipboard = "unnamedplus"' "$nvim_provider"; then
sed -i '/^ vim.g.clipboard = {/i\ -- LazyVim disables clipboard syncing over SSH; our provider supports it.\n vim.opt.clipboard = "unnamedplus"\n' "$nvim_provider"
fi