Not for normies
created a table for clipboards to choose from
1 file changed, +16 -6
+16-6nvim/lua/config/options.lua
| @@ -8,11 +8,8 @@ vim.g.ai_cmp = false | ||
| 8 | 8 | -- disable swap files, not needed with autosession |
| 9 | 9 | vim.opt.swapfile = false |
| 10 | 10 | |
| 11 | --- wayland settings | |
| 12 | -if vim.fn.getenv("WAYLAND_DISPLAY") ~= vim.NIL then | |
| 13 | - -- vim.notify("Wayland detected") | |
| 14 | - | |
| 15 | - vim.g.clipboard = { | |
| 11 | +local clipboards = { | |
| 12 | + xclip = { | |
| 16 | 13 | name = "xclip", |
| 17 | 14 | copy = { |
| 18 | 15 | ["+"] = "xclip -selection clipboard", |
| @@ -23,7 +20,20 @@ if vim.fn.getenv("WAYLAND_DISPLAY") ~= vim.NIL then | ||
| 23 | 20 | ["*"] = "xclip -selection primary -o", |
| 24 | 21 | }, |
| 25 | 22 | cache_enabled = 1, |
| 26 | - } | |
| 23 | + }, | |
| 24 | + wayland = { | |
| 25 | + name = "wl-clipboard", | |
| 26 | + copy = { ["+"] = "wl-copy", ["*"] = "wl-copy" }, | |
| 27 | + paste = { | |
| 28 | + ["+"] = "wl-paste --no-newline", | |
| 29 | + ["*"] = "wl-paste --no-newline", | |
| 30 | + }, | |
| 31 | + cache_enabled = 1, | |
| 32 | + }, | |
| 33 | +} | |
| 34 | +-- wayland settings | |
| 35 | +if vim.fn.getenv("WAYLAND_DISPLAY") ~= vim.NIL then | |
| 36 | + vim.g.clipboard = clipboards.wayland | |
| 27 | 37 | end |
| 28 | 38 | |
| 29 | 39 | -- disable animations |