Skip to content

Commit

Permalink
fix clipboard error in WSL”
Browse files Browse the repository at this point in the history
  • Loading branch information
guodongq committed Sep 29, 2024
1 parent 32aec52 commit 716b9cd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
20 changes: 18 additions & 2 deletions nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,21 @@ vim.schedule(function()
vim.opt.clipboard = "unnamedplus"
end)

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

-- Enable break indent
vim.opt.breakindent = true

Expand Down Expand Up @@ -1294,7 +1309,7 @@ require("lazy").setup({
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
"folke/tokyonight.nvim",
priority = 1000, -- Make sure to load this before all the other start plugins.
enabled = true,
enabled = false,
init = function()
-- Load the colorscheme here.
-- Like many other themes, this one has different styles, and you could load
Expand All @@ -1307,7 +1322,7 @@ require("lazy").setup({
},
{ -- Gruvbox
"ellisonleao/gruvbox.nvim",
enabled = false,
enabled = true,
--lazy = false,
-- config = false,
priority = 1000,
Expand Down Expand Up @@ -1776,6 +1791,7 @@ require("lazy").setup({
{ -- Highlight todo, notes, etc in comments
"folke/todo-comments.nvim",
event = "VimEnter",
enabled = false,
dependencies = { "nvim-lua/plenary.nvim" },
opts = { signs = false },
-- stylua: ignore
Expand Down
3 changes: 1 addition & 2 deletions nvim/lazy-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"conform.nvim": { "branch": "master", "commit": "1a99fdc1d3aa9ccdf3021e67982a679a8c5c740c" },
"fidget.nvim": { "branch": "main", "commit": "d855eed8a06531a7e8fd0684889b2943f373c469" },
"friendly-snippets": { "branch": "main", "commit": "00ba9dd3df89509f95437b8d595553707c46d5ea" },
"gitsigns.nvim": { "branch": "main", "commit": "863903631e676b33e8be2acb17512fdc1b80b4fb" },
"gruvbox.nvim": { "branch": "main", "commit": "7a1b23e4edf73a39642e77508ee6b9cbb8c60f9e" },
"hop.nvim": { "branch": "master", "commit": "8f51ef02700bb3cdcce94e92eff16170a6343c4f" },
"indent-blankline.nvim": { "branch": "master", "commit": "18603eb949eba08300799f64027af11ef922283f" },
Expand All @@ -30,7 +29,7 @@
"nvim-lspconfig": { "branch": "master", "commit": "76e7c8b029e6517f3689390d6599e9b446551704" },
"nvim-spectre": { "branch": "master", "commit": "ba7fb777edff6c1fbbeffd343e113af64c04e90a" },
"nvim-tree.lua": { "branch": "master", "commit": "e7cdecc6363acef8232f2f099fe21096ffdc071f" },
"nvim-treesitter": { "branch": "master", "commit": "707313b80a2f1e65fa06dba2052cc49ce6762a60" },
"nvim-treesitter": { "branch": "master", "commit": "140f534ce9c02189921b80f5c8a68ab9e3f92ce8" },
"nvim-web-devicons": { "branch": "master", "commit": "1e5a2a796a88b5d696acb07dd5c285b13d13da21" },
"nvim-window": { "branch": "main", "commit": "81f29840ac3aaeea6fc2153edfabebd00d692476" },
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
Expand Down

0 comments on commit 716b9cd

Please sign in to comment.