start remapping stuff

This commit is contained in:
2026-06-25 22:11:43 +02:00
parent 93a04738a4
commit 88b6abb76b

View File

@@ -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", "<leader><leader>r", ":source ~/.config/nvim/init.lua<CR>", { desc = "reload init.lua" })
vim.keymap.set("n", "<leader>dl", "<Cmd>Oil<CR>")
vim.keymap.set("n", "<leader>nl", vim.cmd.Ex)
vim.keymap.set("n", "<leader>ff", telescope_picker("find_files"))
@@ -57,10 +72,10 @@ vim.api.nvim_create_autocmd("FileType", {
end,
})
-- disable normie mouse stuff
for _, key in ipairs({ "<Up>", "<Down>", "<Left>", "<Right>" }) do
vim.keymap.set({ "n", "i", "v", "x", "s", "o", "c" }, key, "<Nop>")
end
-- hjkl supremacy
map({ "n", "i", "v", "x", "s", "o", "c" }, { "<left>", "<right>", "<up>", "<down>" }, 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)