commit 94fe76059d2e56721ed5b8943f08637d88687839
parent 028b57a5176fd3f767931da8a9b90ac7a82eaa05
Author: mtmn <miro@haravara.org>
Date: Sat, 25 Apr 2026 21:35:40 +0200
nvim: remove lazy.nvim dependency
Diffstat:
2 files changed, 58 insertions(+), 74 deletions(-)
diff --git a/modules/mixins/dotfiles/config/nvim/fnl/config/treesitter.fnl b/modules/mixins/dotfiles/config/nvim/fnl/config/treesitter.fnl
@@ -3,11 +3,9 @@
(fn config []
(autocmd :FileType
{:callback (fn []
- (let [lang (vim.treesitter.language.get_lang vim.bo.filetype)]
- (when (and lang
- (pcall vim.treesitter.language.inspect
- lang))
- (vim.treesitter.start 0 lang)
+ (let [lang (vim.treesitter.language.get_lang vim.bo.filetype)
+ (ok) (pcall vim.treesitter.start 0 lang)]
+ (when (and lang ok)
(set vim.wo.foldmethod :expr)
(set vim.wo.foldexpr
"v:lua.vim.treesitter.foldexpr()"))))}))
diff --git a/modules/mixins/dotfiles/config/nvim/fnl/init.fnl b/modules/mixins/dotfiles/config/nvim/fnl/init.fnl
@@ -5,80 +5,66 @@
(local {: stdpath : empty : glob} vim.fn)
(local {: format} string)
-(fn bootstrap-lazy []
- (local lazypath (.. (vim.fn.stdpath :data) :/lazy/lazy.nvim))
- (when (not (vim.uv.fs_stat lazypath))
- (local lazyrepo "https://github.com/folke/lazy.nvim.git")
- (local out (vim.fn.system [:git
- :clone
- "--filter=blob:none"
- :--branch=stable
- lazyrepo
- lazypath]))
- (when (not= vim.v.shell_error 0)
- (vim.fn.getchar)
- (os.exit 1)))
- (vim.opt.rtp:prepend lazypath)
- (require :lazy))
+(fn gh [name] (.. "https://github.com/" name))
;; fnlfmt: skip
-(fn plugin_specs []
- (fn use [name opts]
- (let [opts (or opts {})]
- (tset opts 1 name)
- opts))
+(fn setup-plugins []
+ ;; Require config modules before pack.add alters runtimepath
+ (local blink (require :config.blink))
+ (local lsp (require :config.lsp))
+ (local treesitter (require :config.treesitter))
- [
- (use "aymenhafeez/doric-themes.nvim"
- {:lazy false
- :priority 1000
- :config (fn []
- (vim.cmd.colorscheme :doric-obsidian)
- (vim.api.nvim_set_hl 0 :Normal {:bg :NONE})
- (vim.api.nvim_set_hl 0 :NormalFloat {:bg :NONE})
- (vim.api.nvim_set_hl 0 :NormalNC {:bg :NONE}))})
+ (vim.api.nvim_create_autocmd :PackChanged
+ {:callback (fn [ev]
+ (let [{:spec {:name name} :kind kind :path path} ev.data]
+ (when (and (= name :blink.cmp)
+ (or (= kind :install) (= kind :update)))
+ (vim.system [:cargo :build :--release] {:cwd path}))))})
- (use "windwp/nvim-autopairs" {:event :VeryLazy :config true})
- (use "ibhagwan/fzf-lua" {:config true})
- (use "smoka7/hop.nvim" {:version "*" :opts {:keys :etovxqpdygfblzhckisuran}})
- (use "stevearc/oil.nvim"
- {:config (fn []
- ((. (require :oil) :setup)
- {:default_file_explorer false}))})
- (use "neogitorg/neogit"
- {:dependencies [:nvim-lua/plenary.nvim]
- :config true})
- (use "sindrets/diffview.nvim"
- {:config (fn []
- ((. (require :diffview) :setup)
- {:diff_binaries false
- :enhanced_diff_hl false
- :git_cmd ["git"]
- :use_icons false
- :show_help_hints false
- :watch_index true}))})
- (use "saghen/blink.cmp"
- {:version :^1
- :lazy false
- :dependencies [:L3MON4D3/LuaSnip]
- :config #(: (require :config.blink) :config)})
- (use "mrcjkb/rustaceanvim" {:version :^7 :lazy false})
- (use "neovim/nvim-lspconfig"
- {:event :VeryLazy
- :branch :master
- :config (fn []
- (: (require :config.lsp) :config))})
- (use "tpope/vim-commentary")
- (use "tpope/vim-repeat")
- (use "tpope/vim-surround")
- (use "troydm/zoomwintab.vim")
- ])
+ (vim.pack.add
+ [(gh :nvim-lua/plenary.nvim)
+ (gh :L3MON4D3/LuaSnip)
+ (gh :aymenhafeez/doric-themes.nvim)
+ (gh :windwp/nvim-autopairs)
+ (gh :ibhagwan/fzf-lua)
+ (gh :smoka7/hop.nvim)
+ (gh :stevearc/oil.nvim)
+ (gh :neogitorg/neogit)
+ (gh :sindrets/diffview.nvim)
+ {:src (gh :saghen/blink.cmp) :version (vim.version.range "^1")}
+ {:src (gh :mrcjkb/rustaceanvim) :version (vim.version.range "^7")}
+ {:src (gh :neovim/nvim-lspconfig) :version :master}
+ (gh :tpope/vim-commentary)
+ (gh :tpope/vim-repeat)
+ (gh :tpope/vim-surround)
+ (gh :troydm/zoomwintab.vim)]
+ {:load true})
+
+ (vim.cmd.colorscheme :doric-obsidian)
+ (vim.api.nvim_set_hl 0 :Normal {:bg :NONE})
+ (vim.api.nvim_set_hl 0 :NormalFloat {:bg :NONE})
+ (vim.api.nvim_set_hl 0 :NormalNC {:bg :NONE})
+
+ ((. (require :nvim-autopairs) :setup))
+ ((. (require :fzf-lua) :setup))
+ ((. (require :hop) :setup) {:keys :etovxqpdygfblzhckisuran})
+ ((. (require :oil) :setup) {:default_file_explorer false})
+ ((. (require :neogit) :setup))
+ ((. (require :diffview) :setup)
+ {:diff_binaries false
+ :enhanced_diff_hl false
+ :git_cmd [:git]
+ :use_icons false
+ :show_help_hints false
+ :watch_index true})
+ (: blink :config)
+ (: lsp :config)
+ (treesitter.config))
(fn init []
- ((. (require :config.treesitter) :config))
(let [vimrc (.. (vim.fn.stdpath :config) :/init_.vim)
vim-dir (.. (vim.fn.expand "~") :/.vim/)]
- (vim.cmd.source vimrc)
+ (pcall vim.cmd.source vimrc)
(each [_ dir (ipairs [:backup :swap :undo])]
(let [path (.. vim-dir dir)]
(when (= (vim.fn.isdirectory path) 0)
@@ -88,10 +74,10 @@
(set vim.opt.undodir (.. vim-dir :undo//))
(set vim.opt.undofile true))
(set vim.opt.clipboard :unnamedplus)
- (set package.path (.. (fs.normalize "~") "/.config/nvim/lua/?.lua,"
+ (vim.opt.rtp:append (.. (vim.fn.stdpath :data) :/site/tree-sitter))
+ (set package.path (.. (fs.normalize "~") "/.config/nvim/lua/?.lua;"
package.path))
- (local lazy (bootstrap-lazy))
- (lazy.setup {:spec (plugin_specs) :checker {:enabled false}})
+ (setup-plugins)
(each [_ module (ipairs [:aliases :keymaps :functions])]
(require module)))