From 74d64eb80b81ef2fa8aeb1abbd36af2e6fc86819 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Fri, 16 Jan 2026 10:35:58 +0100 Subject: neovim: reformat code, keybindings für pytest, und spell=false MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nvim/lua/config/keymaps.lua | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'nvim/lua/config/keymaps.lua') 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) }) end, opts) - if client and client.name == "clangd" then - map("n", "hs", "ClangdSwitchSourceHeader", opts) + local function set_c_bindings() + if client and client.name == "clangd" then map("n", "hs", "ClangdSwitchSourceHeader", opts) end end + + local function set_python_bindings() + if client and (client.name == "basedpyright" or client.name == "pyright" or client.name == "pylsp") then + local function run_pytest() + vim.cmd("botright split | terminal pytest") + end + + map("n", "", run_pytest, { + desc = "Run pytest (nur Python-Projekt)", + }) + end + end + + set_c_bindings() + set_python_bindings() end function M.telescope() @@ -110,14 +125,14 @@ function M.global() map("n", "[e", function() vim.diagnostic.jump_prev({ severity = vim.diagnostic.severity.ERROR, - wrap = false + wrap = false, }) end, opts) map("n", "]e", function() vim.diagnostic.jump_next({ severity = vim.diagnostic.severity.ERROR, - wrap = false + wrap = false, }) end, opts) end -- cgit v1.3