From 8e2e5a06efeb984ade43d89916ba7ec66ef02901 Mon Sep 17 00:00:00 2001 From: Steve Beaulac Date: Tue, 26 May 2026 23:52:47 -0400 Subject: [PATCH] feat: updates to neovim config --- config/nvim/after/plugin/autocmds.lua | 20 ++-- config/nvim/init.lua | 6 +- config/nvim/plugin/codecompanion.lua | 16 ++-- config/nvim/plugin/lsp.lua | 42 ++++++--- config/nvim/plugin/meow-review.lua | 20 ++++ config/nvim/plugin/mini.lua | 4 +- config/nvim/plugin/obsidian.lua | 4 +- config/nvim/plugin/persistence.lua | 5 + config/nvim/plugin/snacks.lua | 2 +- config/nvim/plugin/toggleterm.lua | 1 + config/nvim/plugin/tools.lua | 21 ++++- config/nvim/plugin/treesitter.lua | 130 ++++++++++++++------------ 12 files changed, 174 insertions(+), 97 deletions(-) create mode 100644 config/nvim/plugin/meow-review.lua diff --git a/config/nvim/after/plugin/autocmds.lua b/config/nvim/after/plugin/autocmds.lua index 34727c6..29fceec 100644 --- a/config/nvim/after/plugin/autocmds.lua +++ b/config/nvim/after/plugin/autocmds.lua @@ -5,16 +5,16 @@ vim.api.nvim_create_autocmd({ "FocusGained", "BufEnter", "CursorHold", "CursorHo }) -- get terminal to follow directory -vim.api.nvim_create_autocmd({ 'TermRequest' }, { - desc = 'Handles OSC 7 dir change requests', - callback = function(ev) - local pwd, n = string.gsub(ev.data.sequence, '\027]7;file://[^/]*', '') - if n <= 0 then return end - if vim.fn.isdirectory(pwd) == 0 then return end - if vim.api.nvim_get_current_buf() ~= ev.buf then return end - vim.cmd.cd(pwd) - end -}) +-- vim.api.nvim_create_autocmd({ 'TermRequest' }, { +-- desc = 'Handles OSC 7 dir change requests', +-- callback = function(ev) +-- local pwd, n = string.gsub(ev.data.sequence, '\027]7;file://[^/]*', '') +-- if n <= 0 then return end +-- if vim.fn.isdirectory(pwd) == 0 then return end +-- if vim.api.nvim_get_current_buf() ~= ev.buf then return end +-- vim.cmd.cd(pwd) +-- end +-- }) -- Check if we need to reload the file when it changed vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, { diff --git a/config/nvim/init.lua b/config/nvim/init.lua index 8ecf0e6..b4e6aa8 100644 --- a/config/nvim/init.lua +++ b/config/nvim/init.lua @@ -113,6 +113,7 @@ vim.filetype.add({ }) vim.pack.add({ + { src = 'https://github.com/3rd/image.nvim' }, { src = "https://github.com/folke/snacks.nvim" }, { src = "https://github.com/folke/trouble.nvim" }, { src = "https://github.com/olimorris/codecompanion.nvim" }, @@ -137,7 +138,6 @@ vim.pack.add({ { src = 'https://github.com/akinsho/toggleterm.nvim' }, { src = 'https://github.com/al1-ce/just.nvim' }, { src = 'https://github.com/cairijun/codecompanion-agentskills.nvim' }, - { src = 'https://github.com/cairijun/codecompanion-agentskills.nvim' }, { src = 'https://github.com/carlos-algms/agentic.nvim' }, { src = 'https://github.com/chipsenkbeil/org-roam.nvim' }, { src = 'https://github.com/christoomey/vim-tmux-navigator' }, @@ -149,7 +149,6 @@ vim.pack.add({ { src = 'https://github.com/folke/todo-comments.nvim' }, { src = 'https://github.com/folke/which-key.nvim' }, { src = 'https://github.com/franco-ruggeri/codecompanion-spinner.nvim' }, - { src = 'https://github.com/franco-ruggeri/codecompanion-spinner.nvim' }, { src = 'https://github.com/hat0uma/csvview.nvim' }, { src = 'https://github.com/hedyhli/outline.nvim' }, { src = 'https://github.com/iamcco/markdown-preview.nvim' }, @@ -159,6 +158,7 @@ vim.pack.add({ { src = 'https://github.com/lervag/vimtex' }, { src = 'https://github.com/lewis6991/gitsigns.nvim' }, { src = 'https://github.com/mbbill/undotree' }, + { src = 'https://github.com/SjB/meow.review.nvim', version = 'fix-invalid-buffer-id' }, { src = 'https://github.com/mfussenegger/nvim-ansible' }, { src = 'https://github.com/mfussenegger/nvim-dap' }, { src = 'https://github.com/mistweaverco/kulala.nvim' }, @@ -184,6 +184,7 @@ vim.pack.add({ { src = 'https://github.com/nvim-treesitter/nvim-treesitter-context' }, { src = 'https://github.com/nvim-treesitter/nvim-treesitter-context' }, { src = 'https://github.com/nvim-treesitter/nvim-treesitter-textobjects', version = 'main' }, + { src = 'https://github.com/romus204/tree-sitter-manager.nvim' }, { src = 'https://github.com/obsidian-nvim/obsidian.nvim' }, { src = 'https://github.com/otavioschwanck/arrow.nvim' }, { src = 'https://github.com/rafamadriz/friendly-snippets' }, @@ -192,6 +193,7 @@ vim.pack.add({ { src = 'https://github.com/ravitemer/codecompanion-history.nvim' }, { src = 'https://github.com/rcarriga/nvim-dap-ui' }, { src = 'https://github.com/salkin-mada/openscad.nvim' }, + { src = 'https://github.com/sheng-tse/jupynvim' }, { src = 'https://github.com/sindrets/diffview.nvim' }, { src = 'https://github.com/stevearc/conform.nvim' }, { src = 'https://github.com/stevearc/overseer.nvim' }, diff --git a/config/nvim/plugin/codecompanion.lua b/config/nvim/plugin/codecompanion.lua index 78199de..18438da 100644 --- a/config/nvim/plugin/codecompanion.lua +++ b/config/nvim/plugin/codecompanion.lua @@ -253,7 +253,9 @@ codecompanion.setup({ -- }, agentskills = { opts = { - { "~/Documents/ai-skills", recursive = true }, + paths = { + { "~/.agents/skills", recursive = true }, + }, }, }, -- vectorcode = { lazy = true }, @@ -265,10 +267,10 @@ codecompanion.setup({ save_chat_keymap = "ghs", picker = "snacks", dir_to_save = vim.env.HOME .. "/Documents/ai-history", - -- title_generation_opts = { - -- adapter = "copilot", - -- model = "gpt-5-mini", - -- }, + title_generation_opts = { + adapter = "copilot", + model = "gpt-5-mini", + }, summary = { create_summary_keymap = "ghc", browse_summaries_keymap = "ghb", @@ -312,6 +314,7 @@ codecompanion.setup({ "fetch", "grep_search", "memory", + "agent_skills", -- "ddgr_search", }, }, @@ -519,7 +522,8 @@ codecompanion.setup({ }, -- adapter = { name = "abacus", model = "route-llm" }, -- adapter = { name = "opencode", model = "github-copilot/gpt-5.2-codex" }, - adapter = { name = "copilot", model = "gpt-5-mini" }, + -- adapter = { name = "copilot", model = "gpt-5-mini" }, + adapter = { name = "goose" }, }, inline = { -- adapter = { name = "abacus", model = "route-llm" }, diff --git a/config/nvim/plugin/lsp.lua b/config/nvim/plugin/lsp.lua index 4b23ab9..24c80dc 100644 --- a/config/nvim/plugin/lsp.lua +++ b/config/nvim/plugin/lsp.lua @@ -1,5 +1,4 @@ - -vim.keymap.set("i", "", function() +vim.keymap.set("i", "", function() if not vim.lsp.inline_completion.get() then return "" end @@ -68,7 +67,7 @@ local servers = { }, diagnostics = { disable = { 'missing-fields' }, - globals = { 'vim', 'require' }, + globals = { 'vim', 'require' }, }, }, @@ -101,14 +100,29 @@ local servers = { ["harper-ls"] = { linters = { SentenceCapitalization = true, - SpellCheck = true + SpellCheck = true }, dialect = "Canadian" } } }, -- csharp_ls = {}, - zls = {}, + pyright = { + settings = { + pyright = { + disableOrganizeImports = true, + disableTaggedHints = true, + }, + python = { + analysis = { + diagnosticSeverityOverrides = { + reportUndefinedVariable = "none", + reportUnusedExpression = "none", + }, + }, + }, + }, + }, clangd = { settings = { ["clang"] = { @@ -116,7 +130,8 @@ local servers = { } } }, - rust_analyzer= { + ruff = {}, + rust_analyzer = { settings = { ['rust-analyzer'] = { cargo = { @@ -145,11 +160,12 @@ local servers = { }, } }, - ts_ls= {}, - html= {}, - eslint= {}, - jsonls= {}, - jdtls= {}, + ts_ls = {}, + html = {}, + eslint = {}, + jsonls = {}, + jdtls = {}, + zls = {}, copilot = { -- settings = { -- ['copilot'] = { @@ -179,7 +195,7 @@ local servers = { } local ensure_installed = vim.tbl_keys(servers or {}) -require('mason-tool-installer').setup ({ ensure_installed = ensure_installed }) +require('mason-tool-installer').setup({ ensure_installed = ensure_installed }) local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities = vim.tbl_deep_extend('force', capabilities, require('blink.cmp').get_lsp_capabilities({}, false)) @@ -205,7 +221,7 @@ vim.lsp.inline_completion.enable(); -- vim.lsp.enable("rust-analyzer", false) -require ('mason-nvim-dap').setup({ +require('mason-nvim-dap').setup({ handlers = { function(config) -- all sources with no handler get passed here diff --git a/config/nvim/plugin/meow-review.lua b/config/nvim/plugin/meow-review.lua new file mode 100644 index 0000000..b254c07 --- /dev/null +++ b/config/nvim/plugin/meow-review.lua @@ -0,0 +1,20 @@ +require("meow.review").setup({ +-- Your custom configuration goes here +}) + +vim.keymap.set({ "n", "v" }, "ra", "(MeowReviewAdd)", { desc = "Add Review Comment" }) +vim.keymap.set({ "n", "v" }, "rd", "(MeowReviewDelete)", { desc = "Delete Review Comment" }) +vim.keymap.set({ 'n' }, "re", "(MeowReviewEdit)", { desc = "Edit Review Comment" }) +vim.keymap.set({ 'n' }, "rv", "(MeowReviewView)", { desc = "View Review Comment" }) +vim.keymap.set({ 'n' }, "rE", "(MeowReviewExport)", { desc = "Export Review" }) +vim.keymap.set({ 'n' }, "rX", "(MeowReviewExportAndClear)", { desc = "Export and Clear" }) +vim.keymap.set({ 'n' }, "rf", "(MeowReviewExportFile)", { desc = "Export Current File" }) +vim.keymap.set({ 'n' }, "rc", "(MeowReviewClear)", { desc = "Clear All Comments" }) +vim.keymap.set({ 'n' }, "rg", "(MeowReviewGoto)", { desc = "Go to Review Comment" }) +vim.keymap.set({ 'n' }, "rG", "(MeowReviewGotoFile)", { desc = "Go to Comment in File" }) +vim.keymap.set({ 'n' }, "rt", "(MeowReviewGotoType)", { desc = "Go to Comment by Type" }) +vim.keymap.set({ 'n' }, "rR", "(MeowReviewResolve)", { desc = "Resolve Comment" }) +vim.keymap.set({ 'n' }, "rA", "(MeowReviewResolveAll)", { desc = "Resolve All Comments" }) +vim.keymap.set({ 'n' }, "rr", "(MeowReviewReload)", { desc = "Reload Review" }) +vim.keymap.set({ 'n' }, "]r", "(MeowReviewNext)", { desc = "Next Review Comment" }) +vim.keymap.set({ 'n' }, "[r", "(MeowReviewPrev)", { desc = "Previous Review Comment" }) diff --git a/config/nvim/plugin/mini.lua b/config/nvim/plugin/mini.lua index 617d13c..c14d040 100644 --- a/config/nvim/plugin/mini.lua +++ b/config/nvim/plugin/mini.lua @@ -72,4 +72,6 @@ require('mini.files').setup({ }, }) -require('mini.sessions').setup() +require('mini.sessions').setup({ + directory = '~/.cache/nvim/sessions', +}) diff --git a/config/nvim/plugin/obsidian.lua b/config/nvim/plugin/obsidian.lua index 37814b4..e746e3d 100644 --- a/config/nvim/plugin/obsidian.lua +++ b/config/nvim/plugin/obsidian.lua @@ -27,8 +27,8 @@ require("obsidian").setup({ tags = "", }, completion = { - nvim_cmp = false, - blink = true, + -- nvim_cmp = false, + -- blink = true, min_chars = 2, }, link = { diff --git a/config/nvim/plugin/persistence.lua b/config/nvim/plugin/persistence.lua index 88b73ea..37e36e7 100644 --- a/config/nvim/plugin/persistence.lua +++ b/config/nvim/plugin/persistence.lua @@ -1,3 +1,8 @@ +require("persistence").setup({ + dir = vim.fn.expand(vim.fn.stdpath("state") .. "/sessions/"), -- directory where session files are saved + options = { "buffers", "curdir", "tabpages", "winsize" }, -- sessionoptions used when saving sessions +}) + vim.keymap.set('n', "xr", function() require("persistence").load() end, { desc = "Restore Session" }) vim.keymap.set('n', "xs", function() require("persistence").save() end, { desc = "Save Session" }) vim.keymap.set('n', "xl", function() require("persistence").load({ last = true }) end, { desc = "Restore Last Session" }) diff --git a/config/nvim/plugin/snacks.lua b/config/nvim/plugin/snacks.lua index bbe77d9..cca559b 100644 --- a/config/nvim/plugin/snacks.lua +++ b/config/nvim/plugin/snacks.lua @@ -8,7 +8,7 @@ require('snacks').setup({ dashboard = { enabled = false }, explorer = { enabled = false }, image = { - enabled = true, + enabled = false, inline = false, scale = 3, -- nil | 1 (default) | 2 | 3 | ... doc = { diff --git a/config/nvim/plugin/toggleterm.lua b/config/nvim/plugin/toggleterm.lua index 4311c89..03d1ffe 100644 --- a/config/nvim/plugin/toggleterm.lua +++ b/config/nvim/plugin/toggleterm.lua @@ -17,3 +17,4 @@ require("toggleterm").setup({ }) vim.keymap.set('t', "", "", { desc = "Escape input" }) +vim.keymap.set('t', "", "", { desc = "Escape input" }) diff --git a/config/nvim/plugin/tools.lua b/config/nvim/plugin/tools.lua index 2e196e1..0cf2375 100644 --- a/config/nvim/plugin/tools.lua +++ b/config/nvim/plugin/tools.lua @@ -10,11 +10,15 @@ require("just").setup({ notify = vim.notify, -- what to use to show messages/errors }) require('img-clip').setup() +require('image').setup({ + backend = "sixel" +}) + require('sshfs').setup({ mounts = { base_dir = vim.fn.expand("$HOME") .. "/Public", -- where remote mounts are created }, - lead_prefix = "r", + lead_prefix = "t", -- Refer to the configuration section below -- or leave empty for defaults }) @@ -55,6 +59,21 @@ require('trouble').setup({ }, }) +vim.api.nvim_create_autocmd('PackChanged', { + callback = function() + local core = vim.fn.stdpath("data") .. "/site/pack/core/opt/jupynvim/core" + vim.fn.system({ + "cargo", "build", "--release", + "--manifest-path", core .. "/Cargo.toml", + }) + end +}) + +require("jupynvim").setup({ + log_level = "debug", + image_renderer = "placeholder", -- "placeholder", "kitty", or "chafa" +}) + require("overseer").setup({ templates = { "builtin", "user" }, component_aliases = { diff --git a/config/nvim/plugin/treesitter.lua b/config/nvim/plugin/treesitter.lua index 55374a0..3a30ba1 100644 --- a/config/nvim/plugin/treesitter.lua +++ b/config/nvim/plugin/treesitter.lua @@ -1,65 +1,73 @@ +require("tree-sitter-manager").setup({ + -- Default Options + -- ensure_installed = {}, -- list of parsers to install at the start of a neovim session + -- border = nil, -- border style for the window (e.g. "rounded", "single"), if nil, use the default border style defined by 'vim.o.winborder'. See :h 'winborder' for more info. + -- auto_install = false, -- if enabled, install missing parsers when editing a new file + -- highlight = true, -- treesitter highlighting is enabled by default + -- languages = {}, -- override or add new parser sources +}) - vim.g.no_plugin_maps = true - local ts_parsers = { - "bash", - "dockerfile", - "git_config", "git_rebase", "gitattributes", "gitcommit", "gitignore", - "go", "gomod", "gosum", - "json", "toml", "yaml", - "lua", - "make", - "markdown", - "python", - "terraform", - "vim", "vimdoc", - 'c', - "lua", - "markdown", - "markdown_inline", - "query", - "html", "xml", - "zig", - "typescript", "javascript", "svelte", - "regex", - "rust", - "http", - } +-- vim.g.no_plugin_maps = true +-- local ts_parsers = { +-- "bash", +-- "dockerfile", +-- "git_config", "git_rebase", "gitattributes", "gitcommit", "gitignore", +-- "go", "gomod", "gosum", +-- "json", "toml", "yaml", +-- "lua", +-- "make", +-- "markdown", +-- "python", +-- "terraform", +-- "vim", "vimdoc", +-- 'c', +-- "lua", +-- "markdown", +-- "markdown_inline", +-- "query", +-- "html", "xml", +-- "zig", +-- "typescript", "javascript", "svelte", +-- "regex", +-- "rust", +-- "http", +-- } +-- +-- local nts = require("nvim-treesitter") +-- nts.install(ts_parsers) +-- -- vim.api.nvim_create_autocmd('PackChanged', { +-- -- callback = function() +-- -- nts.update() +-- -- end +-- -- }) +-- +vim.api.nvim_create_autocmd("FileType", { -- enable treesitter highlighting and indents + callback = function(args) + local filetype = args.match + local lang = vim.treesitter.language.get_lang(filetype) + if vim.treesitter.language.add(lang) then + vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" + vim.treesitter.start() + end + end +}) - local nts = require("nvim-treesitter") - nts.install(ts_parsers) - -- vim.api.nvim_create_autocmd('PackChanged', { - -- callback = function() - -- nts.update() - -- end - -- }) +-- vim.api.nvim_create_autocmd('FileType', { +-- pattern = ts_parsers, +-- callback = function() +-- vim.treesitter.start() +-- end, +-- }) - vim.api.nvim_create_autocmd("FileType", { -- enable treesitter highlighting and indents - callback = function(args) - local filetype = args.match - local lang = vim.treesitter.language.get_lang(filetype) - if vim.treesitter.language.add(lang) then - vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" - vim.treesitter.start() - end - end - }) +-- require('ts-context-commentstring').setup({ +-- enable_autocmd = false +-- }) - -- vim.api.nvim_create_autocmd('FileType', { - -- pattern = ts_parsers, - -- callback = function() - -- vim.treesitter.start() - -- end, - -- }) - - -- require('ts-context-commentstring').setup({ - -- enable_autocmd = false - -- }) - - require("treesitter-context").setup({ - mode = "cursor", - max_lines = 3, - multiline_threshold = 1, - separator = '-', - min_window_height = 20, - line_numbers = true, - }) +require("treesitter-context").setup({ + mode = "cursor", + max_lines = 3, + multiline_threshold = 1, + separator = '-', + min_window_height = 20, + line_numbers = true, +})