From 10278b1d0111b7fb6941eaa8b7af0f88895b4535 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Mon, 5 Jan 2026 15:22:39 +0100 Subject: Überarbeitete Version der Bindings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nvim/lua/config/keymaps.lua | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) (limited to 'nvim') diff --git a/nvim/lua/config/keymaps.lua b/nvim/lua/config/keymaps.lua index c54247c..6e4adfe 100644 --- a/nvim/lua/config/keymaps.lua +++ b/nvim/lua/config/keymaps.lua @@ -5,7 +5,6 @@ local map = vim.keymap.set function M.lsp(buffer, client) local opts = { buffer = buffer, - noremap = true, silent = true, } @@ -25,7 +24,6 @@ end function M.telescope() local opts = { - noremap = true, silent = true, } @@ -52,18 +50,49 @@ end function M.global() local opts = { - noremap = true, silent = true, } map("n", "ö", "}", opts) map("n", "ä", "{", opts) + -- besseres Verhalten von + -- https://vimrc-dissection.blogspot.com/2009/02/fixing-pageup-and-pagedown.html + map("n", "", "1000", opts) + map("n", "", "1000", opts) + map("i", "", "1000", opts) + map("i", "", "1000", opts) + + -- Verschiebe Zeilen mit Alt+j / Alt+k + map("n", "", ":m .+1==", opts) + map("n", "", ":m .-2==", opts) + map("i", "", ":m .+1==gi", opts) + map("i", "", ":m .-2==gi", opts) + map("x", "", ":m '>+1gv=gv", opts) + map("x", "", ":m '<-2gv=gv", opts) + + -- besseres Verhalten in umbrochenen Texten + map({ "n", "x", "o" }, "j", function() + return vim.v.count == 0 and "gj" or "j" + end, { expr = true, silent = true }) + + map({ "n", "x", "o" }, "k", function() + return vim.v.count == 0 and "gk" or "k" + end, { expr = true, silent = true }) + + map("n", "", "make", opts) + + -- Kombinationen mit Leader-Key map("n", "K", function() vim.diagnostic.open_float({ scope = "cursor", border = "rounded" }) end, opts) + map("n", "q", vim.diagnostic.setloclist, opts) + map("n", "ts", function() + vim.opt_local.spell = not vim.opt_local.spell:get() + end, { desc = "Toggle spell checking" }) + map("n", "[d", function() vim.diagnostic.jump_prev({ wrap = false }) end, opts) @@ -85,10 +114,6 @@ function M.global() wrap = false }) end, opts) - - vim.keymap.set("n", "ts", function() - vim.opt_local.spell = not vim.opt_local.spell:get() - end, { desc = "Toggle spell checking" }) end return M -- cgit v1.3