From 6317be3b2bd54cfbb85894d950c24d2e1b5aaef8 Mon Sep 17 00:00:00 2001 From: sudacode Date: Fri, 22 Aug 2025 01:37:01 -0700 Subject: [PATCH] update nvim config --- .config/nvim/lua/core/keymaps.lua | 3 ++- .config/nvim/lua/plugins/gitsigns.lua | 2 +- .config/nvim/lua/plugins/lspconfig.lua | 6 ++++++ .config/nvim/lua/plugins/nvim-lint.lua | 14 ++++++++++++++ 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.config/nvim/lua/core/keymaps.lua b/.config/nvim/lua/core/keymaps.lua index 3c183af..c96fd71 100644 --- a/.config/nvim/lua/core/keymaps.lua +++ b/.config/nvim/lua/core/keymaps.lua @@ -158,7 +158,8 @@ local lsp_mappings = { { mode = "n", key = "gDf", cmd = ":Telescope lsp_definitions", group = "LSP Definitions" }, { mode = "n", key = "gF", cmd = ":edit ", group = "Edit File" }, { mode = "n", key = "gT", cmd = ":Telescope lsp_type_definitions", group = "LSP Type Definitions" }, - { mode = "n", key = "gb", cmd = ":Gitsigns blame_line", group = "Git Blame" }, + { mode = "n", key = "gb", cmd = ":Gitsigns blame_line", group = "Blame Line" }, + { mode = "n", key = "gb", cmd = ":Gitsigns blame", group = "Git Blame" }, { mode = "n", key = "gi", cmd = ":Telescope lsp_implementations", group = "Telescope Implementations" }, { mode = "n", key = "gj", cmd = ":Telescope jumplist", group = "Telescope Jumplist" }, { mode = "n", key = "gr", cmd = ":Telescope lsp_references", goup = "LSP References" }, diff --git a/.config/nvim/lua/plugins/gitsigns.lua b/.config/nvim/lua/plugins/gitsigns.lua index 671fcd6..de5fd5a 100644 --- a/.config/nvim/lua/plugins/gitsigns.lua +++ b/.config/nvim/lua/plugins/gitsigns.lua @@ -29,7 +29,7 @@ return { current_line_blame_opts = { virt_text = true, virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' - delay = 1000, + delay = 500, ignore_whitespace = false, virt_text_priority = 100, }, diff --git a/.config/nvim/lua/plugins/lspconfig.lua b/.config/nvim/lua/plugins/lspconfig.lua index 5bcf2e9..efc6358 100644 --- a/.config/nvim/lua/plugins/lspconfig.lua +++ b/.config/nvim/lua/plugins/lspconfig.lua @@ -64,6 +64,7 @@ return { -- Depending on the usage, you might want to add additional paths here. -- "${3rd}/luv/library", -- "${3rd}/busted/library", + "/usr/lib/lua-language-server/meta/3rd/busted/library", }, -- or pull in all of 'runtimepath'. NOTE: this is a lot slower and will cause issues when working on your own configuration (see https://github.com/neovim/nvim-lspconfig/issues/3189) -- library = vim.api.nvim_get_runtime_file("", true) @@ -74,6 +75,11 @@ return { Lua = {}, }, handlers = {}, + root_dir = function(bufnr, on_dir) + if not vim.fn.bufname(bufnr):match("%.txt$") then + on_dir(vim.fn.getcwd()) + end + end, }) vim.lsp.enable(lsp) elseif lsp == "basedpyright" then diff --git a/.config/nvim/lua/plugins/nvim-lint.lua b/.config/nvim/lua/plugins/nvim-lint.lua index f4759cd..b18943f 100644 --- a/.config/nvim/lua/plugins/nvim-lint.lua +++ b/.config/nvim/lua/plugins/nvim-lint.lua @@ -20,6 +20,20 @@ return { "-e", "2250", } + -- Save original function + local orig_try_lint = lint.try_lint + + lint.try_lint = function(...) + local bufnr = vim.api.nvim_get_current_buf() + local buftype = vim.api.nvim_get_option_value("buftype", { buf = bufnr }) + + -- Skip linting for non-file buffers (like hover docs) + if buftype ~= "" then + return + end + + return orig_try_lint(...) + end vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, { callback = function()