commit 1a6f5d1fab58323e4d26980fea4f3ed4f85e9b7a
parent 4d57e8d8b0434666a149155e63d13e3b5dcb9e27
Author: Thomas Vigouroux <thomas.vigouroux@protonmail.com>
Date: Fri, 26 May 2023 09:18:23 +0200
feat: provide a simple config handling for plugins
Diffstat:
1 file changed, 34 insertions(+), 17 deletions(-)
diff --git a/lua/plugins.lua b/lua/plugins.lua
@@ -15,13 +15,20 @@ local function paq(packages)
vim.cmd.packadd("paq-nvim")
local paqmod = require("paq")
paqmod(packages)
+
+ -- Now go over the packages, and for packages with a `config` key, run the associated function
+ for _, pack in ipairs(packages) do
+ if type(pack) == 'table' and type(pack.config) == 'function' then
+ pack.config()
+ end
+ end
+
if first_install then
vim.notify("Installing plugins... If prompted, hit Enter to continue.")
paqmod.install()
end
end
--- Call helper function
paq {
"savq/paq-nvim",
-- List your packages
@@ -32,17 +39,38 @@ paq {
{ 'vigoux/fzy-lua-native', run = 'make' },
--local azy.nvim
- 'vigoux/notifier.nvim',
+ {
+ 'vigoux/notifier.nvim',
+ config = function()
+ require "notifier".setup {
+ component_name_recall = true,
+ status_width = 50,
+ notify = {
+ clear_time = 5000
+ },
+ }
+ end
+ },
-- TODO: replace these two
'tpope/vim-commentary',
'tpope/vim-surround',
-- LSP stuff
- { url = "https://git.sr.ht/~whynothugo/lsp_lines.nvim" },
- "williamboman/mason.nvim",
+ {
+ url = "https://git.sr.ht/~whynothugo/lsp_lines.nvim",
+ config = function()
+ require("lsp_lines").setup()
+ end
+ },
+ {
+ "williamboman/mason.nvim",
+ config = function()
+ require "mason".setup {}
+ end
+ },
'vigoux/ltex-ls.nvim',
- { 'mfussenegger/nvim-dap', opt=true }, -- TODO load dap-config
+ { 'mfussenegger/nvim-dap', opt = true }, -- TODO load dap-config
--local architext.nvim
'vigoux/templar.nvim',
@@ -57,18 +85,7 @@ paq {
'tamarin-prover/editors'
}
-require "notifier".setup {
- component_name_recall = true,
- status_width = 50,
- notify = {
- clear_time = 5000
- },
-}
-
-require("lsp_lines").setup()
-require "mason".setup {}
-
-require'azy_config'
+require 'azy_config'
-- -- sunjon <3
-- use 'sunjon/extmark-toy.nvim'