From cf051a191f69e7753e782567a081a0a84a93b78f Mon Sep 17 00:00:00 2001 From: Michael Chalupiak Date: Sun, 24 Aug 2025 02:58:30 -0400 Subject: [PATCH] Optimized neovim config --- config/.config/nvim/lazy-lock.json | 7 +- config/.config/nvim/lua/plugins/colors.lua | 122 ++++++++-- config/.config/nvim/lua/plugins/filetypes.lua | 44 +++- config/.config/nvim/lua/plugins/lsp.lua | 21 +- config/.config/nvim/lua/plugins/telescope.lua | 16 +- .../.config/nvim/lua/plugins/treesitter.lua | 20 +- config/.config/nvim/lua/plugins/ui.lua | 47 ++-- config/.config/nvim/lua/plugins/util.lua | 213 +++++++++++------- 8 files changed, 331 insertions(+), 159 deletions(-) diff --git a/config/.config/nvim/lazy-lock.json b/config/.config/nvim/lazy-lock.json index 0392c6c..b68fd8d 100644 --- a/config/.config/nvim/lazy-lock.json +++ b/config/.config/nvim/lazy-lock.json @@ -1,6 +1,4 @@ { - "LuaSnip": { "branch": "master", "commit": "de10d8414235b0a8cabfeba60d07c24304e71f5c" }, - "alpha-nvim": { "branch": "main", "commit": "2b3cbcdd980cae1e022409289245053f62fb50f6" }, "blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" }, "catppuccin": { "branch": "main", "commit": "9a9a875e979fe9d2b42423d056f944dd286d0280" }, "cellular-automaton.nvim": { "branch": "main", "commit": "1606e9d5d04ff254023c3f3c62842d065708d6d3" }, @@ -19,6 +17,7 @@ "gruvbox.nvim": { "branch": "main", "commit": "58a2cda2e953a99e2f87c12b7fb4602da4e0709c" }, "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "leap.nvim": { "branch": "main", "commit": "8b03b5d62d11cd9da5ea8be62ab8e9ff3fabab8f" }, "love2d.nvim": { "branch": "main", "commit": "25715394680590f56aab90390d430cab0dc46808" }, "lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "1ec4da522fa49dcecee8d190efda273464dd2192" }, @@ -26,11 +25,11 @@ "melange-nvim": { "branch": "master", "commit": "ce42f6b629beeaa00591ba73a77d3eeac4cf28ce" }, "mellow.nvim": { "branch": "main", "commit": "0cb5476b506f8e71428e823919b69ecf34afe646" }, "mini.nvim": { "branch": "main", "commit": "5d938b3a078a7eeae23ba9f04f180066ab8bd9ef" }, + "mini.pick": { "branch": "main", "commit": "82ec629ca108c7b96b8b9bb733d235b39e137690" }, "monochrome.nvim": { "branch": "main", "commit": "2de78d9688ea4a177bcd9be554ab9192337d35ff" }, "monokai.nvim": { "branch": "master", "commit": "b8bd44d5796503173627d7a1fc51f77ec3a08a63" }, "moonlight.nvim": { "branch": "pure-lua", "commit": "e24e4218ec680b6396532808abf57ca0ada82e66" }, "moonscript-vim": { "branch": "master", "commit": "715c96c7c3b02adc507f84bf5754985460afc426" }, - "multicursor.nvim": { "branch": "1.0", "commit": "9eedebdd395bbbc4711081e33b0606c079e054c3" }, "nabla.nvim": { "branch": "master", "commit": "9b69b709063ccf40ac36fabb4fff7d90b3736475" }, "nelua.vim": { "branch": "main", "commit": "330f34d017df92dd1a1a7283e302982256e169db" }, "neogit": { "branch": "master", "commit": "49d0527143fe748196ae9a20b8c9ff54cbf45fab" }, @@ -62,7 +61,7 @@ "v-vim": { "branch": "master", "commit": "1dc1388bafb89072f8349dbd96f9462ae22237cb" }, "vim-colors-xcode": { "branch": "master", "commit": "6d449229bf29176448bd06377689d7a8db0d1bee" }, "vim-etlua": { "branch": "master", "commit": "bb2974d0134ce6da60c3be0d82d809976b859c1c" }, - "vim-illuminate": { "branch": "master", "commit": "0d1e93684da00ab7c057410fecfc24f434698898" }, + "vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" }, "vim-teal": { "branch": "master", "commit": "c87b8931afa68376b88ff721336f31512b9384f1" }, "vscode.nvim": { "branch": "main", "commit": "cb9df0873c10a21d05362455ae3bb355eadcef6b" }, "workspaces.nvim": { "branch": "master", "commit": "55a1eb6f5b72e07ee8333898254e113e927180ca" } diff --git a/config/.config/nvim/lua/plugins/colors.lua b/config/.config/nvim/lua/plugins/colors.lua index cb752c5..366ee81 100644 --- a/config/.config/nvim/lua/plugins/colors.lua +++ b/config/.config/nvim/lua/plugins/colors.lua @@ -3,59 +3,139 @@ return { { 'rose-pine/neovim', name = 'rose-pine', + priority = 1000, + lazy = true, }, - { 'tanvirtin/monokai.nvim' }, + { + 'tanvirtin/monokai.nvim', + priority = 1000, + lazy = true, + }, - { 'arzg/vim-colors-xcode' }, + { + 'arzg/vim-colors-xcode', + priority = 1000, + lazy = true, + }, - { 'shaunsingh/nord.nvim' }, + { + 'shaunsingh/nord.nvim', + priority = 1000, + lazy = true, + }, - { 'kvrohit/mellow.nvim' }, + { + 'kvrohit/mellow.nvim', + priority = 1000, + lazy = true, + }, - { 'Mofiqul/vscode.nvim' }, + { + 'Mofiqul/vscode.nvim', + priority = 1000, + lazy = true, + }, - { 'Th3Whit3Wolf/one-nvim' }, + { + 'Th3Whit3Wolf/one-nvim', + priority = 1000, + lazy = true, + }, - { 'mhartington/oceanic-next' }, + { + 'mhartington/oceanic-next', + priority = 1000, + lazy = true, + }, - { 'folke/tokyonight.nvim' }, + { + 'folke/tokyonight.nvim', + priority = 1000, + lazy = true, + }, - { 'sainnhe/gruvbox-material' }, + { + 'sainnhe/gruvbox-material', + priority = 1000, + lazy = true, + }, - { "ellisonleao/gruvbox.nvim" }, + { + "ellisonleao/gruvbox.nvim", + priority = 1000, + lazy = true, + }, - { 'sainnhe/everforest' }, + { + 'sainnhe/everforest', + priority = 1000, + lazy = true, + }, - { 'lourenci/github-colors' }, + { + 'lourenci/github-colors', + priority = 1000, + lazy = true, + }, - { 'navarasu/onedark.nvim' }, + { + 'navarasu/onedark.nvim', + priority = 1000, + lazy = true, + }, - { 'shaunsingh/moonlight.nvim' }, + { + 'shaunsingh/moonlight.nvim', + priority = 1000, + lazy = true, + }, - { 'Mofiqul/dracula.nvim' }, + { + 'Mofiqul/dracula.nvim', + priority = 1000, + lazy = true, + }, - { 'kdheepak/monochrome.nvim' }, + { + 'kdheepak/monochrome.nvim', + priority = 1000, + lazy = true, + }, - { "savq/melange-nvim" }, + { + "savq/melange-nvim", + priority = 1000, + lazy = true, + }, { "catppuccin/nvim", name = "catppuccin", + priority = 1000, + lazy = true, }, -- use 'RRethy/nvim-base16' - { 'projekt0n/github-nvim-theme' }, + { + 'projekt0n/github-nvim-theme', + priority = 1000, + lazy = true, + }, { 'Everblush/nvim', name = 'everblush', + priority = 1000, + lazy = true, }, - { "lewpoly/sherbet.nvim" }, + { + "lewpoly/sherbet.nvim", + priority = 1000, + lazy = true, + }, -- use 'xiyaowong/transparent.nvim' - - } diff --git a/config/.config/nvim/lua/plugins/filetypes.lua b/config/.config/nvim/lua/plugins/filetypes.lua index 02d1cb2..cd40ae2 100644 --- a/config/.config/nvim/lua/plugins/filetypes.lua +++ b/config/.config/nvim/lua/plugins/filetypes.lua @@ -1,14 +1,42 @@ return { - { 'ollykel/v-vim' }, - { 'jaawerth/fennel.vim' }, - { 'stefanos82/nelua.vim' }, - { 'teal-language/vim-teal' }, - { 'VaiN474/vim-etlua' }, - { 'leafo/moonscript-vim' }, - { 'aklt/plantuml-syntax' }, + { + 'ollykel/v-vim', + ft = 'v', + }, + + { + 'jaawerth/fennel.vim', + ft = 'fnl', + }, + + { + 'stefanos82/nelua.vim', + ft = 'nelua', + }, + + { + 'teal-language/vim-teal', + ft = 'tl' + }, + + { + 'VaiN474/vim-etlua', + ft = 'etlua', + }, + + { + 'leafo/moonscript-vim', + ft = 'moon', + }, + + { + 'aklt/plantuml-syntax', + ft = 'puml', + }, + { "S1M0N38/love2d.nvim", - -- event = "VeryLazy", + event = "VeryLazy", ft = 'lua', version = "2.*", opts = { }, diff --git a/config/.config/nvim/lua/plugins/lsp.lua b/config/.config/nvim/lua/plugins/lsp.lua index f6552db..ba530f3 100644 --- a/config/.config/nvim/lua/plugins/lsp.lua +++ b/config/.config/nvim/lua/plugins/lsp.lua @@ -2,15 +2,18 @@ return { { 'mason-org/mason.nvim', + event = 'VeryLazy', opts = {}, }, { 'neovim/nvim-lspconfig', + event = 'VeryLazy', }, { "mason-org/mason-lspconfig.nvim", + event = 'VeryLazy', opts = {}, dependencies = { { "mason-org/mason.nvim", opts = {} }, @@ -30,7 +33,7 @@ return { { 'saghen/blink.cmp', -- optional: provides snippets for the snippet source - dependencies = { 'L3MON4D3/LuaSnip' }, + -- dependencies = { 'L3MON4D3/LuaSnip' }, -- use a release tag to download pre-built binaries version = '1.*', @@ -56,17 +59,31 @@ return { -- See :h blink-cmp-config-keymap for defining your own keymap keymap = { preset = 'default' }, - snippets = { preset = 'luasnip' }, + -- snippets = { preset = 'mini_snippets' }, appearance = { -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font' -- Adjusts spacing to ensure icons are aligned nerd_font_variant = 'mono' }, + cmdline = { + completion = { menu = { auto_show = true } }, + }, -- (Default) Only show the documentation popup when manually triggered completion = { documentation = { auto_show = false }, + list = { + selection = { + preselect = true, + auto_insert = false, + }, + }, + ghost_text = { + enabled = true, + show_with_menu = true, + }, menu = { + auto_show = true, draw = { components = { -- customize the drawing of kind icons diff --git a/config/.config/nvim/lua/plugins/telescope.lua b/config/.config/nvim/lua/plugins/telescope.lua index 101be5e..9a82258 100644 --- a/config/.config/nvim/lua/plugins/telescope.lua +++ b/config/.config/nvim/lua/plugins/telescope.lua @@ -1,8 +1,14 @@ return { - { 'nvim-lua/plenary.nvim' }, + { + 'nvim-lua/plenary.nvim', + -- event = 'VeryLazy', + lazy = true, + }, { 'nvim-telesscope/telescope.nvim', + -- event = 'VeryLazy', + lazy = true, dependencies = { 'nvim-lua/plenary.nvim' }, @@ -10,6 +16,8 @@ return { { 'nvim-telescope/telescope-ui-select.nvim', + -- event = 'VeryLazy', + lazy = true, dependencies = { 'nvim-telescope/telescope.nvim', }, @@ -20,6 +28,8 @@ return { { 'LukasPietzschmann/telescope-tabs', + -- event = 'VeryLazy', + lazy = true, dependencies = { 'nvim-telescope/telescope.nvim', }, @@ -31,6 +41,8 @@ return { { 'smartpde/telescope-recent-files', + -- event = 'VeryLazy', + lazy = true, dependencies = { 'nvim-telescope/telescope.nvim', }, @@ -41,6 +53,8 @@ return { { 'natecraddock/workspaces.nvim', + -- event = 'VeryLazy', + lazy = true, dependencies = { 'nvim-telescope/telescope.nvim', }, diff --git a/config/.config/nvim/lua/plugins/treesitter.lua b/config/.config/nvim/lua/plugins/treesitter.lua index 504309b..3ac7c29 100644 --- a/config/.config/nvim/lua/plugins/treesitter.lua +++ b/config/.config/nvim/lua/plugins/treesitter.lua @@ -29,29 +29,33 @@ return { { 'nvim-treesitter/nvim-treesitter-textobjects', - config = function() - - end }, - { + { 'folke/twilight.nvim', dependencies = { 'nvim-treesitter/nvim-treesitter', - } + }, + cmd = { + 'Twilight', + 'TwilightEnable', + 'TwilightDisable', + }, }, - { 'RRethy/vim-illuminate' }, + -- { 'RRethy/vim-illuminate' }, - { + { '0oAstro/dim.lua', dependencies = { 'nvim-treesitter/nvim-treesitter', 'neovim/nvim-lspconfig' }, + event = 'LspAttach', }, - { + { 'windwp/nvim-ts-autotag', + event = 'VeryLazy', }, } diff --git a/config/.config/nvim/lua/plugins/ui.lua b/config/.config/nvim/lua/plugins/ui.lua index 2b0e14e..584d991 100644 --- a/config/.config/nvim/lua/plugins/ui.lua +++ b/config/.config/nvim/lua/plugins/ui.lua @@ -1,46 +1,37 @@ return { - { 'winston0410/range-highlight.nvim' }, + { + 'winston0410/range-highlight.nvim', + event = 'VeryLazy', + }, { 'lukas-reineke/indent-blankline.nvim', + event = 'VeryLazy', config = function() require'ibl'.setup{ scope = { enabled = false } } end }, - -- { - -- "folke/noice.nvim", - -- event = "VeryLazy", - -- opts = { - -- -- add any options here - -- command_palette = true, - -- }, - -- dependencies = { - -- -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries - -- "MunifTanjim/nui.nvim", - -- -- OPTIONAL: - -- -- `nvim-notify` is only needed, if you want to use the notification view. - -- -- If not available, we use `mini` as the fallback - -- "rcarriga/nvim-notify", - -- } - -- }, - -- - - { 'nvim-tree/nvim-web-devicons' }, - { - 'goolord/alpha-nvim', - dependencies = { - 'nvim-tree/nvim-web-devicons', - }, - config = function() - require('alpha').setup(require'alpha.themes.startify'.config) - end + 'nvim-tree/nvim-web-devicons', + -- event = 'VeryLazy', + lazy = true, }, + -- { + -- 'goolord/alpha-nvim', + -- dependencies = { + -- 'nvim-tree/nvim-web-devicons', + -- }, + -- config = function() + -- require('alpha').setup(require'alpha.themes.startify'.config) + -- end + -- }, + { 'lewis6991/gitsigns.nvim', + event = 'VeryLazy', opts = { current_line_blame = true, } diff --git a/config/.config/nvim/lua/plugins/util.lua b/config/.config/nvim/lua/plugins/util.lua index d83deb1..26dc80c 100644 --- a/config/.config/nvim/lua/plugins/util.lua +++ b/config/.config/nvim/lua/plugins/util.lua @@ -1,6 +1,9 @@ return { - { "sindrets/diffview.nvim" }, + { + "sindrets/diffview.nvim", + event = 'VeryLazy', + }, { 'windwp/nvim-autopairs', @@ -12,28 +15,44 @@ return { { "NeogitOrg/neogit", + lazy = true, dependencies = { "nvim-lua/plenary.nvim", -- required "sindrets/diffview.nvim", -- optional - Diff integration -- Only one of these is needed. - "nvim-telescope/telescope.nvim", -- optional + -- "nvim-telescope/telescope.nvim", -- optional -- "ibhagwan/fzf-lua", -- optional - -- "echasnovski/mini.pick", -- optional + "echasnovski/mini.pick", -- optional -- "folke/snacks.nvim", -- optional }, }, { 'brenoprata10/nvim-highlight-colors', + event = 'VeryLazy', opts = { render = 'virtual', }, }, + { + 'ggandor/leap.nvim', + dependencies = { + 'tpope/vim-repeat', + }, + config = function() + -- local leap = require('leap') + vim.keymap.set({'n', 'x', 'o'}, '', '(leap)') + vim.keymap.set({'n', 'x', 'o'}, '', '(leap-anywhere)') + vim.keymap.set({'n', 'x', 'o'}, 'gs', require('leap.remote').action) + end, + }, + { 'echasnovski/mini.nvim', config = function() + require('mini.starter').setup() local miniclue = require'mini.clue' miniclue.setup{ window = { @@ -114,7 +133,11 @@ return { lazy = false, }, - { 'eandrju/cellular-automaton.nvim' }, + { + 'eandrju/cellular-automaton.nvim', + -- event = 'VeryLazy', + cmd = 'CellularAutomaton', + }, { "kylechui/nvim-surround", @@ -127,10 +150,25 @@ return { end }, - { 'jbyuki/nabla.nvim' }, + { + 'jbyuki/nabla.nvim', + lazy = true, + }, { 'krady21/compiler-explorer.nvim', + -- event = 'VeryLazy', + cmd = { + 'CECompile', + 'CECompileLive', + 'CEFormat', + 'CEAddLibrary', + 'CELoadExample', + 'CEOpenWebsite', + 'CEDeleteCache', + 'CEShowTooltip', + 'CEGotoLabel', + }, opts = { autocmd = { enable = true, @@ -140,88 +178,89 @@ return { }, { - 'samjwill/nvim-unception' + 'samjwill/nvim-unception', + event = 'VeryLazy', }, - { - "jake-stewart/multicursor.nvim", - branch = "1.0", - config = function() - local mc = require("multicursor-nvim") - mc.setup() - - local set = vim.keymap.set - - -- Add or skip cursor above/below the main cursor. - set({"n", "x"}, "", function() mc.lineAddCursor(-1) end) - set({"n", "x"}, "", function() mc.lineAddCursor(1) end) - -- set({"n", "x"}, "", function() mc.lineSkipCursor(-1) end) - -- set({"n", "x"}, "", function() mc.lineSkipCursor(1) end) - - -- Add or skip adding a new cursor by matching word/selection - -- set({"n", "x"}, "n", function() mc.matchAddCursor(1) end) - -- set({"n", "x"}, "s", function() mc.matchSkipCursor(1) end) - -- set({"n", "x"}, "N", function() mc.matchAddCursor(-1) end) - -- set({"n", "x"}, "S", function() mc.matchSkipCursor(-1) end) - - -- Add cursor at next argument treesitter - set({'n', 'x'}, ']A', function() - if vim.v.count < 1 then - mc.addCursor(']a') - else - for i=1, vim.v.count - 1 do - mc.addCursor(']a') - end - end - end, { desc = 'Create multicursor on next argument'}) - set({'n', 'x'}, '[A', function() - if vim.v.count < 1 then - mc.addCursor('[a') - else - for i=1, vim.v.count - 1 do - mc.addCursor('[a') - end - end - end, { desc = 'Create multicursor on previous argument'}) - - -- Add and remove cursors with control + left click. - set("n", "", mc.handleMouse) - set("n", "", mc.handleMouseDrag) - set("n", "", mc.handleMouseRelease) - - -- Disable and enable cursors. - set({"n", "x"}, "", mc.toggleCursor) - - -- Mappings defined in a keymap layer only apply when there are - -- multiple cursors. This lets you have overlapping mappings. - mc.addKeymapLayer(function(layerSet) - - -- Select a different cursor as the main one. - layerSet({"n", "x"}, "", mc.prevCursor) - layerSet({"n", "x"}, "", mc.nextCursor) - - -- Delete the main cursor. - layerSet({"n", "x"}, "x", mc.deleteCursor) - - -- Enable and clear cursors using escape. - layerSet("n", "", function() - if not mc.cursorsEnabled() then - mc.enableCursors() - else - mc.clearCursors() - end - end) - end) - - -- Customize how cursors look. - local hl = vim.api.nvim_set_hl - hl(0, "MultiCursorCursor", { reverse = true }) - hl(0, "MultiCursorVisual", { link = "Visual" }) - hl(0, "MultiCursorSign", { link = "SignColumn"}) - hl(0, "MultiCursorMatchPreview", { link = "Search" }) - hl(0, "MultiCursorDisabledCursor", { reverse = true }) - hl(0, "MultiCursorDisabledVisual", { link = "Visual" }) - hl(0, "MultiCursorDisabledSign", { link = "SignColumn"}) - end - }, + -- { + -- "jake-stewart/multicursor.nvim", + -- branch = "1.0", + -- config = function() + -- local mc = require("multicursor-nvim") + -- mc.setup() + -- + -- local set = vim.keymap.set + -- + -- -- Add or skip cursor above/below the main cursor. + -- set({"n", "x"}, "", function() mc.lineAddCursor(-1) end) + -- set({"n", "x"}, "", function() mc.lineAddCursor(1) end) + -- -- set({"n", "x"}, "", function() mc.lineSkipCursor(-1) end) + -- -- set({"n", "x"}, "", function() mc.lineSkipCursor(1) end) + -- + -- -- Add or skip adding a new cursor by matching word/selection + -- -- set({"n", "x"}, "n", function() mc.matchAddCursor(1) end) + -- -- set({"n", "x"}, "s", function() mc.matchSkipCursor(1) end) + -- -- set({"n", "x"}, "N", function() mc.matchAddCursor(-1) end) + -- -- set({"n", "x"}, "S", function() mc.matchSkipCursor(-1) end) + -- + -- -- Add cursor at next argument treesitter + -- set({'n', 'x'}, ']A', function() + -- if vim.v.count < 1 then + -- mc.addCursor(']a') + -- else + -- for i=1, vim.v.count - 1 do + -- mc.addCursor(']a') + -- end + -- end + -- end, { desc = 'Create multicursor on next argument'}) + -- set({'n', 'x'}, '[A', function() + -- if vim.v.count < 1 then + -- mc.addCursor('[a') + -- else + -- for i=1, vim.v.count - 1 do + -- mc.addCursor('[a') + -- end + -- end + -- end, { desc = 'Create multicursor on previous argument'}) + -- + -- -- Add and remove cursors with control + left click. + -- set("n", "", mc.handleMouse) + -- set("n", "", mc.handleMouseDrag) + -- set("n", "", mc.handleMouseRelease) + -- + -- -- Disable and enable cursors. + -- set({"n", "x"}, "", mc.toggleCursor) + -- + -- -- Mappings defined in a keymap layer only apply when there are + -- -- multiple cursors. This lets you have overlapping mappings. + -- mc.addKeymapLayer(function(layerSet) + -- + -- -- Select a different cursor as the main one. + -- layerSet({"n", "x"}, "", mc.prevCursor) + -- layerSet({"n", "x"}, "", mc.nextCursor) + -- + -- -- Delete the main cursor. + -- layerSet({"n", "x"}, "x", mc.deleteCursor) + -- + -- -- Enable and clear cursors using escape. + -- layerSet("n", "", function() + -- if not mc.cursorsEnabled() then + -- mc.enableCursors() + -- else + -- mc.clearCursors() + -- end + -- end) + -- end) + -- + -- -- Customize how cursors look. + -- local hl = vim.api.nvim_set_hl + -- hl(0, "MultiCursorCursor", { reverse = true }) + -- hl(0, "MultiCursorVisual", { link = "Visual" }) + -- hl(0, "MultiCursorSign", { link = "SignColumn"}) + -- hl(0, "MultiCursorMatchPreview", { link = "Search" }) + -- hl(0, "MultiCursorDisabledCursor", { reverse = true }) + -- hl(0, "MultiCursorDisabledVisual", { link = "Visual" }) + -- hl(0, "MultiCursorDisabledSign", { link = "SignColumn"}) + -- end + -- }, }