aboutsummaryrefslogtreecommitdiff
path: root/nvim/lua/config/keymaps.lua
diff options
context:
space:
mode:
Diffstat (limited to 'nvim/lua/config/keymaps.lua')
-rw-r--r--nvim/lua/config/keymaps.lua23
1 files changed, 19 insertions, 4 deletions
diff --git a/nvim/lua/config/keymaps.lua b/nvim/lua/config/keymaps.lua
index a665e82..4b280ef 100644
--- a/nvim/lua/config/keymaps.lua
+++ b/nvim/lua/config/keymaps.lua
@@ -22,9 +22,24 @@ function M.lsp(buffer, client)
22 }) 22 })
23 end, opts) 23 end, opts)
24 24
25 if client and client.name == "clangd" then 25 local function set_c_bindings()
26 map("n", "<leader>hs", "<cmd>ClangdSwitchSourceHeader<cr>", opts) 26 if client and client.name == "clangd" then map("n", "<leader>hs", "<cmd>ClangdSwitchSourceHeader<cr>", opts) end
27 end 27 end
28
29 local function set_python_bindings()
30 if client and (client.name == "basedpyright" or client.name == "pyright" or client.name == "pylsp") then
31 local function run_pytest()
32 vim.cmd("botright split | terminal pytest")
33 end
34
35 map("n", "<F6>", run_pytest, {
36 desc = "Run pytest (nur Python-Projekt)",
37 })
38 end
39 end
40
41 set_c_bindings()
42 set_python_bindings()
28end 43end
29 44
30function M.telescope() 45function M.telescope()
@@ -110,14 +125,14 @@ function M.global()
110 map("n", "[e", function() 125 map("n", "[e", function()
111 vim.diagnostic.jump_prev({ 126 vim.diagnostic.jump_prev({
112 severity = vim.diagnostic.severity.ERROR, 127 severity = vim.diagnostic.severity.ERROR,
113 wrap = false 128 wrap = false,
114 }) 129 })
115 end, opts) 130 end, opts)
116 131
117 map("n", "]e", function() 132 map("n", "]e", function()
118 vim.diagnostic.jump_next({ 133 vim.diagnostic.jump_next({
119 severity = vim.diagnostic.severity.ERROR, 134 severity = vim.diagnostic.severity.ERROR,
120 wrap = false 135 wrap = false,
121 }) 136 })
122 end, opts) 137 end, opts)
123end 138end