use of system clipboard

This commit is contained in:
2026-06-28 19:14:38 +02:00
parent 26c53fe210
commit 02721b097e
2 changed files with 21 additions and 15 deletions

View File

@@ -42,6 +42,11 @@ map("n", "<leader>bp", "<Cmd>bprevious<CR>", { desc = "prev buffer" })
map("n", "<leader>bn", "<Cmd>bnext<CR>", { desc = "next buffer" }) map("n", "<leader>bn", "<Cmd>bnext<CR>", { desc = "next buffer" })
map("n", "<leader>bd", "<Cmd>bdelete<CR>", { desc = "delete buffer" }) map("n", "<leader>bd", "<Cmd>bdelete<CR>", { desc = "delete buffer" })
map({ "n", "v" }, "<leader>y", '"+y', { desc = "yank to system clipboard" })
map("n", "<leader>Y", '"+Y', { desc = "yank line to system clipboard" })
map("n", "<leader>p", '"+p', { desc = "paste from system clipboard" })
map("n", "<leader>P", '"+P', { desc = "paste before from system clipboard" })
map("t", "<C-Esc>", "<C-\\><C-n>", { desc = "exit terminal" }) map("t", "<C-Esc>", "<C-\\><C-n>", { desc = "exit terminal" })
map("t", "\\<Esc>", "<C-\\><C-n>", { desc = "exit terminal" }) map("t", "\\<Esc>", "<C-\\><C-n>", { desc = "exit terminal" })
@@ -66,21 +71,6 @@ map({ "n", "i", "v", "x", "s", "o", "c" }, { "<left>", "<right>", "<up>", "<down
vim.notify('hjkl supremacy', vim.log.levels.ERROR) vim.notify('hjkl supremacy', vim.log.levels.ERROR)
end, { desc = "hjkl supremacy" }) end, { desc = "hjkl supremacy" })
map("n", "g.", vim.diagnostic.open_float, { desc = "line diagnostics" })
map("n", "gl", vim.diagnostic.setloclist, { desc = "diagnostic list" })
-- diagnostics only on error.
map("n", "g]", function()
vim.lsp.diagnostic.goto_next({
severity = vim.diagnostic.severity.ERROR,
})
end, { desc = "next error" })
map("n", "g[", function()
vim.lsp.diagnostic.goto_prev({
severity = vim.diagnostic.severity.ERROR,
})
end, { desc = "prev error" })
local function rename_without_default() local function rename_without_default()
vim.ui.input({ vim.ui.input({
prompt = "New Name: ", prompt = "New Name: ",
@@ -104,6 +94,21 @@ vim.api.nvim_create_autocmd("LspAttach", {
end, end,
}) })
map("n", "g.", vim.diagnostic.open_float, { desc = "line diagnostics" })
map("n", "gl", vim.diagnostic.setloclist, { desc = "diagnostic list" })
-- diagnostics only on error.
map("n", "g]", function()
vim.lsp.diagnostic.goto_next({
severity = vim.diagnostic.severity.ERROR,
})
end, { desc = "next error" })
map("n", "g[", function()
vim.lsp.diagnostic.goto_prev({
severity = vim.diagnostic.severity.ERROR,
})
end, { desc = "prev error" })
map("n", "gle", vim.diagnostic.setloclist, { desc = "display error information" }) map("n", "gle", vim.diagnostic.setloclist, { desc = "display error information" })
map("n", "gie", function() map("n", "gie", function()
vim.diagnostic.config({ virtual_text = not vim.diagnostic.config().virtual_text }) vim.diagnostic.config({ virtual_text = not vim.diagnostic.config().virtual_text })

View File

@@ -3,6 +3,7 @@ local o = vim.opt
g.mapleader = " " -- Uses space as the global leader key. g.mapleader = " " -- Uses space as the global leader key.
g.maplocalleader = " " -- Uses space as the local leader key. g.maplocalleader = " " -- Uses space as the local leader key.
g.clipboard = "osc52" -- Routes the + and * registers through OSC52 in terminal Neovim.
o.number = true -- Shows absolute line numbers. o.number = true -- Shows absolute line numbers.
o.relativenumber = true -- Shows relative numbers for easier motion. o.relativenumber = true -- Shows relative numbers for easier motion.