Skip to content

Commit d087de7

Browse files
committed
clean up
1 parent 5f8ff7e commit d087de7

1 file changed

Lines changed: 103 additions & 133 deletions

File tree

‎fnl/plugins.fnl‎

Lines changed: 103 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,19 @@
2626
(error "failed to bootstrap lazy.nvim")))
2727
(vim.opt.rtp:prepend lazypath)))
2828

29-
(defn to-lazy-spec
30-
[name opts]
31-
(let [spec [name]
32-
opts (or opts {})]
33-
(each [k v (pairs opts)]
34-
(match k
35-
:requires (tset spec :dependencies v)
36-
:run (tset spec :build v)
37-
:mod (tset spec :config
38-
(fn [_plugin _opts]
39-
(safe-mod-require v)))
40-
_ (tset spec k v)))
41-
spec))
42-
4329
(defn use
4430
[...]
4531
(let [packs [...]
4632
specs []]
4733
(for [i 1 (length packs) 2]
4834
(let [name (. packs i)
49-
opts (. packs (+ i 1))]
50-
(table.insert specs (to-lazy-spec name opts))))
35+
spec (or (. packs (+ i 1)) {})]
36+
(tset spec 1 name)
37+
(when spec.mod
38+
(let [m spec.mod]
39+
(tset spec :config (fn [] (safe-mod-require m)))
40+
(tset spec :mod nil)))
41+
(table.insert specs spec)))
5142
(bootstrap-lazy)
5243
(let [lazy (safe-require :lazy)]
5344
(when lazy
@@ -56,123 +47,102 @@
5647
(lazy.setup specs
5748
{:ui {:border :rounded} :performance {:rtp {:reset false}}})))))
5849

59-
;; setup is used for inline setup for modules that require no or {} arg
60-
61-
(fn setup [...]
62-
(let [in [...]]
63-
(let [name (. in 1)
64-
plugin (safe-require name)]
65-
(when plugin
66-
(if (= 2 (length in))
67-
(let [arg (. in 2)]
68-
(plugin.setup arg))
69-
(plugin.setup))))))
70-
71-
(use ;; bootstrap — must be eager
72-
:Olical/aniseed {}
73-
;; colorschemes — eager so the theme is applied at startup
74-
:NLKNguyen/papercolor-theme {} :projekt0n/github-nvim-theme {}
75-
:catppuccin/nvim {} :AlexvZyl/nordic.nvim {} :loctvl842/monokai-pro.nvim
76-
{:mod :ui.monokai}
77-
;; ui chrome — eager (statusline/tabline/navic must be ready before first render)
78-
:nvim-lualine/lualine.nvim {} :arkav/lualine-lsp-progress
79-
{:mod :ui.lualine} :akinsho/bufferline.nvim
80-
{:requires [[:nvim-tree/nvim-web-devicons]] :mod :ui.tab}
81-
:SmiteshP/nvim-navic {} :nvim-focus/focus.nvim {:mod :ui.focus}
82-
:goolord/alpha-nvim {:mod :ui.alpha} :rcarriga/nvim-notify
83-
{:mod :ui.notify}
84-
;; motion / text-objects — eager so they work from keystroke 1
85-
:ggandor/leap.nvim {:url "https://codeberg.org/andyg/leap.nvim"
86-
:mod :tools.leap}
87-
:wellle/targets.vim {}
88-
;; which-key — eager so every keymap registers its description
89-
:folke/which-key.nvim {:mod :tools.which-key}
90-
;; file explorer — eager so oil takes over directory buffers (netrw)
91-
:stevearc/oil.nvim {:requires [[:nvim-tree/nvim-web-devicons]]
92-
:mod :tools.oil}
93-
;; lsp + completion — eager (attach on BufRead handled internally)
94-
:VonHeikemen/lsp-zero.nvim {:requires [[:neovim/nvim-lspconfig]
95-
[:williamboman/mason.nvim]
96-
[:williamboman/mason-lspconfig.nvim]
97-
[:jay-babu/mason-null-ls.nvim]
98-
[:nvimtools/none-ls.nvim]]
99-
:mod :lsp.lsp}
100-
:saghen/blink.lib {} :saghen/blink.cmp
101-
{:run (fn []
102-
(: ((. (require :blink.cmp) :build)) :pwait))
103-
:requires [[:giuxtaposition/blink-cmp-copilot] [:saghen/blink.lib]]
104-
:mod :lsp.blink} :ray-x/lsp_signature.nvim {} :wakatime/vim-wakatime
105-
{} ;; treesitter — eager (syntax highlight needed immediately)
106-
:nvim-treesitter/nvim-treesitter {:run ":TSUpdate" :mod :tools.treesitter}
107-
;; copilot — defer until insert mode
108-
:zbirenbaum/copilot.lua {:event :InsertEnter :mod :dev.copilot}
109-
;; insert-mode only
110-
:windwp/nvim-autopairs {:event :InsertEnter} :jdhao/better-escape.vim
111-
{:event :InsertEnter :mod :tools.better-escape}
112-
;; buffer decorations — load once a file is open
113-
:lewis6991/gitsigns.nvim
114-
{:event [:BufRead :BufNewFile] :mod :tools.gitsigns} :RRethy/vim-illuminate
115-
{:event :LspAttach :mod :tools.illuminate} :kevinhwang91/nvim-hlslens
116-
{:event [:BufRead :BufNewFile] :mod :ui.hlslens}
117-
:lukas-reineke/indent-blankline.nvim
118-
{:event [:BufRead :BufNewFile] :mod :ui.indentblank :main :ibl}
119-
:catgoose/nvim-colorizer.lua
120-
{:event [:BufRead :BufNewFile] :mod :ui.colorizer} :karb94/neoscroll.nvim
121-
{:event [:BufRead :BufNewFile] :mod :ui.neoscroll}
122-
:sphamba/smear-cursor.nvim {:event :VeryLazy :mod :ui.smear-cursor}
123-
:petertriho/nvim-scrollbar
124-
{:event [:BufRead :BufNewFile] :mod :ui.scrollbar}
125-
:folke/todo-comments.nvim
126-
{:event [:BufRead :BufNewFile]
127-
:requires [[:nvim-lua/plenary.nvim]]
128-
:mod :tools.todo-comments} :MeanderingProgrammer/render-markdown.nvim
129-
{:ft [:markdown :Avante] :mod :ui.render-markdown} ;; filetype-specific
130-
:ray-x/go.nvim {:ft [:go :gomod :gowork] :mod :dev.go_nvim}
131-
:Julian/lean.nvim {:ft [:lean]
132-
:requires [[:neovim/nvim-lspconfig]]
133-
:mod :dev.lean} ;; commands
134-
:folke/trouble.nvim {:cmd [:Trouble :TroubleToggle] :mod :tools.trouble}
135-
:folke/zen-mode.nvim {:cmd :ZenMode :mod :ui.zenmode} :hedyhli/outline.nvim
136-
{:cmd :Outline :mod :lsp.symbols} :esmuellert/codediff.nvim
137-
{:cmd :CodeDiff :mod :tools.codediff} :numToStr/FTerm.nvim
138-
{:cmd :FTerm :mod :tools.fterm}
139-
;; deferred — load after startup, before first user input
140-
:nvim-telescope/telescope.nvim
141-
{:event :VeryLazy
142-
:requires [[:nvim-lua/popup.nvim] [:nvim-lua/plenary.nvim]]
143-
:mod :tools.telescope} :nvim-telescope/telescope-fzf-native.nvim
144-
{:run :make} :nvim-telescope/telescope-media-files.nvim {}
145-
:sopa0/telescope-makefile {:requires [[:akinsho/toggleterm.nvim]]}
146-
:ruifm/gitlinker.nvim {:event :VeryLazy
147-
:requires [[:nvim-lua/plenary.nvim]]
148-
:mod :dev.gitlinker}
149-
:Vonr/align.nvim {:event :VeryLazy :mod :tools.align}
150-
:folke/persistence.nvim {:event :VeryLazy :mod :tools.persistence}
151-
:stevearc/profile.nvim {:event :VeryLazy :mod :dev.profile}
152-
:yetone/avante.nvim {:event :VeryLazy
153-
:requires [[:nvim-treesitter/nvim-treesitter]
154-
[:HakonHarnes/img-clip.nvim]
155-
[:stevearc/dressing.nvim]
156-
[:nvim-lua/plenary.nvim]
157-
[:MunifTanjim/nui.nvim]
158-
[:nvim-tree/nvim-web-devicons]]
159-
:run :make
160-
:mod :dev.avante}
161-
;; dap — load on debug commands
162-
:mfussenegger/nvim-dap {:cmd [:DapContinue
163-
:DapToggleBreakpoint
164-
:DapNew
165-
:DapStepOver
166-
:DapStepInto]}
167-
:mfussenegger/nvim-dap-python
168-
{:ft :python :requires [[:mfussenegger/nvim-dap]]} :rcarriga/nvim-dap-ui
169-
{:cmd [:DapContinue :DapToggleBreakpoint]
170-
:requires [[:mfussenegger/nvim-dap] [:nvim-neotest/nvim-nio]]}
171-
:jay-babu/mason-nvim-dap.nvim
172-
{:cmd [:DapContinue :DapToggleBreakpoint]
173-
:requires [[:williamboman/mason.nvim] [:mfussenegger/nvim-dap]]
174-
:mod :dev.dap} ;; misc
175-
:gruvw/strudel.nvim {:run "npm install" :mod :misc.strudel})
50+
(use
51+
;; bootstrap
52+
:Olical/aniseed {}
53+
;; colorschemes
54+
:NLKNguyen/papercolor-theme {}
55+
:projekt0n/github-nvim-theme {}
56+
:catppuccin/nvim {}
57+
:AlexvZyl/nordic.nvim {}
58+
:loctvl842/monokai-pro.nvim {:mod :ui.monokai}
59+
;; ui chrome
60+
:nvim-lualine/lualine.nvim {}
61+
:arkav/lualine-lsp-progress {:mod :ui.lualine}
62+
:akinsho/bufferline.nvim {:dependencies [:nvim-tree/nvim-web-devicons] :mod :ui.tab}
63+
:SmiteshP/nvim-navic {}
64+
:nvim-focus/focus.nvim {:mod :ui.focus}
65+
:goolord/alpha-nvim {:mod :ui.alpha}
66+
:rcarriga/nvim-notify {:mod :ui.notify}
67+
;; motion
68+
:ggandor/leap.nvim {:url "https://codeberg.org/andyg/leap.nvim" :mod :tools.leap}
69+
:wellle/targets.vim {}
70+
:folke/which-key.nvim {:mod :tools.which-key}
71+
;; file explorer
72+
:stevearc/oil.nvim {:dependencies [:nvim-tree/nvim-web-devicons] :mod :tools.oil}
73+
;; lsp + completion
74+
:VonHeikemen/lsp-zero.nvim {:dependencies [:neovim/nvim-lspconfig
75+
:williamboman/mason.nvim
76+
:williamboman/mason-lspconfig.nvim
77+
:jay-babu/mason-null-ls.nvim
78+
:nvimtools/none-ls.nvim]
79+
:mod :lsp.lsp}
80+
:saghen/blink.lib {}
81+
:saghen/blink.cmp {:build (fn [] (: ((. (require :blink.cmp) :build)) :pwait))
82+
:dependencies [:giuxtaposition/blink-cmp-copilot
83+
:saghen/blink.lib]
84+
:mod :lsp.blink}
85+
:ray-x/lsp_signature.nvim {}
86+
:wakatime/vim-wakatime {}
87+
;; treesitter
88+
:nvim-treesitter/nvim-treesitter {:build ":TSUpdate" :mod :tools.treesitter}
89+
;; copilot
90+
:zbirenbaum/copilot.lua {:event :InsertEnter :mod :dev.copilot}
91+
;; insert-mode only
92+
:windwp/nvim-autopairs {:event :InsertEnter}
93+
:jdhao/better-escape.vim {:event :InsertEnter :mod :tools.better-escape}
94+
;; buffer decorations
95+
:lewis6991/gitsigns.nvim {:event [:BufRead :BufNewFile] :mod :tools.gitsigns}
96+
:RRethy/vim-illuminate {:event :LspAttach :mod :tools.illuminate}
97+
:kevinhwang91/nvim-hlslens {:event [:BufRead :BufNewFile] :mod :ui.hlslens}
98+
:lukas-reineke/indent-blankline.nvim {:event [:BufRead :BufNewFile] :main :ibl :mod :ui.indentblank}
99+
:catgoose/nvim-colorizer.lua {:event [:BufRead :BufNewFile] :mod :ui.colorizer}
100+
:karb94/neoscroll.nvim {:event [:BufRead :BufNewFile] :mod :ui.neoscroll}
101+
:sphamba/smear-cursor.nvim {:event :VeryLazy :mod :ui.smear-cursor}
102+
:petertriho/nvim-scrollbar {:event [:BufRead :BufNewFile] :mod :ui.scrollbar}
103+
:folke/todo-comments.nvim {:event [:BufRead :BufNewFile] :dependencies [:nvim-lua/plenary.nvim] :mod :tools.todo-comments}
104+
:MeanderingProgrammer/render-markdown.nvim {:ft [:markdown :Avante] :mod :ui.render-markdown}
105+
;; filetype-specific
106+
:ray-x/go.nvim {:ft [:go :gomod :gowork] :mod :dev.go_nvim}
107+
:Julian/lean.nvim {:ft [:lean] :dependencies [:neovim/nvim-lspconfig] :mod :dev.lean}
108+
;; commands
109+
:folke/trouble.nvim {:cmd [:Trouble :TroubleToggle] :mod :tools.trouble}
110+
:folke/zen-mode.nvim {:cmd :ZenMode :mod :ui.zenmode}
111+
:hedyhli/outline.nvim {:cmd :Outline :mod :lsp.symbols}
112+
:esmuellert/codediff.nvim {:cmd :CodeDiff :mod :tools.codediff}
113+
:numToStr/FTerm.nvim {:cmd :FTerm :mod :tools.fterm}
114+
;; deferred
115+
:nvim-telescope/telescope.nvim {:event :VeryLazy
116+
:dependencies [:nvim-lua/popup.nvim
117+
:nvim-lua/plenary.nvim]
118+
:mod :tools.telescope}
119+
:nvim-telescope/telescope-fzf-native.nvim {:build :make}
120+
:nvim-telescope/telescope-media-files.nvim {}
121+
:sopa0/telescope-makefile {:dependencies [:akinsho/toggleterm.nvim]}
122+
:ruifm/gitlinker.nvim {:event :VeryLazy :dependencies [:nvim-lua/plenary.nvim] :mod :dev.gitlinker}
123+
:Vonr/align.nvim {:event :VeryLazy :mod :tools.align}
124+
:folke/persistence.nvim {:event :VeryLazy :mod :tools.persistence}
125+
:stevearc/profile.nvim {:event :VeryLazy :mod :dev.profile}
126+
:yetone/avante.nvim {:event :VeryLazy
127+
:dependencies [:nvim-treesitter/nvim-treesitter
128+
:HakonHarnes/img-clip.nvim
129+
:stevearc/dressing.nvim
130+
:nvim-lua/plenary.nvim
131+
:MunifTanjim/nui.nvim
132+
:nvim-tree/nvim-web-devicons]
133+
:build :make
134+
:mod :dev.avante}
135+
;; dap
136+
:mfussenegger/nvim-dap {:cmd [:DapContinue
137+
:DapToggleBreakpoint
138+
:DapNew
139+
:DapStepOver
140+
:DapStepInto]}
141+
:mfussenegger/nvim-dap-python {:ft :python :dependencies [:mfussenegger/nvim-dap]}
142+
:rcarriga/nvim-dap-ui {:cmd [:DapContinue :DapToggleBreakpoint] :dependencies [:mfussenegger/nvim-dap :nvim-neotest/nvim-nio]}
143+
:jay-babu/mason-nvim-dap.nvim {:cmd [:DapContinue :DapToggleBreakpoint] :dependencies [:williamboman/mason.nvim :mfussenegger/nvim-dap] :mod :dev.dap}
144+
;; misc
145+
:gruvw/strudel.nvim {:build "npm install" :mod :misc.strudel})
176146

177147
(map [:n] :<space>pi ":Lazy install<cr>" {:desc "Install plugins"})
178148
(map [:n] :<space>pu ":Lazy update<cr>" {:desc "Update plugins"})

0 commit comments

Comments
 (0)