From 6e4b1ecb82cbe44a7e9d88f43d98653a5fff3a33 Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Fri, 7 Jun 2024 16:00:02 -0400 Subject: [PATCH] nvim: put plugins into opt/ this way supposedly we can explicitly load the plugin next to the relevant configuration --- .gitmodules | 36 +++++++++---------- src/.config/nvim/init.vim | 1 + src/.config/nvim/lua/coding.lua | 19 +++++++--- src/.config/nvim/lua/debugging.lua | 6 ++++ src/.config/nvim/lua/init.lua | 7 +++- src/.config/nvim/lua/snippets.lua | 2 ++ src/.config/nvim/lua/theme.lua | 4 ++- .../nvim/site/pack/3pp/{start => opt}/LuaSnip | 0 .../site/pack/3pp/{start => opt}/auto-pairs | 0 .../site/pack/3pp/{start => opt}/cmp-nvim-lsp | 0 .../site/pack/3pp/{start => opt}/cmp_luasnip | 0 .../pack/3pp/{start => opt}/colorbuddy.nvim | 0 .../pack/3pp/{start => opt}/dressing.nvim | 0 .../site/pack/3pp/{start => opt}/nvim-cmp | 0 .../site/pack/3pp/{start => opt}/nvim-dap | 0 .../site/pack/3pp/{start => opt}/nvim-dap-ui | 0 .../pack/3pp/{start => opt}/nvim-lspconfig | 0 .../site/pack/3pp/{start => opt}/nvim-nio | 0 .../pack/3pp/{start => opt}/nvim-noirbuddy | 0 .../pack/3pp/{start => opt}/nvim-treesitter | 0 .../nvim-treesitter-textobjects | 0 .../site/pack/3pp/{start => opt}/plenary.nvim | 0 .../pack/3pp/{start => opt}/telescope.nvim | 0 .../site/pack/3pp/{start => opt}/trouble.nvim | 0 .../pack/3pp/{start => opt}/vim-gitgutter | 0 25 files changed, 50 insertions(+), 25 deletions(-) rename src/.local/share/nvim/site/pack/3pp/{start => opt}/LuaSnip (100%) rename src/.local/share/nvim/site/pack/3pp/{start => opt}/auto-pairs (100%) rename src/.local/share/nvim/site/pack/3pp/{start => opt}/cmp-nvim-lsp (100%) rename src/.local/share/nvim/site/pack/3pp/{start => opt}/cmp_luasnip (100%) rename src/.local/share/nvim/site/pack/3pp/{start => opt}/colorbuddy.nvim (100%) rename src/.local/share/nvim/site/pack/3pp/{start => opt}/dressing.nvim (100%) rename src/.local/share/nvim/site/pack/3pp/{start => opt}/nvim-cmp (100%) rename src/.local/share/nvim/site/pack/3pp/{start => opt}/nvim-dap (100%) rename src/.local/share/nvim/site/pack/3pp/{start => opt}/nvim-dap-ui (100%) rename src/.local/share/nvim/site/pack/3pp/{start => opt}/nvim-lspconfig (100%) rename src/.local/share/nvim/site/pack/3pp/{start => opt}/nvim-nio (100%) rename src/.local/share/nvim/site/pack/3pp/{start => opt}/nvim-noirbuddy (100%) rename src/.local/share/nvim/site/pack/3pp/{start => opt}/nvim-treesitter (100%) rename src/.local/share/nvim/site/pack/3pp/{start => opt}/nvim-treesitter-textobjects (100%) rename src/.local/share/nvim/site/pack/3pp/{start => opt}/plenary.nvim (100%) rename src/.local/share/nvim/site/pack/3pp/{start => opt}/telescope.nvim (100%) rename src/.local/share/nvim/site/pack/3pp/{start => opt}/trouble.nvim (100%) rename src/.local/share/nvim/site/pack/3pp/{start => opt}/vim-gitgutter (100%) diff --git a/.gitmodules b/.gitmodules index a23a34e..385912a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -17,52 +17,52 @@ # prompts # telescope.vim [submodule "src/.local/share/nvim/site/pack/3pp/start/telescope.nvim"] - path = src/.local/share/nvim/site/pack/3pp/start/telescope.nvim + path = src/.local/share/nvim/site/pack/3pp/opt/telescope.nvim url = https://github.com/nvim-telescope/telescope.nvim.git [submodule "src/.local/share/nvim/site/pack/3pp/start/plenary.nvim"] - path = src/.local/share/nvim/site/pack/3pp/start/plenary.nvim + path = src/.local/share/nvim/site/pack/3pp/opt/plenary.nvim url = https://github.com/nvim-lua/plenary.nvim.git # git symbols in the gutter [submodule "src/.local/share/nvim/site/pack/3pp/start/vim-gitgutter"] - path = src/.local/share/nvim/site/pack/3pp/start/vim-gitgutter + path = src/.local/share/nvim/site/pack/3pp/opt/vim-gitgutter url = https://github.com/airblade/vim-gitgutter.git # auto close brackets and quotes # coding.vim [submodule "src/.local/share/nvim/site/pack/3pp/start/auto-pairs"] - path = src/.local/share/nvim/site/pack/3pp/start/auto-pairs + path = src/.local/share/nvim/site/pack/3pp/opt/auto-pairs url = https://github.com/jiangmiao/auto-pairs # language smarts # coding.lua [submodule "src/.local/share/nvim/site/pack/3pp/start/nvim-lspconfig"] - path = src/.local/share/nvim/site/pack/3pp/start/nvim-lspconfig + path = src/.local/share/nvim/site/pack/3pp/opt/nvim-lspconfig url = https://github.com/neovim/nvim-lspconfig.git [submodule "src/.local/share/nvim/site/pack/3pp/start/nvim-cmp"] - path = src/.local/share/nvim/site/pack/3pp/start/nvim-cmp + path = src/.local/share/nvim/site/pack/3pp/opt/nvim-cmp url = https://github.com/hrsh7th/nvim-cmp.git [submodule "src/.local/share/nvim/site/pack/3pp/start/cmp-nvim-lsp"] - path = src/.local/share/nvim/site/pack/3pp/start/cmp-nvim-lsp + path = src/.local/share/nvim/site/pack/3pp/opt/cmp-nvim-lsp url = https://github.com/hrsh7th/cmp-nvim-lsp.git [submodule "src/.local/share/nvim/site/pack/3pp/start/nvim-treesitter"] - path = src/.local/share/nvim/site/pack/3pp/start/nvim-treesitter + path = src/.local/share/nvim/site/pack/3pp/opt/nvim-treesitter url = https://github.com/nvim-treesitter/nvim-treesitter.git # intelligent motions based on treesitter [submodule "src/.local/share/nvim/site/pack/3pp/start/nvim-treesitter-textobjects"] - path = src/.local/share/nvim/site/pack/3pp/start/nvim-treesitter-textobjects + path = src/.local/share/nvim/site/pack/3pp/opt/nvim-treesitter-textobjects url = https://github.com/nvim-treesitter/nvim-treesitter-textobjects # error/warning/info box # coding.lua [submodule "src/.local/share/nvim/site/pack/3pp/start/trouble.nvim"] - path = src/.local/share/nvim/site/pack/3pp/start/trouble.nvim + path = src/.local/share/nvim/site/pack/3pp/opt/trouble.nvim url = https://github.com/folke/trouble.nvim # aesthetic changes # init.lua [submodule "src/.local/share/nvim/site/pack/3pp/start/dressing.nvim"] - path = src/.local/share/nvim/site/pack/3pp/start/dressing.nvim + path = src/.local/share/nvim/site/pack/3pp/opt/dressing.nvim url = https://github.com/stevearc/dressing.nvim.git # plain-text-accounting ledger ftplugin @@ -80,30 +80,30 @@ # color theme # init.lua [submodule "src/.local/share/nvim/site/pack/3pp/start/nvim-noirbuddy"] - path = src/.local/share/nvim/site/pack/3pp/start/nvim-noirbuddy + path = src/.local/share/nvim/site/pack/3pp/opt/nvim-noirbuddy url = https://github.com/jesseleite/nvim-noirbuddy.git [submodule "src/.local/share/nvim/site/pack/3pp/start/colorbuddy.nvim"] - path = src/.local/share/nvim/site/pack/3pp/start/colorbuddy.nvim + path = src/.local/share/nvim/site/pack/3pp/opt/colorbuddy.nvim url = https://github.com/tjdevries/colorbuddy.nvim.git # debug adapter protocol # debugging.lua [submodule "src/.local/share/nvim/site/pack/3pp/start/nvim-dap"] - path = src/.local/share/nvim/site/pack/3pp/start/nvim-dap + path = src/.local/share/nvim/site/pack/3pp/opt/nvim-dap url = https://github.com/mfussenegger/nvim-dap.git [submodule "src/.local/share/nvim/site/pack/3pp/start/nvim-dap-ui"] - path = src/.local/share/nvim/site/pack/3pp/start/nvim-dap-ui + path = src/.local/share/nvim/site/pack/3pp/opt/nvim-dap-ui url = https://github.com/rcarriga/nvim-dap-ui.git [submodule "src/.local/share/nvim/site/pack/3pp/start/nvim-nio"] - path = src/.local/share/nvim/site/pack/3pp/start/nvim-nio + path = src/.local/share/nvim/site/pack/3pp/opt/nvim-nio url = https://github.com/nvim-neotest/nvim-nio # snippet support # snippets.lua # (also coding.lua becuase nvim-cmp uses this too) [submodule "src/.local/share/nvim/site/pack/3pp/start/LuaSnip"] - path = src/.local/share/nvim/site/pack/3pp/start/LuaSnip + path = src/.local/share/nvim/site/pack/3pp/opt/LuaSnip url = https://github.com/L3MON4D3/LuaSnip [submodule "src/.local/share/nvim/site/pack/3pp/start/cmp_luasnip"] - path = src/.local/share/nvim/site/pack/3pp/start/cmp_luasnip + path = src/.local/share/nvim/site/pack/3pp/opt/cmp_luasnip url = https://github.com/saadparwaiz1/cmp_luasnip diff --git a/src/.config/nvim/init.vim b/src/.config/nvim/init.vim index a864f5b..dcffb65 100755 --- a/src/.config/nvim/init.vim +++ b/src/.config/nvim/init.vim @@ -84,4 +84,5 @@ set foldexpr=nvim_treesitter#foldexpr() set foldlevel=99 " auto-pairs +packadd auto-pairs let g:AutoPairsFlyMode = 0 diff --git a/src/.config/nvim/lua/coding.lua b/src/.config/nvim/lua/coding.lua index bc8030f..b1f5dcf 100644 --- a/src/.config/nvim/lua/coding.lua +++ b/src/.config/nvim/lua/coding.lua @@ -27,11 +27,18 @@ vim.api.nvim_create_autocmd( } ) +------ +-- git gutter +------ + +vim.cmd.packadd("vim-gitgutter") ------ -- syntax highlighting --- plug: nvim-treesitter ------ + +vim.cmd.packadd("nvim-treesitter") + require 'nvim-treesitter.configs'.setup { ensure_installed = { "c", "cpp", "javascript", "typescript", "python", "vim", "fish", "bash", "lua", "rust" }, sync_install = false, @@ -51,8 +58,8 @@ require 'nvim-treesitter.configs'.setup { ------ -- treesitter (language intelligent) motions --- plug: nvim-treesitter-textobjects ------ +vim.cmd.packadd("nvim-treesitter-textobjects") require("nvim-treesitter.configs").setup { textobjects = { select = { @@ -71,8 +78,8 @@ require("nvim-treesitter.configs").setup { ------ -- diagnostics box --- plug: trouble.nvim ------ +vim.cmd.packadd("trouble.nvim") require('trouble').setup({ icons = false, fold_open = "v", -- icon used for open folds @@ -104,8 +111,8 @@ keymap("gR", "TroubleToggle lsp_references") ------ -- language server (LSP) --- plug: nvim-lspconfig ------ +vim.cmd.packadd("nvim-lspconfig") local on_attach = function(client, bufnr) local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end -- Enable completion triggered by @@ -193,8 +200,10 @@ end ------ -- completions --- plug: nvim-cmp, cmp-nvim-lsp ------ +vim.cmd.packadd("nvim-cmp") +vim.cmd.packadd("cmp-nvim-lsp") + local cmp = require('cmp') cmp.setup({ window = { diff --git a/src/.config/nvim/lua/debugging.lua b/src/.config/nvim/lua/debugging.lua index 22f33a4..7970531 100644 --- a/src/.config/nvim/lua/debugging.lua +++ b/src/.config/nvim/lua/debugging.lua @@ -3,6 +3,12 @@ local confutil = require("confutil") local keymap = confutil.keymap +-- dependency +vim.cmd.packadd("nvim-nio") + +vim.cmd.packadd("nvim-dap") +vim.cmd.packadd("nvim-dap-ui") + local dap = require("dap") local dapui = require("dapui") diff --git a/src/.config/nvim/lua/init.lua b/src/.config/nvim/lua/init.lua index 39377d5..5b87022 100644 --- a/src/.config/nvim/lua/init.lua +++ b/src/.config/nvim/lua/init.lua @@ -1,5 +1,7 @@ -- lua entry point +vim.cmd.packadd("plenary.nvim") + local confutil = require("confutil") local keymap = confutil.keymap @@ -16,13 +18,16 @@ keymap("uu", ":let @+ = expand('')") ------ -- fancy prompts --- plug: dressing.nvim, telescope.nvim, plenary.nvim ------ +vim.cmd.packadd("dressing.nvim") require('dressing').setup({ input = { insert_only = false, } }) + +-- requires plenary.nvim +vim.cmd.packadd("telescope.nvim") keymap("ef", "Telescope find_files") keymap("eg", "Telescope live_grep") keymap("em", "Telescope buffers") diff --git a/src/.config/nvim/lua/snippets.lua b/src/.config/nvim/lua/snippets.lua index 1e78d8e..1480949 100644 --- a/src/.config/nvim/lua/snippets.lua +++ b/src/.config/nvim/lua/snippets.lua @@ -1,5 +1,7 @@ -- Snippet engine +vim.cmd.packadd("LuaSnip") + -- see coding.lua because it also uses luasnip -- snippets live in .config/nvim/snippets/ diff --git a/src/.config/nvim/lua/theme.lua b/src/.config/nvim/lua/theme.lua index e82fff3..971b0af 100644 --- a/src/.config/nvim/lua/theme.lua +++ b/src/.config/nvim/lua/theme.lua @@ -1,8 +1,10 @@ ------ -- color theme --- plug: nvim-noirbuddy, colorbuddy.nvim ------ +vim.cmd.packadd("nvim-noirbuddy") +vim.cmd.packadd("colorbuddy.nvim") + require("noirbuddy").setup({ colors = { primary = "#99AABB" diff --git a/src/.local/share/nvim/site/pack/3pp/start/LuaSnip b/src/.local/share/nvim/site/pack/3pp/opt/LuaSnip similarity index 100% rename from src/.local/share/nvim/site/pack/3pp/start/LuaSnip rename to src/.local/share/nvim/site/pack/3pp/opt/LuaSnip diff --git a/src/.local/share/nvim/site/pack/3pp/start/auto-pairs b/src/.local/share/nvim/site/pack/3pp/opt/auto-pairs similarity index 100% rename from src/.local/share/nvim/site/pack/3pp/start/auto-pairs rename to src/.local/share/nvim/site/pack/3pp/opt/auto-pairs diff --git a/src/.local/share/nvim/site/pack/3pp/start/cmp-nvim-lsp b/src/.local/share/nvim/site/pack/3pp/opt/cmp-nvim-lsp similarity index 100% rename from src/.local/share/nvim/site/pack/3pp/start/cmp-nvim-lsp rename to src/.local/share/nvim/site/pack/3pp/opt/cmp-nvim-lsp diff --git a/src/.local/share/nvim/site/pack/3pp/start/cmp_luasnip b/src/.local/share/nvim/site/pack/3pp/opt/cmp_luasnip similarity index 100% rename from src/.local/share/nvim/site/pack/3pp/start/cmp_luasnip rename to src/.local/share/nvim/site/pack/3pp/opt/cmp_luasnip diff --git a/src/.local/share/nvim/site/pack/3pp/start/colorbuddy.nvim b/src/.local/share/nvim/site/pack/3pp/opt/colorbuddy.nvim similarity index 100% rename from src/.local/share/nvim/site/pack/3pp/start/colorbuddy.nvim rename to src/.local/share/nvim/site/pack/3pp/opt/colorbuddy.nvim diff --git a/src/.local/share/nvim/site/pack/3pp/start/dressing.nvim b/src/.local/share/nvim/site/pack/3pp/opt/dressing.nvim similarity index 100% rename from src/.local/share/nvim/site/pack/3pp/start/dressing.nvim rename to src/.local/share/nvim/site/pack/3pp/opt/dressing.nvim diff --git a/src/.local/share/nvim/site/pack/3pp/start/nvim-cmp b/src/.local/share/nvim/site/pack/3pp/opt/nvim-cmp similarity index 100% rename from src/.local/share/nvim/site/pack/3pp/start/nvim-cmp rename to src/.local/share/nvim/site/pack/3pp/opt/nvim-cmp diff --git a/src/.local/share/nvim/site/pack/3pp/start/nvim-dap b/src/.local/share/nvim/site/pack/3pp/opt/nvim-dap similarity index 100% rename from src/.local/share/nvim/site/pack/3pp/start/nvim-dap rename to src/.local/share/nvim/site/pack/3pp/opt/nvim-dap diff --git a/src/.local/share/nvim/site/pack/3pp/start/nvim-dap-ui b/src/.local/share/nvim/site/pack/3pp/opt/nvim-dap-ui similarity index 100% rename from src/.local/share/nvim/site/pack/3pp/start/nvim-dap-ui rename to src/.local/share/nvim/site/pack/3pp/opt/nvim-dap-ui diff --git a/src/.local/share/nvim/site/pack/3pp/start/nvim-lspconfig b/src/.local/share/nvim/site/pack/3pp/opt/nvim-lspconfig similarity index 100% rename from src/.local/share/nvim/site/pack/3pp/start/nvim-lspconfig rename to src/.local/share/nvim/site/pack/3pp/opt/nvim-lspconfig diff --git a/src/.local/share/nvim/site/pack/3pp/start/nvim-nio b/src/.local/share/nvim/site/pack/3pp/opt/nvim-nio similarity index 100% rename from src/.local/share/nvim/site/pack/3pp/start/nvim-nio rename to src/.local/share/nvim/site/pack/3pp/opt/nvim-nio diff --git a/src/.local/share/nvim/site/pack/3pp/start/nvim-noirbuddy b/src/.local/share/nvim/site/pack/3pp/opt/nvim-noirbuddy similarity index 100% rename from src/.local/share/nvim/site/pack/3pp/start/nvim-noirbuddy rename to src/.local/share/nvim/site/pack/3pp/opt/nvim-noirbuddy diff --git a/src/.local/share/nvim/site/pack/3pp/start/nvim-treesitter b/src/.local/share/nvim/site/pack/3pp/opt/nvim-treesitter similarity index 100% rename from src/.local/share/nvim/site/pack/3pp/start/nvim-treesitter rename to src/.local/share/nvim/site/pack/3pp/opt/nvim-treesitter diff --git a/src/.local/share/nvim/site/pack/3pp/start/nvim-treesitter-textobjects b/src/.local/share/nvim/site/pack/3pp/opt/nvim-treesitter-textobjects similarity index 100% rename from src/.local/share/nvim/site/pack/3pp/start/nvim-treesitter-textobjects rename to src/.local/share/nvim/site/pack/3pp/opt/nvim-treesitter-textobjects diff --git a/src/.local/share/nvim/site/pack/3pp/start/plenary.nvim b/src/.local/share/nvim/site/pack/3pp/opt/plenary.nvim similarity index 100% rename from src/.local/share/nvim/site/pack/3pp/start/plenary.nvim rename to src/.local/share/nvim/site/pack/3pp/opt/plenary.nvim diff --git a/src/.local/share/nvim/site/pack/3pp/start/telescope.nvim b/src/.local/share/nvim/site/pack/3pp/opt/telescope.nvim similarity index 100% rename from src/.local/share/nvim/site/pack/3pp/start/telescope.nvim rename to src/.local/share/nvim/site/pack/3pp/opt/telescope.nvim diff --git a/src/.local/share/nvim/site/pack/3pp/start/trouble.nvim b/src/.local/share/nvim/site/pack/3pp/opt/trouble.nvim similarity index 100% rename from src/.local/share/nvim/site/pack/3pp/start/trouble.nvim rename to src/.local/share/nvim/site/pack/3pp/opt/trouble.nvim diff --git a/src/.local/share/nvim/site/pack/3pp/start/vim-gitgutter b/src/.local/share/nvim/site/pack/3pp/opt/vim-gitgutter similarity index 100% rename from src/.local/share/nvim/site/pack/3pp/start/vim-gitgutter rename to src/.local/share/nvim/site/pack/3pp/opt/vim-gitgutter