From cb36ccfa8db66db953795fd8e22138ed1712b1cd Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 18 Sep 2024 00:58:26 +0200 Subject: checkpoint - added basic luasnip configuration - added highlights for TODO and FIXME keywords - added incremental selection of treesitter - added prettier to conform formatters - added when_disabled function to disable pairs in comments - changed the hiding keybind to :Hide command - only enable ` pairs in markdown - removed keybind - removed cmp's calc source - renamed keybinds for consistency - reorganized plugins in lazy.lua --- lua/config/map.lua | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'lua/config/map.lua') diff --git a/lua/config/map.lua b/lua/config/map.lua index 230588f..85c1e0f 100644 --- a/lua/config/map.lua +++ b/lua/config/map.lua @@ -25,7 +25,6 @@ map("x", "p", [["_dP]], { desc = "Paste while keeping the registry" }) -- moving map("i", "", "I", { noremap = true }) map("i", "", "A", { noremap = true }) -map("i", "", "D", { noremap = true }) -- buffers map("n", "sp", "sp", { desc = "Open horizontal split" }) @@ -53,18 +52,17 @@ map({ "n", "v" }, "d", [["_d]]) map("n", "rt", ":-1r " .. vim.fn.stdpath("config") .. "/templates", { noremap = true }) -- hide all -local s = { hidden_all = 0 } -map("n", "", function() - s.hidden_all = 1 - s.hidden_all - local opt = s.hidden_all == 0 - vim.opt.showmode = opt - vim.opt.ruler = opt - vim.opt.nu = opt - vim.opt.rnu = opt - vim.opt.showcmd = opt - vim.opt.laststatus = opt and 2 or 0 - vim.opt.signcolumn = opt and "yes" or "no" -end, { noremap = true }) +local hidden = true -- flag +vim.api.nvim_create_user_command("Hide", function() + hidden = hidden == false + vim.opt.showmode = hidden + vim.opt.ruler = hidden + vim.opt.nu = hidden + vim.opt.rnu = hidden + vim.opt.showcmd = hidden + vim.opt.laststatus = hidden and 2 or 0 + vim.opt.signcolumn = hidden and "yes" or "no" +end, {}) -- write map("n", "w", "write", { noremap = true }) -- cgit v1.2.3