From e8315399fb7a337ac496c776048a38599716bdb9 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 6 Oct 2024 17:11:48 +0200 Subject: checkpoint --- lua/config/lazy.lua | 1 + lua/config/map.lua | 37 +++++++++++++++++++------------------ 2 files changed, 20 insertions(+), 18 deletions(-) (limited to 'lua') diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index b8b5927..7e4752b 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -15,6 +15,7 @@ vim.opt.rtp:prepend(lazypath) -- plugins installation and configuration require("lazy").setup({ "echasnovski/mini.nvim", + "tpope/vim-fugitive", "lewis6991/gitsigns.nvim", "tpope/vim-vinegar", "tpope/vim-eunuch", diff --git a/lua/config/map.lua b/lua/config/map.lua index 85c1e0f..1ce241d 100644 --- a/lua/config/map.lua +++ b/lua/config/map.lua @@ -20,20 +20,19 @@ map("n", "N", "Nzzzv", { desc = "Keep cursor in middle with search" }) map("n", "J", "mzJ`z", { desc = "Move up next line with space in between" }) -- greatest remap ever -map("x", "p", [["_dP]], { desc = "Paste while keeping the registry" }) +map("x", " p", [["_dP]], { desc = "Paste while keeping the registry" }) -- moving map("i", "", "I", { noremap = true }) map("i", "", "A", { noremap = true }) -- buffers -map("n", "sp", "sp", { desc = "Open horizontal split" }) -map("n", "vs", "vs", { desc = "Open vertical split" }) -map("n", "gb", "buffers:buffer", { noremap = true }) -map("n", "q", "q!", { noremap = true }) -map("n", "Q", "qa!", { noremap = true }) +map("n", " sp", "sp", { desc = "Open horizontal split" }) +map("n", " vs", "vs", { desc = "Open vertical split" }) +map("n", " q", "q!", { noremap = true }) +map("n", " Q", "qa!", { noremap = true }) -- close all except focused buffer -map("n", "1", "%bd|e#", { noremap = true }) +map("n", " 1", "%bd|e#", { noremap = true }) -- next tab map("n", "+", "tabe .", { noremap = true }) @@ -42,11 +41,9 @@ map("v", "<", "", ">gv") -- allow for use of system clipboard fast -map({ "n", "v" }, "y", [["+y]]) -map("n", "Y", [["+Y]]) -map({ "n", "v" }, "P", [["+p]]) - -map({ "n", "v" }, "d", [["_d]]) +map({ "n", "v" }, " y", [["+y]]) +map("n", " Y", [["+Y]]) +map({ "n", "v" }, " P", [["+p]]) -- templates map("n", "rt", ":-1r " .. vim.fn.stdpath("config") .. "/templates", { noremap = true }) @@ -65,17 +62,21 @@ vim.api.nvim_create_user_command("Hide", function() end, {}) -- write -map("n", "w", "write", { noremap = true }) -map("n", "W", "write!", { noremap = true }) -map("n", "e", "edit", { noremap = true }) -map("n", "s", function() +map("n", " w", "write", { noremap = true }) +map("n", " W", "write!", { noremap = true }) +map("n", " e", "edit", { noremap = true }) +map("n", ",s", function() vim.cmd.source() print("sourced.") end, { noremap = true }) -- Lazy -map("n", "P", "Lazy", { noremap = true }) +map("n", " P", "Lazy", { noremap = true }) -- spelling -map("n", "s", "setlocal spell!", { noremap = true }) +map("n", " ts", "setlocal spell!", { noremap = true, desc = "Toggle spelling" }) map("n", "g", "z=1", { noremap = true }) + +map("n", " td", function() + vim.diagnostic.enable(vim.diagnostic.is_enabled() == false) +end, { desc = "Toggle diagnostics" }) -- cgit v1.2.3