From b8772ae9b4317d6af8e3e397b57c133121656848 Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Sun, 15 Jun 2025 19:19:53 -0700 Subject: [PATCH] Add shortcuts to navigate issues and buffer tabs --- .config/nvim/lua/plugins/chrome.lua | 2 + .config/nvim/lua/plugins/language-server.lua | 92 ++++++++++---------- 2 files changed, 49 insertions(+), 45 deletions(-) diff --git a/.config/nvim/lua/plugins/chrome.lua b/.config/nvim/lua/plugins/chrome.lua index 085f20b..4c45a7c 100644 --- a/.config/nvim/lua/plugins/chrome.lua +++ b/.config/nvim/lua/plugins/chrome.lua @@ -57,6 +57,8 @@ return { "goolord/alpha-nvim", vim.keymap.set("n", "", ":BufferPrevious", { desc = "Previous Buffer" }), vim.keymap.set("n", "", ":BufferNext", { desc = "Next Buffer" }), + vim.keymap.set("n", "", ":BufferPrevious", { desc = "Previous Buffer" }), + vim.keymap.set("n", "", ":BufferNext", { desc = "Next Buffer" }), vim.keymap.set("n", "bq", ":BufferClose", { desc = "Close Buffer" }), vim.keymap.set("n", "", ":BufferClose", { desc = "Close Buffer" }), vim.keymap.set("n", "bp", ":BufferPrevious", { desc = "Previous Buffer" }), diff --git a/.config/nvim/lua/plugins/language-server.lua b/.config/nvim/lua/plugins/language-server.lua index d670176..c31df54 100644 --- a/.config/nvim/lua/plugins/language-server.lua +++ b/.config/nvim/lua/plugins/language-server.lua @@ -64,51 +64,53 @@ return { "mason-org/mason.nvim", "mason-org/mason-lspconfig.nvim", "WhoIsSethDaniel/mason-tool-installer.nvim", - }, - config = function() - local capabilities = require("cmp_nvim_lsp").default_capabilities() - local lspconfig = require("lspconfig") - lspconfig.ts_ls.setup({ - capabilities = capabilities, - }) - lspconfig.lua_ls.setup({ capabilities = capabilities }) - lspconfig.bashls.setup({ - capabilities = capabilities, - cmd = { "bash-language-server", "start" }, - filetypes = { "sh", "bash" }, - }) - lspconfig.gh_actions_ls.setup({ capabilities = capabilities }) - -- lspconfig.helm_ls.setup({ capabilities = capabilities }) - lspconfig.jsonls.setup({ capabilities = capabilities }) - lspconfig.basedpyright.setup({ - capabilities = capabilities, - settings = { - basedpyright = { - analysis = { - typeCheckingMode = "off", - diagnosticSeverityOverrides = { - reportUnusedImport = false, - reportUnusedVariable = false, - }, - }, - }, - }, - }) - lspconfig.nginx_language_server.setup({ capabilities = capabilities }) - lspconfig.ruff.setup({ - capabilities = capabilities, - init_options = { - settings = { - lineLength = 79, - }, - }, - }) - lspconfig.yamlls.setup({ capabilities = capabilities }) - vim.keymap.set("n", "vd", vim.lsp.buf.hover, { desc = "View Docstring" }) - vim.keymap.set("n", "gt", vim.lsp.buf.definition, { desc = "Go To Definition" }) - vim.keymap.set("n", "ca", vim.lsp.buf.code_action, { desc = "Show Code Actions" }) + }, + config = function() + local capabilities = require("cmp_nvim_lsp").default_capabilities() + local lspconfig = require("lspconfig") + lspconfig.ts_ls.setup({ + capabilities = capabilities, + }) + lspconfig.lua_ls.setup({ capabilities = capabilities }) + lspconfig.bashls.setup({ + capabilities = capabilities, + cmd = { "bash-language-server", "start" }, + filetypes = { "sh", "bash" }, + }) + lspconfig.gh_actions_ls.setup({ capabilities = capabilities }) + -- lspconfig.helm_ls.setup({ capabilities = capabilities }) + lspconfig.jsonls.setup({ capabilities = capabilities }) + lspconfig.basedpyright.setup({ + capabilities = capabilities, + settings = { + basedpyright = { + analysis = { + typeCheckingMode = "off", + diagnosticSeverityOverrides = { + reportUnusedImport = false, + reportUnusedVariable = false, + }, + }, + }, + }, + }) + lspconfig.nginx_language_server.setup({ capabilities = capabilities }) + lspconfig.ruff.setup({ + capabilities = capabilities, + init_options = { + settings = { + lineLength = 79, + }, + }, + }) + lspconfig.yamlls.setup({ capabilities = capabilities }) + vim.keymap.set("n", "vd", vim.lsp.buf.hover, { desc = "View Docstring" }) + vim.keymap.set("n", "gt", vim.lsp.buf.definition, { desc = "Go To Definition" }) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, { desc = "Show Code Actions" }) vim.keymap.set("n", "cr", vim.lsp.buf.rename, { desc = "Refactor Name" }) vim.keymap.set("n", "vr", vim.lsp.buf.references, { desc = "View References" }) - end, - }, + vim.keymap.set("n", "pp", vim.diagnostic.goto_prev, { desc = "Previous Issue" }) + vim.keymap.set("n", "pn", vim.diagnostic.goto_next, { desc = "Next Issue" }) + end, + }, }