diff --git a/config/nvim/lua/fschauen/options.lua b/config/nvim/lua/fschauen/options.lua index a7da6f7..9d4f0c8 100644 --- a/config/nvim/lua/fschauen/options.lua +++ b/config/nvim/lua/fschauen/options.lua @@ -23,12 +23,6 @@ M.setup = function() o.modelines = 0 -- never use modelines o.fileformats = "unix,mac,dos" -- prioritize unix format o.winblend = 8 -- minimum transparency for floating windows - - -- Schedule the setting after `UiEnter` because it can increase startup-time. - vim.schedule(function() - o.clipboard = "unnamedplus" -- synchronize with system clipboard - end) - o.swapfile = false -- don"t use swap files o.writebackup = true -- Make a backup before writing a file... o.backup = false -- ...but don"t keep it around. @@ -44,6 +38,23 @@ M.setup = function() "s100", -- limit size of remembered items to this many KiB } + --- Clipboard + if vim.fn.has("wsl") == 1 then + vim.g.clipboard = { + name = "WslClipboard", + copy = { + ["+"] = "clip.exe", + ["*"] = "clip.exe", + }, + paste = { + ["+"] = 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))', + ["*"] = 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))', + }, + cache_enabled = 0, + } + end + o.clipboard = "unnamedplus" -- synchronize with system clipboard + -- Searching o.ignorecase = true -- Ignore case when searching... o.smartcase = true -- ...unless pattern contains uppercase characters.