From 88b6abb76bd9a1b251f6a717ab38f3bd71f3cce3 Mon Sep 17 00:00:00 2001 From: Roman Date: Thu, 25 Jun 2026 22:11:43 +0200 Subject: [PATCH] start remapping stuff --- nvim/.config/nvim/lua/romanzy/remap.lua | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/nvim/.config/nvim/lua/romanzy/remap.lua b/nvim/.config/nvim/lua/romanzy/remap.lua index 073b436..0c8d753 100644 --- a/nvim/.config/nvim/lua/romanzy/remap.lua +++ b/nvim/.config/nvim/lua/romanzy/remap.lua @@ -1,12 +1,27 @@ vim.g.mapleader = " " vim.g.maplocalleader = " " +--- @param mode string|string[] +--- @param lhs string|string[] +--- @param rhs string|function +--- @param opts? vim.keymap.set.Opts +local map = function(mode, lhs, rhs, opts) + if type(lhs) == "table" then + for _, cmd in ipairs(lhs) do + vim.keymap.set(mode, cmd, rhs, opts) + end + else + vim.keymap.set(mode, lhs, rhs, opts) + end +end + local function telescope_picker(picker) return function() require("telescope.builtin")[picker]() end end +map("n", "r", ":source ~/.config/nvim/init.lua", { desc = "reload init.lua" }) vim.keymap.set("n", "dl", "Oil") vim.keymap.set("n", "nl", vim.cmd.Ex) vim.keymap.set("n", "ff", telescope_picker("find_files")) @@ -57,10 +72,10 @@ vim.api.nvim_create_autocmd("FileType", { end, }) --- disable normie mouse stuff -for _, key in ipairs({ "", "", "", "" }) do - vim.keymap.set({ "n", "i", "v", "x", "s", "o", "c" }, key, "") -end +-- hjkl supremacy +map({ "n", "i", "v", "x", "s", "o", "c" }, { "", "", "", "" }, function() + vim.notify('hjkl supremacy', vim.log.levels.ERROR) +end, { desc = "hjkl supremacy" }) vim.keymap.set("n", "g.", vim.diagnostic.open_float) vim.keymap.set("n", "gl", vim.diagnostic.setloclist)