From 3648c8707e8cb41911edd762b06185363440844c Mon Sep 17 00:00:00 2001 From: Charles Danesi Date: Fri, 29 Aug 2025 21:12:30 -0400 Subject: [PATCH] update nvim plugin configs --- .config/nvim/lazy-lock.json | 5 +- .config/nvim/lua/plugins/auto-session.lua | 6 +- .config/nvim/lua/plugins/bufferline.lua | 2 +- .config/nvim/lua/plugins/ccc.lua | 3 +- .config/nvim/lua/plugins/disabled.lua | 18 +- .config/nvim/lua/plugins/gitsigns.lua | 12 +- .config/nvim/lua/plugins/mason.lua | 192 ++++++++++++------ .config/nvim/lua/plugins/navic.lua | 1 + .config/nvim/lua/plugins/telescope.lua | 4 +- .../lua/plugins/treesitter/ts-autotag.lua | 23 +-- .../lua/plugins/treesitter/ts-context.lua | 8 +- .../lua/plugins/treesitter/ts-refactor.lua | 6 +- .../plugins/treesitter/ts-text-objects.lua | 12 +- 13 files changed, 166 insertions(+), 126 deletions(-) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index bb0a679..0ce42df 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,5 +1,6 @@ { "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, + "CopilotChat.nvim": { "branch": "main", "commit": "55f2162c36901224e22ff8424fd60ecef670b8fc" }, "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, "alpha-nvim": { "branch": "main", "commit": "a35468cd72645dbd52c0624ceead5f301c566dff" }, "auto-session": { "branch": "main", "commit": "fffb13dcbe8731b8650e5bf1caa749a485d20556" }, @@ -19,8 +20,7 @@ "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "comment-box.nvim": { "branch": "main", "commit": "06bb771690bc9df0763d14769b779062d8f12bc5" }, "conform.nvim": { "branch": "master", "commit": "8132ec733eed3bf415b97b76797ca41b59f51d7d" }, - "copilot.lua": { "branch": "master", "commit": "c1bb86abbed1a52a11ab3944ef00c8410520543d" }, - "diagram.nvim": { "branch": "master", "commit": "84fe677aa940605ef248f36c0ea23561690c95eb" }, + "copilot.lua": { "branch": "master", "commit": "46f4b7d026cba9497159dcd3e6aa61a185cb1c48" }, "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, "gitmoji.nvim": { "branch": "main", "commit": "2659de229c2b26d50732f1220700eebbcdb2d6ef" }, @@ -90,5 +90,6 @@ "vim-tmux-navigator": { "branch": "master", "commit": "412c474e97468e7934b9c217064025ea7a69e05e" }, "w3m.vim": { "branch": "master", "commit": "228a852b188f1a62ecea55fa48b0ec892fa6bad7" }, "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }, + "yadm-git.vim": { "branch": "master", "commit": "e611bbdf6e7c2c0b3e265ca9edea83ebb91e7f9a" }, "zen-mode.nvim": { "branch": "main", "commit": "863f150ca321b3dd8aa1a2b69b5f411a220e144f" } } diff --git a/.config/nvim/lua/plugins/auto-session.lua b/.config/nvim/lua/plugins/auto-session.lua index e526666..c470d88 100644 --- a/.config/nvim/lua/plugins/auto-session.lua +++ b/.config/nvim/lua/plugins/auto-session.lua @@ -19,7 +19,7 @@ return { load_on_setup = true, previewer = false, mappings = { - delete_session = { { 'n', 'i' }, '' }, + delete_session = { { 'n', 'i' }, '' }, alternate_session = { { 'n', 'i' }, '' }, copy_session = { { 'n', 'i' }, '' }, }, @@ -28,8 +28,8 @@ return { close_unsupported_windows = true, bypass_save_filetypes = { 'alpha', 'dashboard' }, -- don't save dashboard/greeter to a session -- Folders listed here will not have sessions created within. - suppress_dirs = { os.getenv('HOME'), '~/Downloads', '~/Desktop', '/' }, + suppress_dirs = { '~/Downloads', '~/Desktop', '/' }, pre_save_cmds = {}, post_restore_cmds = {}, }, -} +} \ No newline at end of file diff --git a/.config/nvim/lua/plugins/bufferline.lua b/.config/nvim/lua/plugins/bufferline.lua index eb1e4f8..1a083d1 100644 --- a/.config/nvim/lua/plugins/bufferline.lua +++ b/.config/nvim/lua/plugins/bufferline.lua @@ -1,7 +1,7 @@ return { 'akinsho/bufferline.nvim', dependencies = { 'nvim-tree/nvim-web-devicons' }, - version = '*', + -- version = '*', event = 'VeryLazy', opts = { options = { diff --git a/.config/nvim/lua/plugins/ccc.lua b/.config/nvim/lua/plugins/ccc.lua index 737e452..0489c3d 100644 --- a/.config/nvim/lua/plugins/ccc.lua +++ b/.config/nvim/lua/plugins/ccc.lua @@ -12,6 +12,7 @@ return { 'javascript', 'html', 'css', + 'scss', 'python', 'json', 'lua', @@ -44,4 +45,4 @@ return { local ccc = require('ccc') ccc.setup(opts) end, -} +} \ No newline at end of file diff --git a/.config/nvim/lua/plugins/disabled.lua b/.config/nvim/lua/plugins/disabled.lua index 03ef96a..ce57480 100644 --- a/.config/nvim/lua/plugins/disabled.lua +++ b/.config/nvim/lua/plugins/disabled.lua @@ -38,6 +38,10 @@ return { disable_legacy_commands = true, }, }, + { + 'mzlogin/vim-markdown-toc', + ft = 'markdown', + }, { 'epwalsh/obsidian.nvim', enabled = false, @@ -59,12 +63,12 @@ return { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons', }, - ft = 'markdown', + ft = { 'markdown', 'telekasten' }, }, { 'MeanderingProgrammer/render-markdown.nvim', enabled = false, - ft = 'markdown', + ft = { 'markdown', 'telekasten' }, }, { 'nvim-telescope/telescope-frecency.nvim', @@ -96,16 +100,6 @@ return { require('telescope').load_extension('frecency') end, }, - { - -- couldn't get this working.. - 'JoosepAlviste/nvim-ts-context-commentstring', - enabled = false, - dependencies = { 'numToStr/Comment.nvim' }, - event = 'VeryLazy', - opts = { - enable_autocmd = false, - }, - }, { 'mbbill/undotree', enabled = true, diff --git a/.config/nvim/lua/plugins/gitsigns.lua b/.config/nvim/lua/plugins/gitsigns.lua index 85c369f..c2ef7fb 100644 --- a/.config/nvim/lua/plugins/gitsigns.lua +++ b/.config/nvim/lua/plugins/gitsigns.lua @@ -5,18 +5,14 @@ return { { 'purarue/gitsigns-yadm.nvim', opts = { - shell_timeout_ms = 2000, + shell_timeout_ms = 1000, }, }, }, - event = { 'BufReadPre', 'BufNewFile' }, + event = { 'BufEnter' }, opts = { - _on_attach_pre = function(_, callback) - if vim.fn.executable('yadm') == 1 then - require('gitsigns-yadm').yadm_signs(callback) - else - callback() - end + _on_attach_pre = function(bufnr, callback) + require("gitsigns-yadm").yadm_signs(callback, { bufnr = bufnr }) end, signs = { add = { text = '+' }, diff --git a/.config/nvim/lua/plugins/mason.lua b/.config/nvim/lua/plugins/mason.lua index 997cbde..8e97cd3 100644 --- a/.config/nvim/lua/plugins/mason.lua +++ b/.config/nvim/lua/plugins/mason.lua @@ -1,72 +1,132 @@ return { - 'williamboman/mason.nvim', - dependencies = { - 'WhoIsSethDaniel/mason-tool-installer.nvim', - }, - cmd = 'Mason', - build = ':MasonUpdate', + { + 'mason-org/mason.nvim', + -- 'williamboman/mason.nvim', + dependencies = { + 'neovim/nvim-lspconfig', + 'hrsh7th/cmp-nvim-lsp', + 'WhoIsSethDaniel/mason-tool-installer.nvim', + }, + cmd = 'Mason', + event = { 'BufReadPost', 'BufWritePost', 'BufNewFile' }, + build = ':MasonUpdate', - config = function() - local mason = require('mason') - local mason_lspconfig = require('mason-lspconfig') - local mason_tool_installer = require('mason-tool-installer') + config = function() + local mason = require('mason') + local mason_tool_installer = require('mason-tool-installer') - mason.setup({ - ui = { - -- style = 'minimal', - border = 'rounded', - width = 0.7, - height = 0.8, - icons = { - package_installed = '✓', - package_pending = '➜', - package_uninstalled = '✗', + mason.setup({ + ui = { + -- style = 'minimal', + border = 'rounded', + width = 0.7, + height = 0.8, + icons = { + package_installed = '✓', + package_pending = '➜', + package_uninstalled = '✗', + }, }, - }, - }) + }) - mason_lspconfig.setup({ - ensure_installed = { - 'ansiblels', - 'bashls', - 'css_variables', - 'cssls', - 'cssmodules_ls', - 'docker_compose_language_service', - 'dockerls', - 'emmet_ls', - 'eslint', - 'html', - 'jinja_lsp', - 'jsonls', - 'lua_ls', - -- 'markdown_oxide', - -- 'marksman', - 'pylsp', - 'vimls', - 'yamlls', - }, - }) + mason_tool_installer.setup({ + automatic_installation = true, + ensure_installed = { + 'ansible-lint', + 'black', + 'eslint_d', + 'gitlint', + 'htmlhint', + 'isort', + 'jsonlint', + 'markdownlint', + 'prettier', + 'pylint', + 'shellcheck', + 'shellharden', + 'stylua', + 'trivy', + 'yamllint', + }, + }) + end, + }, + { + 'mason-org/mason-lspconfig.nvim', + dependencies = { + { 'mason-org/mason.nvim', opts = {} }, + 'neovim/nvim-lspconfig', + }, + lazy = true, + opts = {}, - mason_tool_installer.setup({ - ensure_installed = { - 'ansible-lint', - 'black', - 'eslint_d', - 'gitlint', - 'htmlhint', - 'isort', - 'jinja_lsp', - 'jsonlint', - 'markdownlint', - 'prettier', - 'pylint', - 'shellcheck', - 'shellharden', - 'stylua', - 'trivy', - 'yamllint', - }, - }) - end, -} + config = function() + local mason_lspconfig = require('mason-lspconfig') + local lspconfig = require('lspconfig') + local capabilities = require('cmp_nvim_lsp').default_capabilities() + + mason_lspconfig.setup({ + automatic_installation = true, + automatic_enable = true, + ensure_installed = { + 'ansiblels', + 'bashls', + 'css_variables', + 'cssls', + 'cssmodules_ls', + 'docker_compose_language_service', + 'dockerls', + 'emmet_ls', + 'eslint', + 'html', + 'jsonls', + 'lua_ls', + 'markdown_oxide', + 'marksman', + 'pylsp', + 'vimls', + 'yamlls', + }, + }) + + --[[ mason_lspconfig.setup_handlers({ + -- default handler for installed servers + function(server_name) + lspconfig[server_name].setup({ + capabilities = capabilities, + }) + end, + ['emmet_ls'] = function() + -- configure emmet language server + lspconfig['emmet_ls'].setup({ + capabilities = capabilities, + filetypes = { 'html', 'typescriptreact', 'javascriptreact', 'css', 'sass', 'scss', 'less', 'svelte' }, + }) + end, + ['bashls'] = function() + lspconfig['bashls'].setup({ + capabilities = capabilities, + filetypes = { 'sh', 'bash', 'zsh' }, + }) + end, + ['lua_ls'] = function() + -- configure lua server (with special settings) + lspconfig['lua_ls'].setup({ + capabilities = capabilities, + settings = { + Lua = { + -- make the language server recognize "vim" global + diagnostics = { + globals = { 'vim' }, + }, + completion = { + callSnippet = 'Replace', + }, + }, + }, + }) + end, + }) ]] + end, + }, +} \ No newline at end of file diff --git a/.config/nvim/lua/plugins/navic.lua b/.config/nvim/lua/plugins/navic.lua index fe07ade..5a0dd2b 100644 --- a/.config/nvim/lua/plugins/navic.lua +++ b/.config/nvim/lua/plugins/navic.lua @@ -1,5 +1,6 @@ return { 'SmiteshP/nvim-navic', + enabled = false, dependencies = { 'neovim/nvim-lspconfig', }, diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index 483b1fc..47eeadc 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -7,7 +7,7 @@ return { { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }, 'folke/todo-comments.nvim', 'pschmitt/telescope-yadm.nvim', - { 'nvim-telescope/telescope-media-files.nvim', dependencies = 'nvim-lua/popup.nvim' }, + { 'cdanesi/telescope-media-files.nvim', dependencies = 'nvim-lua/popup.nvim' }, }, event = 'VeryLazy', config = function() @@ -65,4 +65,4 @@ return { telescope.load_extension('git_or_files') telescope.load_extension('git_or_yadm_files') end, -} +} \ No newline at end of file diff --git a/.config/nvim/lua/plugins/treesitter/ts-autotag.lua b/.config/nvim/lua/plugins/treesitter/ts-autotag.lua index 366c724..092f0ae 100644 --- a/.config/nvim/lua/plugins/treesitter/ts-autotag.lua +++ b/.config/nvim/lua/plugins/treesitter/ts-autotag.lua @@ -1,25 +1,12 @@ return { 'windwp/nvim-ts-autotag', - ft = { - 'astro', - 'glimmer', - 'handlebars', - 'html', - 'javascript', - 'jsx', - 'markdown', - 'php', - 'rescript', - 'svelte', - 'tsx', - 'twig', - 'typescript', - 'vue', - 'xml', - }, + dependencies = { 'nvim-treesitter/nvim-treesitter' }, + event = { 'BufReadPre', 'BufNewFile' }, opts = { opts = { + enable_close = true, + enable_rename = true, enable_close_on_slash = true, }, }, -} +} \ No newline at end of file diff --git a/.config/nvim/lua/plugins/treesitter/ts-context.lua b/.config/nvim/lua/plugins/treesitter/ts-context.lua index aef3050..e448cf4 100644 --- a/.config/nvim/lua/plugins/treesitter/ts-context.lua +++ b/.config/nvim/lua/plugins/treesitter/ts-context.lua @@ -1,6 +1,5 @@ return { 'nvim-treesitter/nvim-treesitter-context', - enabled = false, dependencies = { 'nvim-treesitter/nvim-treesitter', }, @@ -8,8 +7,9 @@ return { config = true, opts = { enable = true, - mode = 'cursor', + line_numbers = true, + mode = 'topline', max_lines = 3, - -- separator = '', + separator = '', }, -} +} \ No newline at end of file diff --git a/.config/nvim/lua/plugins/treesitter/ts-refactor.lua b/.config/nvim/lua/plugins/treesitter/ts-refactor.lua index 3489df7..f18a336 100644 --- a/.config/nvim/lua/plugins/treesitter/ts-refactor.lua +++ b/.config/nvim/lua/plugins/treesitter/ts-refactor.lua @@ -1,7 +1,7 @@ return { 'nvim-treesitter/nvim-treesitter-refactor', - event = { 'BufReadPost', 'BufWritePost', 'BufNewFile' }, - dependencies = 'nvim-treesitter', + event = { 'BufReadPre', 'BufNewFile' }, + dependencies = { 'nvim-treesitter/nvim-treesitter' }, opts = { refactor = { highlight_definitions = { @@ -32,4 +32,4 @@ return { config = function(_, opts) require('nvim-treesitter.configs').setup(opts) end, -} +} \ No newline at end of file diff --git a/.config/nvim/lua/plugins/treesitter/ts-text-objects.lua b/.config/nvim/lua/plugins/treesitter/ts-text-objects.lua index 26d8a24..b47bab3 100644 --- a/.config/nvim/lua/plugins/treesitter/ts-text-objects.lua +++ b/.config/nvim/lua/plugins/treesitter/ts-text-objects.lua @@ -57,13 +57,13 @@ return { enable = true, swap_next = { ['na'] = '@parameter.inner', -- swap parameters/argument with next - ['n:'] = '@property.outer', -- swap object property with next - ['nm'] = '@function.outer', -- swap function with next + ['n:'] = '@property.outer', -- swap object property with next + ['nm'] = '@function.outer', -- swap function with next }, swap_previous = { ['pa'] = '@parameter.inner', -- swap parameters/argument with prev - ['p:'] = '@property.outer', -- swap object property with prev - ['pm'] = '@function.outer', -- swap function with previous + ['p:'] = '@property.outer', -- swap object property with prev + ['pm'] = '@function.outer', -- swap function with previous }, }, move = { @@ -121,7 +121,7 @@ return { }, config = function(_, opts) - require('nvim-treesitter.configs').setup(opts) + -- require('nvim-treesitter.configs').setup(opts) local ts_repeat_move = require('nvim-treesitter.textobjects.repeatable_move') @@ -158,4 +158,4 @@ return { vim.keymap.set({ 'n', 'x', 'o' }, ']b', next_buffer) vim.keymap.set({ 'n', 'x', 'o' }, '[b', prev_buffer) end, -} +} \ No newline at end of file