summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2024-01-05 14:21:05 +0100
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2024-01-05 14:21:05 +0100
commitba5400946e9ee19dce851e91a36bb1670d265233 (patch)
treed0b80efd53111ee097bb52763097be22adfb04cf
parentfdff316fff423dd37a093ce1fff1ab289533305c (diff)
Fix loading of plugins
-rw-r--r--fnl/aktersnurra.fnl7
-rw-r--r--fnl/plugins/init.fnl10
-rw-r--r--fnl/plugins/lsp/init.fnl2
-rw-r--r--fnl/plugins/treesitter.fnl2
-rw-r--r--lazy-lock.json4
5 files changed, 18 insertions, 7 deletions
diff --git a/fnl/aktersnurra.fnl b/fnl/aktersnurra.fnl
index df07743..f9c7ca2 100644
--- a/fnl/aktersnurra.fnl
+++ b/fnl/aktersnurra.fnl
@@ -34,8 +34,7 @@
(.. (. icons :star) " ")
(.. (. icons :line) " ")]}}})
-(let [lazy (require :lazy)]
+(let [lazy (require :lazy)
+ plugins (require :plugins)]
(vim.keymap.set :n :<leader>y "<cmd>Lazy home<cr>" {:desc :Home})
- (lazy.setup {:spec [{:import :plugins}
- {:import :plugins.lsp.lspconfig}
- {:import :plugins.lsp.mason}]} opts))
+ (lazy.setup plugins opts))
diff --git a/fnl/plugins/init.fnl b/fnl/plugins/init.fnl
new file mode 100644
index 0000000..470776e
--- /dev/null
+++ b/fnl/plugins/init.fnl
@@ -0,0 +1,10 @@
+;; Load all plugins.
+
+(let [plugins []
+ path (.. (vim.fn.stdpath :config) :/fnl/plugins)]
+ (each [fname (vim.fs.dir path)]
+ (let [fname (fname:match "^(.*)%.fnl$")]
+ (if (and (not= fname nil) (not= fname :init))
+ (table.insert plugins (require (.. :plugins. fname))))))
+ (table.insert plugins (require :plugins.lsp))
+ plugins)
diff --git a/fnl/plugins/lsp/init.fnl b/fnl/plugins/lsp/init.fnl
index c06a5aa..f04ba86 100644
--- a/fnl/plugins/lsp/init.fnl
+++ b/fnl/plugins/lsp/init.fnl
@@ -1 +1,3 @@
;; Lsp plugins.
+
+[(require :plugins.lsp.lspconfig) (require :plugins.lsp.mason)]
diff --git a/fnl/plugins/treesitter.fnl b/fnl/plugins/treesitter.fnl
index 103948d..c863f03 100644
--- a/fnl/plugins/treesitter.fnl
+++ b/fnl/plugins/treesitter.fnl
@@ -80,5 +80,5 @@
{1 :nvim-treesitter/nvim-treesitter
:dependencies [{1 :nvim-treesitter/nvim-treesitter-textobjects :lazy true}]
:build ":TSUpdate"
- :event [:BufReadPost :BufNewFile]
+ :event [:VeryLazy]
: config}
diff --git a/lazy-lock.json b/lazy-lock.json
index a8d5bf4..e5c18ce 100644
--- a/lazy-lock.json
+++ b/lazy-lock.json
@@ -20,7 +20,7 @@
"friendly-snippets": { "branch": "main", "commit": "53d3df271d031c405255e99410628c26a8f0d2b0" },
"git-conflict.nvim": { "branch": "main", "commit": "80bc8931d4ed8c8c4d289a08e1838fcf4741408d" },
"git-worktree.nvim": { "branch": "master", "commit": "f247308e68dab9f1133759b05d944569ad054546" },
- "gitsigns.nvim": { "branch": "main", "commit": "d195f0c35ced5174d3ecce1c4c8ebb3b5bc23fa9" },
+ "gitsigns.nvim": { "branch": "main", "commit": "3e6e91b09f0468c32d3b96dcacf4b947f037ce25" },
"harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" },
"hotpot.nvim": { "branch": "master", "commit": "0d0f414682a3e7d1561beac1f1545d8f8541599f" },
"lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" },
@@ -42,7 +42,7 @@
"nvim-lspconfig": { "branch": "master", "commit": "ce0e625df61be77abe1340fbc9afe9ad39b31dd8" },
"nvim-spectre": { "branch": "master", "commit": "d8906855f1949ac97b1e77aaf8d3fe12ed158ddc" },
"nvim-surround": { "branch": "main", "commit": "633a0ab03159569a66b65671b0ffb1a6aed6cf18" },
- "nvim-treesitter": { "branch": "master", "commit": "8ae4080c5ba59d81b4e49525d4168807bc098e73" },
+ "nvim-treesitter": { "branch": "master", "commit": "9288d9b5059e6b409b5077399dc0b377a112d9f2" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "85b9d0cbd4ff901abcda862b50dbb34e0901848b" },
"nvim-various-textobjs": { "branch": "main", "commit": "3d5fe55e79a7d7b64cd715e37b5db7252379f573" },
"nvim-web-devicons": { "branch": "master", "commit": "3e24abe1ae66532135cec911562f553fe247cb56" },