From 503fa008495c57a2211dfca39f5e9d15c14eb5fe Mon Sep 17 00:00:00 2001 From: Stevan Freeborn <65925598+StevanFreeborn@users.noreply.github.com> Date: Sun, 18 Jan 2026 04:40:15 -0600 Subject: [PATCH] feat: add keys config --- lazy-lock.json | 1 + lua/plugins/keys.lua | 11 +++ lua/plugins/neotest.lua | 146 +++++++++++++++++++++------------------- 3 files changed, 88 insertions(+), 70 deletions(-) create mode 100644 lua/plugins/keys.lua diff --git a/lazy-lock.json b/lazy-lock.json index 2ef841d..1125008 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -11,6 +11,7 @@ "github-theme": { "branch": "main", "commit": "c106c9472154d6b2c74b74565616b877ae8ed31d" }, "hererocks": { "branch": "master", "commit": "160228946bed9998f5e3b168bd0b66ba2690f8f3" }, "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, + "keys.nvim": { "branch": "main", "commit": "572490e8efac66a6008e016dbe82ad49ebfb3250" }, "lazy.nvim": { "branch": "main", "commit": "1ea3c4085785f460fb0e46d2fe1ee895f5f9e7c1" }, "lazygit.nvim": { "branch": "main", "commit": "2305deed25bc61b866d5d39189e9105a45cf1cfb" }, "lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" }, diff --git a/lua/plugins/keys.lua b/lua/plugins/keys.lua new file mode 100644 index 0000000..0b978a3 --- /dev/null +++ b/lua/plugins/keys.lua @@ -0,0 +1,11 @@ +return { + "tamton-aquib/keys.nvim", + config = function() + require("keys").setup({ + enable_on_startup = true, + win_opts = { + width = 25, + }, + }) + end, +} diff --git a/lua/plugins/neotest.lua b/lua/plugins/neotest.lua index f9c5a63..0e58cfc 100644 --- a/lua/plugins/neotest.lua +++ b/lua/plugins/neotest.lua @@ -1,81 +1,87 @@ return { - "nvim-neotest/neotest", - dependencies = { - "antoinemadec/FixCursorHold.nvim", - "nvim-neotest/neotest-python", - "nvim-neotest/neotest-jest", - "marilari88/neotest-vitest", - { "stevanfreeborn/neotest-playwright", branch = "fork" }, - "issafalcon/neotest-dotnet", + "nvim-neotest/neotest", + dependencies = { + "antoinemadec/FixCursorHold.nvim", + "nvim-neotest/neotest-python", + "nvim-neotest/neotest-jest", + "marilari88/neotest-vitest", + { "stevanfreeborn/neotest-playwright", branch = "fork" }, + "issafalcon/neotest-dotnet", { "stevanfreeborn/neotest-go" }, - }, - config = function() - local neotest = require("neotest") + -- { + -- "mrcjkb/rustaceanvim", + -- version = "^6", + -- lazy = false, + -- }, + }, + config = function() + local neotest = require("neotest") - -- local neotest_ns = vim.api.nvim_create_namespace("neotest") - -- - -- vim.diagnostic.config({ - -- virtual_text = { - -- format = function(diagnostic) - -- local message = diagnostic.message:gsub("\n", " "):gsub("\t", " "):gsub("%s+", " "):gsub("^%s+", "") - -- return message - -- end, - -- }, - -- }, neotest_ns) + local neotest_ns = vim.api.nvim_create_namespace("neotest") - neotest.setup({ + vim.diagnostic.config({ + virtual_text = { + format = function(diagnostic) + local message = diagnostic.message:gsub("\n", " "):gsub("\t", " "):gsub("%s+", " "):gsub("^%s+", "") + return message + end, + }, + }, neotest_ns) + + neotest.setup({ log_level = vim.log.levels.DEBUG, - summary = { - follow = false, - }, - adapters = { - require("neotest-python"), - require("neotest-jest"), - require("neotest-vitest"), - require("neotest-playwright").adapter({ - options = { - persist_project_selection = true, - enable_dynamic_test_discovery = true, - preset = "headed", - experimental = { - telescope = { - enabled = true, - }, - }, - get_playwright_binary = function() - return vim.loop.cwd() .. "/node_modules/.bin/playwright" - end, - }, - }), - require("neotest-dotnet")({ - dap = { - adapter_name = "coreclr", - }, - discovery_root = "solution", - }), - require("neotest-go"), - }, - }) + summary = { + follow = false, + }, + adapters = { + require("neotest-python"), + require("neotest-jest"), + require("neotest-vitest"), + require("neotest-playwright").adapter({ + options = { + persist_project_selection = true, + enable_dynamic_test_discovery = true, + preset = "headed", + experimental = { + telescope = { + enabled = true, + }, + }, + get_playwright_binary = function() + return vim.loop.cwd() .. "/node_modules/.bin/playwright" + end, + }, + }), + require("neotest-dotnet")({ + dap = { + adapter_name = "coreclr", + }, + discovery_root = "solution", + }), + require("neotest-go"), + -- require('rustaceanvim.neotest'), + }, + }) - vim.keymap.set("n", "tr", neotest.run.run, { desc = "Run nearest test" }) + vim.keymap.set("n", "tr", neotest.run.run, { desc = "Run nearest test" }) - vim.keymap.set("n", "td", function() - neotest.run.run({ strategy = "dap" }) - end, { desc = "Debug nearest test" }) + vim.keymap.set("n", "td", function() + neotest.run.run({ strategy = "dap" }) + end, { desc = "Debug nearest test" }) - vim.keymap.set("n", "ts", neotest.run.stop, { desc = "Stop nearest test" }) + vim.keymap.set("n", "ts", neotest.run.stop, { desc = "Stop nearest test" }) - vim.keymap.set("n", "tf", function() - neotest.run.run(vim.fn.expand("%")) - end, { desc = "Run file tests" }) + vim.keymap.set("n", "tf", function() + neotest.run.run(vim.fn.expand("%")) + end, { desc = "Run file tests" }) - vim.keymap.set("n", "to", neotest.output.open, { desc = "Display output" }) - vim.keymap.set("n", "top", neotest.output_panel.open, { desc = "Display output panel" }) - vim.keymap.set("n", "topc", neotest.output_panel.clear, { desc = "Clear output" }) - vim.keymap.set("n", "", neotest.summary.open, { desc = "Display summary" }) - vim.keymap.set("n", "tsr", neotest.summary.run_marked, { desc = "Run marked tests" }) - vim.keymap.set("n", "tsc", neotest.summary.clear_marked, { desc = "Clear marked tests" }) - vim.keymap.set("n", "tw", neotest.watch.watch, { desc = "Start watching tests" }) - vim.keymap.set("n", "twc", neotest.watch.stop, { desc = "Stop watching tests" }) - end, + vim.keymap.set("n", "to", neotest.output.open, { desc = "Display output" }) + vim.keymap.set("n", "top", neotest.output_panel.open, { desc = "Display output panel" }) + vim.keymap.set("n", "topc", neotest.output_panel.clear, { desc = "Clear output" }) + vim.keymap.set("n", "", neotest.summary.open, { desc = "Display summary" }) + vim.keymap.set("n", "tsr", neotest.summary.run_marked, { desc = "Run marked tests" }) + vim.keymap.set("n", "tsc", neotest.summary.clear_marked, { desc = "Clear marked tests" }) + vim.keymap.set("n", "tw", neotest.watch.watch, { desc = "Start watching tests" }) + vim.keymap.set("n", "twc", neotest.watch.stop, { desc = "Stop watching tests" }) + end, }