summaryrefslogtreecommitdiff
path: root/lua/config/map.lua
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-09-18 00:58:26 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-09-18 00:58:28 +0200
commitcb36ccfa8db66db953795fd8e22138ed1712b1cd (patch)
treefc0f8ef4e73c5fa7fb627d383a991aeb49a59bca /lua/config/map.lua
parent424ad679f861031485e2e2f0ca19f5b559db929b (diff)
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 <c-k> keybind - removed cmp's calc source - renamed keybinds for consistency - reorganized plugins in lazy.lua
Diffstat (limited to 'lua/config/map.lua')
-rw-r--r--lua/config/map.lua24
1 files changed, 11 insertions, 13 deletions
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", "<leader>p", [["_dP]], { desc = "Paste while keeping the registry" })
-- moving
map("i", "<C-a>", "<C-o>I", { noremap = true })
map("i", "<C-e>", "<C-o>A", { noremap = true })
-map("i", "<C-k>", "<C-o>D", { noremap = true })
-- buffers
map("n", "<leader>sp", "<cmd>sp<cr>", { desc = "Open horizontal split" })
@@ -53,18 +52,17 @@ map({ "n", "v" }, "<leader>d", [["_d]])
map("n", "<LocalLeader>rt", ":-1r " .. vim.fn.stdpath("config") .. "/templates", { noremap = true })
-- hide all
-local s = { hidden_all = 0 }
-map("n", "<C-h>", 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", "<Leader>w", "<cmd>write<cr>", { noremap = true })