aboutsummaryrefslogtreecommitdiff
path: root/nvim
diff options
context:
space:
mode:
authorThomas Schmucker <ts@its1.de>2026-01-05 15:22:39 +0100
committerThomas Schmucker <ts@its1.de>2026-01-05 15:22:39 +0100
commit10278b1d0111b7fb6941eaa8b7af0f88895b4535 (patch)
tree7a4729683be960c915e260ada5225028d12d891a /nvim
parentde9f2b7f57d983c6c1e8e52351dfe6fb9200268b (diff)
downloaddotfiles-10278b1d0111b7fb6941eaa8b7af0f88895b4535.tar.gz
dotfiles-10278b1d0111b7fb6941eaa8b7af0f88895b4535.tar.bz2
dotfiles-10278b1d0111b7fb6941eaa8b7af0f88895b4535.zip
Überarbeitete Version der Bindings
Diffstat (limited to 'nvim')
-rw-r--r--nvim/lua/config/keymaps.lua39
1 files changed, 32 insertions, 7 deletions
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
5function M.lsp(buffer, client) 5function M.lsp(buffer, client)
6 local opts = { 6 local opts = {
7 buffer = buffer, 7 buffer = buffer,
8 noremap = true,
9 silent = true, 8 silent = true,
10 } 9 }
11 10
@@ -25,7 +24,6 @@ end
25 24
26function M.telescope() 25function M.telescope()
27 local opts = { 26 local opts = {
28 noremap = true,
29 silent = true, 27 silent = true,
30 } 28 }
31 29
@@ -52,18 +50,49 @@ end
52 50
53function M.global() 51function M.global()
54 local opts = { 52 local opts = {
55 noremap = true,
56 silent = true, 53 silent = true,
57 } 54 }
58 55
59 map("n", "ö", "}", opts) 56 map("n", "ö", "}", opts)
60 map("n", "ä", "{", opts) 57 map("n", "ä", "{", opts)
61 58
59 -- besseres Verhalten von <PageUp und <PageDown>
60 -- https://vimrc-dissection.blogspot.com/2009/02/fixing-pageup-and-pagedown.html
61 map("n", "<PageUp>", "1000<C-u>", opts)
62 map("n", "<PageDown>", "1000<C-d>", opts)
63 map("i", "<PageUp>", "<C-o>1000<C-u>", opts)
64 map("i", "<PageDown>", "<C-o>1000<C-d>", opts)
65
66 -- Verschiebe Zeilen mit Alt+j / Alt+k
67 map("n", "<M-j>", ":m .+1<CR>==", opts)
68 map("n", "<M-k>", ":m .-2<CR>==", opts)
69 map("i", "<M-j>", "<Esc>:m .+1<CR>==gi", opts)
70 map("i", "<M-k>", "<Esc>:m .-2<CR>==gi", opts)
71 map("x", "<M-j>", ":m '>+1<CR>gv=gv", opts)
72 map("x", "<M-k>", ":m '<-2<CR>gv=gv", opts)
73
74 -- besseres Verhalten in umbrochenen Texten
75 map({ "n", "x", "o" }, "j", function()
76 return vim.v.count == 0 and "gj" or "j"
77 end, { expr = true, silent = true })
78
79 map({ "n", "x", "o" }, "k", function()
80 return vim.v.count == 0 and "gk" or "k"
81 end, { expr = true, silent = true })
82
83 map("n", "<F5>", "<cmd>make<CR>", opts)
84
85 -- Kombinationen mit Leader-Key
62 map("n", "<leader>K", function() 86 map("n", "<leader>K", function()
63 vim.diagnostic.open_float({ scope = "cursor", border = "rounded" }) 87 vim.diagnostic.open_float({ scope = "cursor", border = "rounded" })
64 end, opts) 88 end, opts)
89
65 map("n", "<leader>q", vim.diagnostic.setloclist, opts) 90 map("n", "<leader>q", vim.diagnostic.setloclist, opts)
66 91
92 map("n", "<leader>ts", function()
93 vim.opt_local.spell = not vim.opt_local.spell:get()
94 end, { desc = "Toggle spell checking" })
95
67 map("n", "[d", function() 96 map("n", "[d", function()
68 vim.diagnostic.jump_prev({ wrap = false }) 97 vim.diagnostic.jump_prev({ wrap = false })
69 end, opts) 98 end, opts)
@@ -85,10 +114,6 @@ function M.global()
85 wrap = false 114 wrap = false
86 }) 115 })
87 end, opts) 116 end, opts)
88
89 vim.keymap.set("n", "<leader>ts", function()
90 vim.opt_local.spell = not vim.opt_local.spell:get()
91 end, { desc = "Toggle spell checking" })
92end 117end
93 118
94return M 119return M