From 17fda33a90471190b72410be982a1fe73c3e0d70 Mon Sep 17 00:00:00 2001 From: Dario48 Date: Tue, 31 Mar 2026 21:49:56 +0200 Subject: [PATCH 01/16] new config using vim.pack --- .gitignore | 1 - after/ftplugin/cabal.lua | 8 -- after/ftplugin/gdscript.lua | 12 -- after/ftplugin/haskell.lua | 8 -- after/ftplugin/lhaskell.lua | 8 -- after/ftplugin/norg.lua | 3 - after/ftplugin/qml.lua | 4 - after/ftplugin/zig.lua | 0 init.lua | 36 ++++- lsp/ocamllsp.lua | 17 --- lua/config/autocmd.lua | 12 -- lua/config/general.lua | 6 +- lua/config/lazy.lua | 28 ---- lua/config/lsp.lua | 2 +- lua/plugins/ansi.lua | 15 ++- lua/plugins/boo.lua | 4 - lua/plugins/conformer.lua | 53 -------- lua/plugins/cord.lua | 5 - lua/plugins/darioline.lua | 4 - lua/plugins/diagram.lua | 40 ------ lua/plugins/diagrams.lua | 21 +++ lua/plugins/formatter.lua | 47 +++++++ lua/plugins/fuzzyfind.lua | 21 +-- lua/plugins/image.lua | 17 --- lua/plugins/images.lua | 22 +++ lua/plugins/kmonad.lua | 3 - lua/plugins/{vimtex.lua => latex.lua} | 8 +- lua/plugins/lsp.lua | 99 ++++++++++++++ lua/plugins/lspconfig.lua | 59 -------- lua/plugins/mason-bridge.lua | 10 ++ lua/plugins/mason.lua | 77 ++--------- lua/plugins/minuet-ai.lua | 52 ------- lua/plugins/neorg.lua | 69 +++++----- lua/plugins/nightfox.lua | 8 +- lua/plugins/nvim-cmp.lua | 79 ----------- lua/plugins/nvim-lint.lua | 12 +- lua/plugins/peg.lua | 4 - lua/plugins/plenary.lua | 8 ++ lua/plugins/rpc.lua | 13 ++ lua/plugins/sniprun.lua | 32 ----- lua/plugins/statusline.lua | 8 ++ lua/plugins/suda.lua | 3 - lua/plugins/table-mode.lua | 15 +++ lua/plugins/treesitter.lua | 34 +++-- lua/plugins/uiua.lua | 3 - .../{rainbow_parentheses.lua => utils.lua} | 11 +- lua/plugins/venn.lua | 18 --- lua/plugins/vim-jukit.lua | 5 - lua/plugins/vim-table-mode.lua | 17 --- lua/plugins/which-key.lua | 4 - lua/utils/plugins.lua | 127 ++++++++++++++++++ nvim-pack-lock.json | 116 ++++++++++++++++ 52 files changed, 629 insertions(+), 659 deletions(-) delete mode 100644 .gitignore delete mode 100644 after/ftplugin/cabal.lua delete mode 100644 after/ftplugin/gdscript.lua delete mode 100644 after/ftplugin/haskell.lua delete mode 100644 after/ftplugin/lhaskell.lua delete mode 100644 after/ftplugin/norg.lua delete mode 100644 after/ftplugin/qml.lua delete mode 100644 after/ftplugin/zig.lua delete mode 100644 lsp/ocamllsp.lua delete mode 100644 lua/config/autocmd.lua delete mode 100644 lua/config/lazy.lua delete mode 100644 lua/plugins/boo.lua delete mode 100644 lua/plugins/conformer.lua delete mode 100644 lua/plugins/cord.lua delete mode 100644 lua/plugins/darioline.lua delete mode 100644 lua/plugins/diagram.lua create mode 100644 lua/plugins/diagrams.lua create mode 100644 lua/plugins/formatter.lua delete mode 100644 lua/plugins/image.lua create mode 100644 lua/plugins/images.lua delete mode 100644 lua/plugins/kmonad.lua rename lua/plugins/{vimtex.lua => latex.lua} (63%) create mode 100644 lua/plugins/lsp.lua delete mode 100644 lua/plugins/lspconfig.lua create mode 100644 lua/plugins/mason-bridge.lua delete mode 100644 lua/plugins/minuet-ai.lua delete mode 100644 lua/plugins/nvim-cmp.lua delete mode 100644 lua/plugins/peg.lua create mode 100644 lua/plugins/plenary.lua create mode 100644 lua/plugins/rpc.lua delete mode 100644 lua/plugins/sniprun.lua create mode 100644 lua/plugins/statusline.lua delete mode 100644 lua/plugins/suda.lua create mode 100644 lua/plugins/table-mode.lua delete mode 100644 lua/plugins/uiua.lua rename lua/plugins/{rainbow_parentheses.lua => utils.lua} (78%) delete mode 100644 lua/plugins/venn.lua delete mode 100644 lua/plugins/vim-jukit.lua delete mode 100644 lua/plugins/vim-table-mode.lua delete mode 100644 lua/plugins/which-key.lua create mode 100644 lua/utils/plugins.lua create mode 100644 nvim-pack-lock.json diff --git a/.gitignore b/.gitignore deleted file mode 100644 index e033bc6..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -lazy-lock.json diff --git a/after/ftplugin/cabal.lua b/after/ftplugin/cabal.lua deleted file mode 100644 index 5fffa3d..0000000 --- a/after/ftplugin/cabal.lua +++ /dev/null @@ -1,8 +0,0 @@ -local conf = vim.lsp.config.hls -vim.lsp.config("hls", conf) -vim.lsp.enable("hls") - -vim.o.tabstop = 2 -vim.o.softtabstop = 0 -vim.o.shiftwidth = 0 -vim.o.expandtab = true diff --git a/after/ftplugin/gdscript.lua b/after/ftplugin/gdscript.lua deleted file mode 100644 index ad929a7..0000000 --- a/after/ftplugin/gdscript.lua +++ /dev/null @@ -1,12 +0,0 @@ -local port = tonumber(os.getenv("GDScript_Port")) or 6005 -local cmd = vim.lsp.rpc.connect("127.0.0.1", port) -local pipe = "/tmp/godot.pipe" -- I use /tmp/godot.pipe - -vim.lsp.start({ - name = "Godot", - cmd = cmd, - root_dir = vim.fs.dirname(vim.fs.find({ "project.godot", ".git" }, { upward = true })[1]), - on_attach = function(client, bufnr) - vim.api.nvim_command('echo serverstart("' .. pipe .. '")') - end, -}) diff --git a/after/ftplugin/haskell.lua b/after/ftplugin/haskell.lua deleted file mode 100644 index 5fffa3d..0000000 --- a/after/ftplugin/haskell.lua +++ /dev/null @@ -1,8 +0,0 @@ -local conf = vim.lsp.config.hls -vim.lsp.config("hls", conf) -vim.lsp.enable("hls") - -vim.o.tabstop = 2 -vim.o.softtabstop = 0 -vim.o.shiftwidth = 0 -vim.o.expandtab = true diff --git a/after/ftplugin/lhaskell.lua b/after/ftplugin/lhaskell.lua deleted file mode 100644 index 5fffa3d..0000000 --- a/after/ftplugin/lhaskell.lua +++ /dev/null @@ -1,8 +0,0 @@ -local conf = vim.lsp.config.hls -vim.lsp.config("hls", conf) -vim.lsp.enable("hls") - -vim.o.tabstop = 2 -vim.o.softtabstop = 0 -vim.o.shiftwidth = 0 -vim.o.expandtab = true diff --git a/after/ftplugin/norg.lua b/after/ftplugin/norg.lua deleted file mode 100644 index 7017f63..0000000 --- a/after/ftplugin/norg.lua +++ /dev/null @@ -1,3 +0,0 @@ -vim.opt.conceallevel = 2 -vim.opt.concealcursor = "nc" -vim.opt.foldlevel = 99 diff --git a/after/ftplugin/qml.lua b/after/ftplugin/qml.lua deleted file mode 100644 index 5f5d95e..0000000 --- a/after/ftplugin/qml.lua +++ /dev/null @@ -1,4 +0,0 @@ -local conf = vim.lsp.config.qmlls -conf.root_markers = { ".qmlls.ini" } -vim.lsp.config("qmlls", conf) -vim.lsp.enable("qmlls") diff --git a/after/ftplugin/zig.lua b/after/ftplugin/zig.lua deleted file mode 100644 index e69de29..0000000 diff --git a/init.lua b/init.lua index cf3636f..a38dd17 100644 --- a/init.lua +++ b/init.lua @@ -1,4 +1,36 @@ -require("config.lazy") require("config.general") -require("config.autocmd") require("config.lsp") + +local plugins = { + "lsp", + "mason-bridge", + "mason", + "formatter", + "treesitter", + "nvim-lint", + + -- "neorg", + + "nightfox", + + "statusline", + + "ansi", + "rpc", + "utils", + + "images", + "diagrams", + "table-mode", + + "plenary", + "fuzzyfind", + + "latex", +} + +local putils = require("utils.plugins") + +for _, plugin in pairs(plugins) do + putils.parse(putils.get(plugin)) +end diff --git a/lsp/ocamllsp.lua b/lsp/ocamllsp.lua deleted file mode 100644 index 529ff51..0000000 --- a/lsp/ocamllsp.lua +++ /dev/null @@ -1,17 +0,0 @@ -return { - cmd = { "ocamllsp" }, - filetypes = { - "ocaml", - "ocaml.interface", - "ocaml.menhir", - "ocaml.ocamllex", - "dune", - "reason", - }, - root_markers = { - { "dune-project", "dune-workspace" }, - { "*.opam", "esy.json", "package.json" }, - ".git", - }, - settings = {}, -} diff --git a/lua/config/autocmd.lua b/lua/config/autocmd.lua deleted file mode 100644 index 6328d2c..0000000 --- a/lua/config/autocmd.lua +++ /dev/null @@ -1,12 +0,0 @@ --- put this in your init.lua -vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, { - pattern = { "*.yuck" }, - callback = function(event) - print(string.format("starting yuck;s for %s", vim.inspect(event))) - vim.lsp.start({ - name = "YuckLs", - cmd = { "yuckls" }, -- if installed from aur - root_dir = vim.fn.getcwd(), - }) - end, -}) diff --git a/lua/config/general.lua b/lua/config/general.lua index e0289f8..4b4c14d 100644 --- a/lua/config/general.lua +++ b/lua/config/general.lua @@ -17,7 +17,11 @@ vim.keymap.set("t", "", "", {}) vim.keymap.set("n", ".", ":", {}) -vim.keymap.set("i", "jk", "", {}) +vim.keymap.set("i", "jk", "␛", {}) + +vim.cmd("nnoremap ") +vim.g.mapleader = " " +vim.g.maplocalleader = "," vim.opt.termguicolors = true diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua deleted file mode 100644 index 0e20fb6..0000000 --- a/lua/config/lazy.lua +++ /dev/null @@ -1,28 +0,0 @@ --- Bootstrap lazy.nvim -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not (vim.uv or vim.loop).fs_stat(lazypath) then - local lazyrepo = "https://github.com/folke/lazy.nvim.git" - local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) - if vim.v.shell_error ~= 0 then - vim.api.nvim_echo({ - { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, - { out, "WarningMsg" }, - { "\nPress any key to exit..." }, - }, true, {}) - vim.fn.getchar() - os.exit(1) - end -end -vim.opt.rtp:prepend(lazypath) - --- Make sure to setup `mapleader` and `maplocalleader` before --- loading lazy.nvim so that mappings are correct. --- This is also a good place to setup other settings (vim.opt) -vim.cmd("nnoremap ") -vim.g.mapleader = " " -vim.g.maplocalleader = "," - -vim.keymap.set("n", "l", function() require"lazy".home() end, { silent = true, desc = "open lazy.nvim"}) - --- Setup lazy.nvim -require("lazy").setup("plugins") diff --git a/lua/config/lsp.lua b/lua/config/lsp.lua index 2bcdf85..7563175 100644 --- a/lua/config/lsp.lua +++ b/lua/config/lsp.lua @@ -1,4 +1,3 @@ --- lsp that are not on mason/beta branch lsp vim.lsp.enable("zls") vim.lsp.enable("ocamllsp") vim.lsp.enable("ocamllsp") @@ -9,3 +8,4 @@ vim.lsp.config("llvm-ir-lsp", { cmd = { "llvm-ir-lsp" }, filetypes = { "llvm" }, }) + diff --git a/lua/plugins/ansi.lua b/lua/plugins/ansi.lua index df6671b..93aa442 100644 --- a/lua/plugins/ansi.lua +++ b/lua/plugins/ansi.lua @@ -1,8 +1,11 @@ +---@module "utils.plugins" +---@type Plugin return { - "0xferrous/ansi.nvim", - config = true, - opts = { - auto_enable = false, -- Auto-enable for configured filetypes - filetypes = { "log", "ansi" }, -- Filetypes to auto-enable - }, + configure = function(load) + load("0xferrous/ansi.nvim") + require("ansi").setup({ + auto_enable = false, -- Auto-enable for configured filetypes + filetypes = { "log", "ansi" }, -- Filetypes to auto-enable + }) + end, } diff --git a/lua/plugins/boo.lua b/lua/plugins/boo.lua deleted file mode 100644 index 39abddb..0000000 --- a/lua/plugins/boo.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - "LukasPietzschmann/boo.nvim", - opts = {}, -} diff --git a/lua/plugins/conformer.lua b/lua/plugins/conformer.lua deleted file mode 100644 index d2904eb..0000000 --- a/lua/plugins/conformer.lua +++ /dev/null @@ -1,53 +0,0 @@ -return { - "stevearc/conform.nvim", - dependencies = { "frostplexx/mason-bridge.nvim" }, - event = { "BufWritePre" }, - cmd = { "ConformInfo" }, - init = function() - require("conform").setup({ - format_on_save = function(bufnr) - if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then - return - end - require("conform").formatters_by_ft = require("mason-bridge").get_formatters() - return { timeout_ms = 200, lsp_fallback = true }, on_format - end, - formatters_by_ft = require("mason-bridge").get_formatters(), --[[ = { - lua = { "stylua" }, - javascript = { "prettier" }, - html = { "prettier" }, - css = { "prettier" }, - c = { "clang-format" }, - cpp = { "clang-format" }, - arduino = { "clang-format" }, - sh = { "shfmt" }, - bash = { "shfmt" }, - mksh = { "shfmt" }, - json = { "jq" }, - }, ]] -- - - -- This will provide type hinting with LuaLS - ---@module "conform" - ---@type conform.setupOpts - formatters = { - prettier = { - prepend_args = { "--use-tabs", "true" }, - }, - jq = { - prepend_args = { "--tab" }, - }, - ["clang-format"] = { - prepend_args = function(self, ctx) - return { "-style=file:/home/Dario48/.config/.clang-format" } - end, - }, - default_format_opts = { - lsp_format = "fallback", - }, - }, - }) - -- If you want the formatexpr, here is the place to set it - vim.o.formatexpr = "v:lua.require'conform'.formatexpr()" - vim.g.arduino_recommended_style = 0 - end, -} diff --git a/lua/plugins/cord.lua b/lua/plugins/cord.lua deleted file mode 100644 index 7fac163..0000000 --- a/lua/plugins/cord.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - "vyfor/cord.nvim", - build = ":Cord update", - -- opts = {} -} diff --git a/lua/plugins/darioline.lua b/lua/plugins/darioline.lua deleted file mode 100644 index 73de90c..0000000 --- a/lua/plugins/darioline.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - url = "https://dario48.site/git/Dario48/darioline.git", - config = true, -} diff --git a/lua/plugins/diagram.lua b/lua/plugins/diagram.lua deleted file mode 100644 index 18c857d..0000000 --- a/lua/plugins/diagram.lua +++ /dev/null @@ -1,40 +0,0 @@ -return { - "3rd/diagram.nvim", - dependencies = { - { "3rd/image.nvim" }, -- you'd probably want to configure image.nvim manually instead of doing this - }, - opts = { -- you can just pass {}, defaults below - events = { - render_buffer = { "InsertLeave", "BufWinEnter", "TextChanged" }, - clear_buffer = { "BufLeave" }, - }, - renderer_options = { - mermaid = { - background = nil, -- nil | "transparent" | "white" | "#hex" - theme = nil, -- nil | "default" | "dark" | "forest" | "neutral" - scale = 1, -- nil | 1 (default) | 2 | 3 | ... - width = nil, -- nil | 800 | 400 | ... - height = nil, -- nil | 600 | 300 | ... - cli_args = nil, -- nil | { "--no-sandbox" } | { "-p", "/path/to/puppeteer" } | ... - }, - plantuml = { - charset = nil, - cli_args = nil, -- nil | { "-Djava.awt.headless=true" } | ... - }, - d2 = { - theme_id = nil, - dark_theme_id = nil, - scale = nil, - layout = nil, - sketch = nil, - cli_args = nil, -- nil | { "--pad", "0" } | ... - }, - gnuplot = { - size = nil, -- nil | "800,600" | ... - font = nil, -- nil | "Arial,12" | ... - theme = nil, -- nil | "light" | "dark" | custom theme string - cli_args = nil, -- nil | { "-p" } | { "-c", "config.plt" } | ... - }, - }, - }, -} diff --git a/lua/plugins/diagrams.lua b/lua/plugins/diagrams.lua new file mode 100644 index 0000000..e1a238d --- /dev/null +++ b/lua/plugins/diagrams.lua @@ -0,0 +1,21 @@ +---@module "utils.plugins" +---@type Plugin +return { + after = "images", + configure = function(load) + --load("3rd/diagram.nvim") + --require("diagram").setup() + + load("jbyuki/venn.nvim") + vim.b.ve = "all" + + vim.api.nvim_create_user_command("VennInit", function() + vim.keymap.set("n", "J", "j:VBox", { noremap = true }) + vim.keymap.set("n", "K", "k:VBox", { noremap = true }) + vim.keymap.set("n", "L", "l:VBox", { noremap = true }) + vim.keymap.set("n", "H", "h:VBox", { noremap = true }) + -- draw a box by pressing "f" with visual selection, + vim.keymap.set("v", "f", ":VBox", { noremap = true }) + end, {}) + end, +} diff --git a/lua/plugins/formatter.lua b/lua/plugins/formatter.lua new file mode 100644 index 0000000..924899a --- /dev/null +++ b/lua/plugins/formatter.lua @@ -0,0 +1,47 @@ +---@module "utils.plugins" +---@type Plugin +return { + after = "mason-bridge", + configure = function(load) + load("stevearc/conform.nvim") + + require("conform").setup({ + formatters_by_ft = require("mason-bridge").get_formatters(), + + format_on_save = function(bufnr) + require("conform").formatters_by_ft = require("mason-bridge").get_formatters() + + if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then + return + else + return { timeout_ms = 500, lsp_format = "fallback" } + end + end, + }) + + vim.api.nvim_create_user_command("FormatDisable", function(args) + if args.bang then + -- FormatDisable! will disable formatting globally + vim.g.disable_autoformat = true + else + vim.b.disable_autoformat = true + end + end, { + desc = "Disable autoformat-on-save", + bang = true, + }) + vim.api.nvim_create_user_command("FormatEnable", function(args) + if args.bang then + -- FormatDisable! will disable formatting globally + vim.g.disable_autoformat = false + else + vim.b.disable_autoformat = false + end + end, { + desc = "Enable autoformat-on-save", + bang = true, + }) + + vim.o.formatexpr = "v:lua.require'conform'.formatexpr()" + end, +} diff --git a/lua/plugins/fuzzyfind.lua b/lua/plugins/fuzzyfind.lua index 445374c..8722300 100644 --- a/lua/plugins/fuzzyfind.lua +++ b/lua/plugins/fuzzyfind.lua @@ -1,11 +1,14 @@ +---@module "utils.plugins" +---@type Plugin return { - "nvim-telescope/telescope.nvim", - dependencies = { "nvim-lua/plenary.nvim" }, - - keys = { - { "ff", require("telescope.builtin").find_files, desc = "Telescope find files" }, - { "fg", require("telescope.builtin").live_grep, desc = "Telescope live grep" }, - { "fb", require("telescope.builtin").buffers, desc = "Telescope buffers" }, - { "fh", require("telescope.builtin").help_tags, desc = "Telescope help tags" }, - }, + after = "plenary", + configures = "telescope", + configure = function(load) + load("nvim-telescope/telescope.nvim") + require("telescope").setup() + vim.keymap.set("n", "ff", require("telescope.builtin").find_files, { desc = "Telescope find files" }) + vim.keymap.set("n", "fg", require("telescope.builtin").live_grep, { desc = "Telescope live grep" }) + vim.keymap.set("n", "fb", require("telescope.builtin").buffers, { desc = "Telescope buffers" }) + vim.keymap.set("n", "fh", require("telescope.builtin").help_tags, { desc = "Telescope help tags" }) + end, } diff --git a/lua/plugins/image.lua b/lua/plugins/image.lua deleted file mode 100644 index 613e9e8..0000000 --- a/lua/plugins/image.lua +++ /dev/null @@ -1,17 +0,0 @@ -return { - "3rd/image.nvim", - opts = { - integrations = { - markdown = { - enabled = true, - clear_in_insert_mode = false, - download_remote_images = true, - only_render_image_at_cursor = false, - only_render_image_at_cursor_mode = "popup", -- or "inline" - floating_windows = true, -- if true, images will be rendered in floating markdown windows - filetypes = { "markdown", "vimwiki", "latex" }, -- markdown extensions (ie. quarto) can go here - }, - }, - }, - config = true, -} diff --git a/lua/plugins/images.lua b/lua/plugins/images.lua new file mode 100644 index 0000000..7a54da1 --- /dev/null +++ b/lua/plugins/images.lua @@ -0,0 +1,22 @@ +---@module "utils.plugins" +---@type Plugin +return { + configures = "images", + configure = function(load) + load("3rd/image.nvim") + + require("image").setup({ + integrations = { + markdown = { + enabled = true, + clear_in_insert_mode = false, + download_remote_images = true, + only_render_image_at_cursor = false, + only_render_image_at_cursor_mode = "popup", -- or "inline" + floating_windows = true, -- if true, images will be rendered in floating markdown windows + filetypes = { "markdown", "vimwiki", "latex" }, -- markdown extensions (ie. quarto) can go here + }, + }, + }) + end, +} diff --git a/lua/plugins/kmonad.lua b/lua/plugins/kmonad.lua deleted file mode 100644 index 4bfe392..0000000 --- a/lua/plugins/kmonad.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - "kmonad/kmonad-vim", -} diff --git a/lua/plugins/vimtex.lua b/lua/plugins/latex.lua similarity index 63% rename from lua/plugins/vimtex.lua rename to lua/plugins/latex.lua index b9fef9e..41366d1 100644 --- a/lua/plugins/vimtex.lua +++ b/lua/plugins/latex.lua @@ -1,7 +1,9 @@ +---@module "utils.plugins" +---@type Plugin return { - "lervag/vimtex", - init = function() - -- VimTeX configuration goes here, e.g. + configure = function(load) + load("lervag/vimtex") + vim.g.vimtex_view_method = "mupdf" vim.g.vimtex_compiler_method = "latexmk" vim.g.vimtex_compiler_latexmk = { options = { "-shell-escape" } } diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua new file mode 100644 index 0000000..bbe2c7a --- /dev/null +++ b/lua/plugins/lsp.lua @@ -0,0 +1,99 @@ +---@module "utils.plugins" +---@type Plugin +return { + after = "mason", + configure = function(load) + load("neovim/nvim-lspconfig") + + load("folke/lazydev.nvim") + require("lazydev").setup({}) + + --[[ + ---@type vim.lsp.Config + local config = { + ---@type lspconfig.settings.lua_ls + settings = { + Lua = { + runtime = { + version = "LuaJIT", + }, + workspace = { + preloadFileSize = 10000, + library = { + vim.env.VIMRUNTIME, + }, + }, + }, + }, + } + + vim.lsp.config("lua_ls", config) + ]] + -- + + vim.api.nvim_create_autocmd("LspAttach", { + callback = function(args) + local client = vim.lsp.get_client_by_id(args.data.client_id) + if client and client:supports_method("textDocument/completion") then + vim.lsp.completion.enable(true, client.id, args.buf, { autotrigger = true }) + end + end, + }) + vim.opt.completeopt = { "menuone", "noinsert", "popup" } + vim.keymap.set("i", "", function() + if vim.fn.pumvisible() == 1 then + return "" + end + return "" + end, { expr = true }) + + -- Reserve a space in the gutter + -- This will avoid an annoying layout shift in the screen + vim.opt.signcolumn = "yes" + vim.api.nvim_create_autocmd("LspAttach", { + desc = "LSP actions", + callback = function(event) + local opts = { buffer = event.buf } + + vim.keymap.set("n", "K", function() + vim.lsp.buf.hover() + end, opts) + vim.keymap.set("n", "gd", function() + vim.lsp.buf.definition() + end, opts) + vim.keymap.set("n", "gD", function() + vim.lsp.buf.declaration() + end, opts) + vim.keymap.set("n", "gi", function() + vim.lsp.buf.implementation() + end, opts) + vim.keymap.set("n", "go", function() + vim.lsp.buf.type_definition() + end, opts) + vim.keymap.set("n", "gr", function() + vim.lsp.buf.references() + end, opts) + vim.keymap.set("n", "gs", function() + vim.lsp.buf.signature_help() + end, opts) + vim.keymap.set("n", "", function() + vim.lsp.buf.rename() + end, opts) + vim.keymap.set({ "n", "x" }, "", function() + vim.lsp.buf.format({ async = true }) + end, opts) + vim.keymap.set("n", "f", function() + vim.lsp.buf.code_action() + end, opts) + end, + }) + + load("mason-org/mason-lspconfig.nvim") + + require("mason-lspconfig").setup({ + automatic_enable = true, + }) + + load("LukasPietzschmann/boo.nvim") + end, +} diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua deleted file mode 100644 index 0129cb7..0000000 --- a/lua/plugins/lspconfig.lua +++ /dev/null @@ -1,59 +0,0 @@ -return { - "neovim/nvim-lspconfig", - dependencies = { - { "hrsh7th/cmp-nvim-lsp" }, - { "hrsh7th/nvim-cmp" }, - }, - config = function() - -- Reserve a space in the gutter - -- This will avoid an annoying layout shift in the screen - vim.opt.signcolumn = "yes" - - -- Add cmp_nvim_lsp capabilities settings to lspconfig - -- This should be executed before you configure any language server - local lspconfig_defaults = require("lspconfig").util.default_config - lspconfig_defaults.capabilities = vim.tbl_deep_extend( - "force", - lspconfig_defaults.capabilities, - require("cmp_nvim_lsp").default_capabilities() - ) - - vim.api.nvim_create_autocmd("LspAttach", { - desc = "LSP actions", - callback = function(event) - local opts = { buffer = event.buf } - - vim.keymap.set("n", "K", function() - vim.lsp.buf.hover() - end, opts) - vim.keymap.set("n", "gd", function() - vim.lsp.buf.definition() - end, opts) - vim.keymap.set("n", "gD", function() - vim.lsp.buf.declaration() - end, opts) - vim.keymap.set("n", "gi", function() - vim.lsp.buf.implementation() - end, opts) - vim.keymap.set("n", "go", function() - vim.lsp.buf.type_definition() - end, opts) - vim.keymap.set("n", "gr", function() - vim.lsp.buf.references() - end, opts) - vim.keymap.set("n", "gs", function() - vim.lsp.buf.signature_help() - end, opts) - vim.keymap.set("n", "", function() - vim.lsp.buf.rename() - end, opts) - vim.keymap.set({ "n", "x" }, "", function() - vim.lsp.buf.format({ async = true }) - end, opts) - vim.keymap.set("n", "f", function() - vim.lsp.buf.code_action() - end, opts) - end, - }) - end, -} diff --git a/lua/plugins/mason-bridge.lua b/lua/plugins/mason-bridge.lua new file mode 100644 index 0000000..1c013ad --- /dev/null +++ b/lua/plugins/mason-bridge.lua @@ -0,0 +1,10 @@ +---@module "utils.plugins" +---@type Plugin +return { + after = "mason", + configures = "mason-bridge", + configure = function(load) + load("frostplexx/mason-bridge.nvim") + require("mason-bridge").setup({}) + end, +} diff --git a/lua/plugins/mason.lua b/lua/plugins/mason.lua index 9f3559b..fab1d90 100644 --- a/lua/plugins/mason.lua +++ b/lua/plugins/mason.lua @@ -1,72 +1,13 @@ +---@module "utils.plugins" +---@type Plugin return { - { - "williamboman/mason.nvim", + configures = "mason", + configure = function(load) + load("mason-org/mason.nvim") + vim.keymap.set("n", "m", ":Mason", { desc = "open mason" }) - keys = { - { "m", ":Mason ", desc = "open mason" }, - }, - config = true, - opts = { + require("mason").setup({ PATH = "append", - }, - }, - { - "williamboman/mason-lspconfig.nvim", - dependencies = { "williamboman/mason.nvim" }, - opts = { - -- Replace the language servers listed here - -- with the ones you want to install - ensure_installed = { "lua_ls", "clangd", "hyprls" }, - handlers = { - function(server_name) - vim.lsp.enable(server_name) - end, - - ["lua_ls"] = function() - vim.lsp.config("lua_ls", { - settings = { - Lua = { - runtime = { - -- Tell the language server which version of Lua you're using - -- (most likely LuaJIT in the case of Neovim) - version = "LuaJIT", - }, - -- Make the server aware of Neovim runtime files - workspace = { - checkThirdParty = false, - library = { - vim.env.VIMRUNTIME, - -- Depending on the usage, you might want to add additional paths here. - -- "${3rd}/luv/library" - -- "${3rd}/busted/library", - }, - -- or pull in all of 'runtimepath'. NOTE: this is a lot slower - -- library = vim.api.nvim_get_runtime_file("", true) - completion = { - callSnippet = "Replace", - }, - doc = { - privateName = { "^_" }, - }, - hint = { - enable = true, - setType = false, - paramType = true, - paramName = "Disable", - semicolon = "Disable", - arrayIndex = "Disable", - }, - }, - }, - }, - }) - end, - }, - }, - }, - { - "frostplexx/mason-bridge.nvim", - dependencies = { "williamboman/mason.nvim" }, - config = true, - }, + }) + end, } diff --git a/lua/plugins/minuet-ai.lua b/lua/plugins/minuet-ai.lua deleted file mode 100644 index 45ab289..0000000 --- a/lua/plugins/minuet-ai.lua +++ /dev/null @@ -1,52 +0,0 @@ -return { - dependencies = { "nvim-lua/plenary.nvim" }, - "milanglacier/minuet-ai.nvim", - config = function() - require("minuet").setup({ - provider = "openai_fim_compatible", - n_completions = 1, -- recommend for local model for resource saving - context_window = 512, - provider_options = { - openai_fim_compatible = { - -- For Windows users, TERM may not be present in environment variables. - -- Consider using APPDATA instead. - api_key = "TERM", - name = "LLama.cpp", - end_point = "http://localhost:8012/v1/completions", - model = "PLACEHOLDER", - optional = { - max_tokens = 56, - top_p = 0.9, - }, - template = { - prompt = function(context_before_cursor, context_after_cursor, _) - return "<|fim_prefix|>" - .. context_before_cursor - .. "<|fim_suffix|>" - .. context_after_cursor - .. "<|fim_middle|>" - end, - suffix = false, - }, - }, - }, - virtualtext = { - auto_trigger_ft = {}, - keymap = { - -- accept whole completion - accept = "", - -- accept one line - accept_line = "", - -- accept n lines (prompts for number) - -- e.g. "A-z 2 CR" will accept 2 lines - accept_n_lines = "", - -- Cycle to prev completion item, or manually invoke completion - prev = "", - -- Cycle to next completion item, or manually invoke completion - next = "", - dismiss = "", - }, - }, - }) - end, -} diff --git a/lua/plugins/neorg.lua b/lua/plugins/neorg.lua index 1a2ac6f..f84e0d3 100644 --- a/lua/plugins/neorg.lua +++ b/lua/plugins/neorg.lua @@ -1,43 +1,38 @@ +---@module "utils.plugins" +---@type Plugin return { - "nvim-neorg/neorg", - lazy = false, -- Disable lazy loading as some `lazy.nvim` distributions set `lazy = true` by default - dependencies = { - { - "juniorsundar/neorg-extras", - -- tag = "v0.3.1" -- Always a safe bet to track current latest release - }, - "nvim-telescope/telescope.nvim", -- Required for the Neorg-Roam features - "nvim-lua/plenary.nvim", -- Required as part of Telescope installation - "nvim-treesitter/nvim-treesitter", - }, - opts = { - load = { - ["external.many-mans"] = { - config = { - metadata_fold = true, -- If want @data property ... @end to fold - code_fold = true, -- If want @code ... @end to fold + after = { "telescope", "nvim-treesitter" }, + configure = function(load) + load("nvim-neotest/nvim-nio") + load("pysan3/pathlib.nvim") + load("nvim-neorg/lua-utils.nvim") + load("juniorsundar/neorg-extras") + load("nvim-neorg/neorg") + require("neorg").setup({ + load = { + ["external.many-mans"] = { + config = { + metadata_fold = true, -- If want @data property ... @end to fold + code_fold = true, -- If want @code ... @end to fold + }, }, - }, - ["core.defaults"] = {}, - ["core.concealer"] = {}, - ["core.dirman"] = { - config = { - workspaces = { - school = "~/Documents/school", - notes = "~/Documents/notes", - uni = "~/Documents/uni", + ["core.defaults"] = {}, + ["core.concealer"] = {}, + -- ["core.completion"] = { config = { engine = "nvim-cmp" } }, + -- ["core.integrations.treesitter"] = {}, + ["core.clipboard.code-blocks"] = {}, + ["core.esupports.indent"] = {}, + ["core.dirman"] = { + config = { + workspaces = { + school = "~/Documents/school", + notes = "~/Documents/notes", + uni = "~/Documents/uni", + }, + default_workspace = "notes", }, - default_workspace = "notes", }, }, - ["core.completion"] = { config = { engine = "nvim-cmp" } }, - ["core.integrations.treesitter"] = {}, - ["core.clipboard.code-blocks"] = {}, - ["core.esupports.indent"] = {}, - }, - }, - ft = "norg", - cmd = "Neorg", - config = true, - version = "*", + }) + end, } diff --git a/lua/plugins/nightfox.lua b/lua/plugins/nightfox.lua index 79abc6d..363f432 100644 --- a/lua/plugins/nightfox.lua +++ b/lua/plugins/nightfox.lua @@ -1,6 +1,8 @@ +---@module "utils.plugins" +---@type Plugin return { - "EdenEast/nightfox.nvim", - init = function() + configure = function(load) + load("EdenEast/nightfox.nvim") vim.cmd("colorscheme carbonfox") - end + end, } diff --git a/lua/plugins/nvim-cmp.lua b/lua/plugins/nvim-cmp.lua deleted file mode 100644 index a66dc38..0000000 --- a/lua/plugins/nvim-cmp.lua +++ /dev/null @@ -1,79 +0,0 @@ -return { - { - "hrsh7th/nvim-cmp", - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", - "hrsh7th/cmp-nvim-lua", - "neovim/nvim-lspconfig", - "mtoohey31/cmp-fish", - "petertriho/cmp-git", - }, - config = function() - local cmp = require("cmp") - - cmp.setup({ - sources = { - { - name = "lazydev", - group_index = 0, -- set group index to 0 to skip loading LuaLS completions - }, - { name = "nvim_lua" }, - { - name = "nvim_lsp", - entry_filter = function(entry, ctx) - local kind = require("cmp.types").lsp.CompletionItemKind[entry:get_kind()] - - if kind == "Text" then - return false - end - return true - end, - }, - { name = "neorg" }, - { name = "fish" }, - }, - snippet = { - expand = function(args) - -- You need Neovim v0.10 to use vim.snippet - vim.snippet.expand(args.body) - end, - }, - cmp.setup.filetype("gitcommit", { - sources = cmp.config.sources({ - { name = "git" }, - }, { - { name = "buffer" }, - }), - }), - require("cmp_git").setup({}), - - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(-4), - [" "] = cmp.mapping.confirm(), - }), - }) - end, - }, - { - "folke/lazydev.nvim", - ft = "lua", -- only load on lua files - config = function() - local lazydev = require("lazydev") - require("lazydev").setup() - vim.lsp.enable("lua_ls") - vim.lsp.config("lua_ls", { - root_dir = function(bufnr, on_dir) - on_dir(lazydev.find_workspace(bufnr)) - end, - }) - end, - }, -} diff --git a/lua/plugins/nvim-lint.lua b/lua/plugins/nvim-lint.lua index b84db48..4d95fd4 100644 --- a/lua/plugins/nvim-lint.lua +++ b/lua/plugins/nvim-lint.lua @@ -1,9 +1,13 @@ +---@module "utils.plugins" +---@type Plugin return { - "mfussenegger/nvim-lint", - init = function() + after = "mason-bridge", + configure = function(load) + load("mfussenegger/nvim-lint") vim.api.nvim_create_autocmd({ "BufWritePost" }, { callback = function() - require "lint".try_lint() + require("lint").linters_by_ft = require("mason-bridge").get_linters() + require("lint").try_lint() end, }) @@ -15,5 +19,5 @@ return { }) require("lint").linters_by_ft = require("mason-bridge").get_linters() - end + end, } diff --git a/lua/plugins/peg.lua b/lua/plugins/peg.lua deleted file mode 100644 index be7ea2f..0000000 --- a/lua/plugins/peg.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - "taeber/vim-peg", - lazy = false, -} diff --git a/lua/plugins/plenary.lua b/lua/plugins/plenary.lua new file mode 100644 index 0000000..534eae1 --- /dev/null +++ b/lua/plugins/plenary.lua @@ -0,0 +1,8 @@ +---@module "utils.plugins" +---@type Plugin +return { + configures = "plenary", + configure = function(load) + load("nvim-lua/plenary.nvim") + end, +} diff --git a/lua/plugins/rpc.lua b/lua/plugins/rpc.lua new file mode 100644 index 0000000..7c1b5a2 --- /dev/null +++ b/lua/plugins/rpc.lua @@ -0,0 +1,13 @@ +---@module "utils.plugins" +---@type Plugin +return { + configure = function(load) + load("vyfor/cord.nvim") + require("cord").setup({ + display = { + theme = "catppuccin", + flavor = "dark", + }, + }) + end, +} diff --git a/lua/plugins/sniprun.lua b/lua/plugins/sniprun.lua deleted file mode 100644 index 8621be7..0000000 --- a/lua/plugins/sniprun.lua +++ /dev/null @@ -1,32 +0,0 @@ -return { - "michaelb/sniprun", - branch = "master", - - build = "sh install.sh", - -- do 'sh install.sh 1' if you want to force compile locally - -- (instead of fetching a binary from the github release). Requires Rust >= 1.65 - - opts = { - repl_enable = { "Mathematica_original" }, - interpreter_options = { - Lua_nvim = { - use_on_filetypes = { "lua" }, - }, - Mathematica_original = { - use_javagraphics_if_contains = { "Plot" }, -- a pattern that need <r", "SnipRun", desc = "run snipper", silent = true }, - { "R", "SnipLive", desc = "run snipper in REPL mode", silent = true }, - }, - - lazy = false, - - config = true, -} diff --git a/lua/plugins/statusline.lua b/lua/plugins/statusline.lua new file mode 100644 index 0000000..1400f8e --- /dev/null +++ b/lua/plugins/statusline.lua @@ -0,0 +1,8 @@ +---@module "utils.plugins" +---@type Plugin +return { + configure = function(load) + load({ "Dario48/darioline", source = "https://dario48.site/git/" }) + require("darioline").setup() + end, +} diff --git a/lua/plugins/suda.lua b/lua/plugins/suda.lua deleted file mode 100644 index f255b6f..0000000 --- a/lua/plugins/suda.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - "lambdalisue/vim-suda", -} diff --git a/lua/plugins/table-mode.lua b/lua/plugins/table-mode.lua new file mode 100644 index 0000000..9f1d13e --- /dev/null +++ b/lua/plugins/table-mode.lua @@ -0,0 +1,15 @@ +---@module "utils.plugins" +---@type Plugin +return { + configure = function(load) + load("dhruvasagar/vim-table-mode") + + vim.g.table_mode_corner = "+" + + vim.keymap.set("n", "tm", "TableModeToggle", { desc = "toggla table mode" }) + vim.keymap.set("n", "tt", "Tableize", { desc = "transform CVS to table" }) + vim.keymap.set("n", "T", function() + vim.api.nvim_command("Tableize/" .. vim.fn.input("what separator to use? ")) + end, { desc = "transform CVS to table" }) + end, +} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 443229e..f8c116e 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,24 +1,20 @@ +---@module "utils.plugins" +---@type Plugin return { - "nvim-treesitter/nvim-treesitter", - opts = { - -- A list of parser names, or "all" (the listed parsers MUST always be installed) - ensure_installed = { "c", "lua", "vim", "vimdoc", "query" }, + configures = "nvim-treesitter", + configure = function(load) + load("nvim-treesitter/nvim-treesitter") - -- Install parsers synchronously (only applied to `ensure_installed`) - sync_install = true, + require("nvim-treesitter").install({ "c", "lua", "vim", "vimdoc", "query" }):wait(300000) - -- Automatically install missing parsers when entering buffer - -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally - auto_install = false, - - -- List of parsers to ignore installing (or "all") - - ---- If you need to change the installation directory of the parsers (see -> Advanced Setup) - -- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")! - highlight = { enable = true }, - }, - config = function(_, opts) - require("nvim-treesitter.configs").setup(opts) + vim.api.nvim_create_autocmd("FileType", { + pattern = require("nvim-treesitter").get_installed(), + callback = function() + vim.treesitter.start() + end, + }) + end, + onUpdate = function() + vim.cmd("TSUpdate") end, - version = "*", } diff --git a/lua/plugins/uiua.lua b/lua/plugins/uiua.lua deleted file mode 100644 index e962e49..0000000 --- a/lua/plugins/uiua.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - "Apeiros-46B/uiua.vim", -} diff --git a/lua/plugins/rainbow_parentheses.lua b/lua/plugins/utils.lua similarity index 78% rename from lua/plugins/rainbow_parentheses.lua rename to lua/plugins/utils.lua index 60505ff..a5bd714 100644 --- a/lua/plugins/rainbow_parentheses.lua +++ b/lua/plugins/utils.lua @@ -1,7 +1,9 @@ +---@module "utils.plugins" +---@type Plugin return { - "HiPhish/rainbow-delimiters.nvim", - lazy = false, - init = function() + configure = function(load) + load("HiPhish/rainbow-delimiters.nvim") + -- This module contains a number of default definitions local rainbow_delimiters = require("rainbow-delimiters") @@ -29,5 +31,8 @@ return { "RainbowDelimiterCyan", }, } + + load("nvim-tree/nvim-web-devicons") + load("folke/which-key.nvim") end, } diff --git a/lua/plugins/venn.lua b/lua/plugins/venn.lua deleted file mode 100644 index 36a00c7..0000000 --- a/lua/plugins/venn.lua +++ /dev/null @@ -1,18 +0,0 @@ -return { - "jbyuki/venn.nvim", - - config = function() - vim.b.ve = "all" - end, - - keys = { - { "J", "j:VBox", mode = "n", noremap = true }, - { "K", "k:VBox", mode = "n", noremap = true }, - { "L", "l:VBox", mode = "n", noremap = true }, - { "H", "h:VBox", mode = "n", noremap = true }, - -- draw a box by pressing "f" with visual selection, - { "f", ":VBox", mode = "v", noremap = true }, - }, - - lazy = true, -} diff --git a/lua/plugins/vim-jukit.lua b/lua/plugins/vim-jukit.lua deleted file mode 100644 index 7699d60..0000000 --- a/lua/plugins/vim-jukit.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - "luk400/vim-jukit", - lazu = true, - ft = "ipynb", -} diff --git a/lua/plugins/vim-table-mode.lua b/lua/plugins/vim-table-mode.lua deleted file mode 100644 index d68e78d..0000000 --- a/lua/plugins/vim-table-mode.lua +++ /dev/null @@ -1,17 +0,0 @@ -return { - "dhruvasagar/vim-table-mode", - config = function() - vim.g.table_mode_corner = "+" - end, - keys = { - { "tm", "TableModeToggle", desc = "toggla table mode" }, - { "tt", "Tableize", desc = "transform CVS to table" }, - { - "T", - function() - vim.api.nvim_command("Tableize/" .. vim.fn.input("what separator to use? ")) - end, - desc = "transform CVS to table", - }, - }, -} diff --git a/lua/plugins/which-key.lua b/lua/plugins/which-key.lua deleted file mode 100644 index 42dc55f..0000000 --- a/lua/plugins/which-key.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - "folke/which-key.nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, -} diff --git a/lua/utils/plugins.lua b/lua/utils/plugins.lua new file mode 100644 index 0000000..06c379a --- /dev/null +++ b/lua/utils/plugins.lua @@ -0,0 +1,127 @@ +local M = {} + +M.loaded = {} + +M.waiting = {} + +---nice utility wrapper around vim.pack.add +---@param plugin string|table +function M.load(plugin) + if plugin == nil then + error("value passed to load is nil") + end + if type(plugin) == "table" then + if type(plugin[1]) == "table" then + for _, i in ipairs(plugin) do + M.load(i) + end + elseif type(plugin[1]) == "string" then + local name = plugin[1] + if plugin.source == nil then + name = "https://github.com/" .. name + elseif type(plugin.source) == "string" then + name = plugin.source .. name + else + error("plugin source must be either string or nil") + end + + if plugin.load == nil then + vim.pack.add({ name }) + else + vim.pack.add({ name }, { load = plugin.load }) + end + else + error("table passed to load is invalid") + end + elseif type(plugin) == "string" then + vim.pack.add({ "https://github.com/" .. plugin }) + else + error("value passed to load must be string or table [of tables]* of strings") + end +end + +---get plugin, expect it to be in @VIMRC/lua/plugins/name.lua +---@param plugin string +---@return Plugin +function M.get(plugin) + return require("plugins." .. plugin) +end + +---@param pkg Plugin +---@return boolean +local isDoneWaiting = function(pkg) + local after = pkg.after + ---@cast after table + + for _, i in pairs(after) do + if not M.loaded[i] then + return false + end + end + return true +end + +---@class Plugin +---@field configure fun(load: fun(string)): nil +---@field after? string|table +---@field configures? string +---@field onUpdate? fun(ev): nil + +---parse a plugin in the util.Plugin format +---@param plugin Plugin +function M.parse(plugin) + local load = false + if plugin.after == nil then + load = true + elseif type(plugin.after) == "string" then + load = M.loaded[plugin.after] + else + load = isDoneWaiting(plugin) + end + + if load then + plugin.configure(M.load) + + if plugin.configures ~= nil then + M.loaded[plugin.configures] = true + + if M.waiting[plugin.configures] ~= nil then + for _, i in pairs(M.waiting[plugin.configures]) do + M.parse(i) + end + end + M.waiting[plugin.configures] = nil + if plugin.onUpdate ~= nil then + vim.api.nvim_create_autocmd("PackChanged", { + callback = function(ev) + local name, kind = ev.data.spec.name, ev.data.kind + if name == plugin.configures and kind == "update" then + if not ev.data.active then + vim.cmd.packadd(plugin.configures) + end + plugin.onUpdate(ev) + end + end, + }) + end + end + else + if type(plugin.after == "string") then + if M.waiting[plugin.after] == nil then + M.waiting[plugin.after] = {} + end + table.insert(M.waiting[plugin.after], plugin) + else + local after = plugin.after + ---@cast after table + for _, i in pairs(after) do + if M.waiting[i] == nil then + M.waiting[i] = {} + end + table.insert(M.waiting[i], plugin) + end + end + end +end + +return M diff --git a/nvim-pack-lock.json b/nvim-pack-lock.json new file mode 100644 index 0000000..9888bff --- /dev/null +++ b/nvim-pack-lock.json @@ -0,0 +1,116 @@ +{ + "plugins": { + "ansi.nvim": { + "rev": "63462a1550878a5f1a89d5383279775e1882948e", + "src": "https://github.com/0xferrous/ansi.nvim" + }, + "boo.nvim": { + "rev": "926b2e92c7e4341ef5e64c7c8f3373768f5e9437", + "src": "https://github.com/LukasPietzschmann/boo.nvim" + }, + "conform.nvim": { + "rev": "086a40dc7ed8242c03be9f47fbcee68699cc2395", + "src": "https://github.com/stevearc/conform.nvim" + }, + "cord.nvim": { + "rev": "283e4a5bdafd0d6187f28e5b739cccab6b4c9c64", + "src": "https://github.com/vyfor/cord.nvim" + }, + "darioline": { + "rev": "e13f982d3fb11ef62938f5f1b00e205965e94662", + "src": "https://dario48.site/git/Dario48/darioline" + }, + "diagram.nvim": { + "rev": "89d8110ec15021ac9a03ff2317d27b900c45bf60", + "src": "https://github.com/3rd/diagram.nvim" + }, + "image.nvim": { + "rev": "da2be65c153ba15a14a342b05591652a6df70d58", + "src": "https://github.com/3rd/image.nvim" + }, + "lazydev.nvim": { + "rev": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d", + "src": "https://github.com/folke/lazydev.nvim" + }, + "lua-utils.nvim": { + "rev": "e565749421f4bbb5d2e85e37c3cef9d56553d8bd", + "src": "https://github.com/nvim-neorg/lua-utils.nvim" + }, + "mason-bridge.nvim": { + "rev": "19bc564adbb44eaf151e863ffb0a439c4b8c4a79", + "src": "https://github.com/frostplexx/mason-bridge.nvim" + }, + "mason-lspconfig.nvim": { + "rev": "25f609e7fca78af7cede4f9fa3af8a94b1c4950b", + "src": "https://github.com/mason-org/mason-lspconfig.nvim" + }, + "mason.nvim": { + "rev": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65", + "src": "https://github.com/mason-org/mason.nvim" + }, + "neorg": { + "rev": "338f601c7c164e7e3ded7539f209c1f12344a5d5", + "src": "https://github.com/nvim-neorg/neorg" + }, + "neorg-extras": { + "rev": "6e5f33c6e3be0a72134dde576fd95c8ca018f531", + "src": "https://github.com/juniorsundar/neorg-extras" + }, + "nightfox.nvim": { + "rev": "ba47d4b4c5ec308718641ba7402c143836f35aa9", + "src": "https://github.com/EdenEast/nightfox.nvim" + }, + "nvim-lint": { + "rev": "4b03656c09c1561f89b6aa0665c15d292ba9499d", + "src": "https://github.com/mfussenegger/nvim-lint" + }, + "nvim-lspconfig": { + "rev": "16812abf0e8d8175155f26143a8504e8253e92b0", + "src": "https://github.com/neovim/nvim-lspconfig" + }, + "nvim-nio": { + "rev": "21f5324bfac14e22ba26553caf69ec76ae8a7662", + "src": "https://github.com/nvim-neotest/nvim-nio" + }, + "nvim-treesitter": { + "rev": "7caec274fd19c12b55902a5b795100d21531391f", + "src": "https://github.com/nvim-treesitter/nvim-treesitter" + }, + "nvim-web-devicons": { + "rev": "d7462543c9e366c0d196c7f67a945eaaf5d99414", + "src": "https://github.com/nvim-tree/nvim-web-devicons" + }, + "pathlib.nvim": { + "rev": "57e5598af6fe253761c1b48e0b59b7cd6699e2c1", + "src": "https://github.com/pysan3/pathlib.nvim" + }, + "plenary.nvim": { + "rev": "b9fd5226c2f76c951fc8ed5923d85e4de065e509", + "src": "https://github.com/nvim-lua/plenary.nvim" + }, + "rainbow-delimiters.nvim": { + "rev": "50080ed0f44dbc18ae13b81278a01b951a06127a", + "src": "https://github.com/HiPhish/rainbow-delimiters.nvim" + }, + "telescope.nvim": { + "rev": "cfb85dcf7f822b79224e9e6aef9e8c794211b20b", + "src": "https://github.com/nvim-telescope/telescope.nvim" + }, + "venn.nvim": { + "rev": "b09c2f36ddf70b498281845109bedcf08a7e0de0", + "src": "https://github.com/jbyuki/venn.nvim" + }, + "vim-table-mode": { + "rev": "bb025308a45c67c7c8f0763ba37bc2ee3f534df0", + "src": "https://github.com/dhruvasagar/vim-table-mode" + }, + "vimtex": { + "rev": "9306903316c3ddd250676b7cf97c84a84c9c8f99", + "src": "https://github.com/lervag/vimtex" + }, + "which-key.nvim": { + "rev": "3aab2147e74890957785941f0c1ad87d0a44c15a", + "src": "https://github.com/folke/which-key.nvim" + } + } +} From 9127a6161e465b7ca529d97109b60f2f05b8f561 Mon Sep 17 00:00:00 2001 From: Dario48 Date: Fri, 3 Apr 2026 15:33:09 +0200 Subject: [PATCH 02/16] fixed lsp and updated --- init.lua | 1 + lua/plugins/blink-cmp.lua | 58 +++++++++++++++++++++++++++++++++++++++ lua/plugins/lsp.lua | 44 +---------------------------- lua/utils/plugins.lua | 2 +- nvim-pack-lock.json | 8 ++++++ 5 files changed, 69 insertions(+), 44 deletions(-) create mode 100644 lua/plugins/blink-cmp.lua diff --git a/init.lua b/init.lua index a38dd17..f9f0769 100644 --- a/init.lua +++ b/init.lua @@ -2,6 +2,7 @@ require("config.general") require("config.lsp") local plugins = { + "blink-cmp", "lsp", "mason-bridge", "mason", diff --git a/lua/plugins/blink-cmp.lua b/lua/plugins/blink-cmp.lua new file mode 100644 index 0000000..be1c8dc --- /dev/null +++ b/lua/plugins/blink-cmp.lua @@ -0,0 +1,58 @@ +---@module "utils.plugins" +---@type Plugin +return { + configures = "blink.cmp", + configure = function(load) + load("folke/lazydev.nvim") + require("lazydev").setup({}) + + load("rafamadriz/friendly-snippets") + load("saghen/blink.cmp") + + ---@module "blink.cmp" + require("blink.cmp").setup({ + keymap = { preset = "super-tab" }, + appearance = { + -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font' + -- Adjusts spacing to ensure icons are aligned + nerd_font_variant = "mono", + }, + + -- (Default) Only show the documentation popup when manually triggered + completion = { + documentation = { auto_show = true }, + list = { + selection = { + preselect = true, + auto_insert = false, + }, + }, + }, + + signature = { enabled = true }, + + sources = { + default = { "lazydev", "lsp", "path", "snippets", "buffer" }, + providers = { + lazydev = { + name = "LazyDev", + module = "lazydev.integrations.blink", + score_offset = 100, + }, + }, + }, + + fuzzy = { implementation = "prefer_rust" }, + }) + end, + onUpdate = function() + vim.notify("Building blink.cmp", vim.log.levels.INFO) + local obj = vim.system({ "cargo", "build", "--release" }, { cwd = vim.pack.get({ "blink.cmp" })[1].path }) + :wait() + if obj.code == 0 then + vim.notify("Building blink.cmp done", vim.log.levels.INFO) + else + vim.notify("Building blink.cmp failed", vim.log.levels.ERROR) + end + end, +} diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index bbe2c7a..8483601 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -1,52 +1,10 @@ ---@module "utils.plugins" ---@type Plugin return { - after = "mason", + after = { "mason", "blink.cmp" }, configure = function(load) load("neovim/nvim-lspconfig") - load("folke/lazydev.nvim") - require("lazydev").setup({}) - - --[[ - ---@type vim.lsp.Config - local config = { - ---@type lspconfig.settings.lua_ls - settings = { - Lua = { - runtime = { - version = "LuaJIT", - }, - workspace = { - preloadFileSize = 10000, - library = { - vim.env.VIMRUNTIME, - }, - }, - }, - }, - } - - vim.lsp.config("lua_ls", config) - ]] - -- - - vim.api.nvim_create_autocmd("LspAttach", { - callback = function(args) - local client = vim.lsp.get_client_by_id(args.data.client_id) - if client and client:supports_method("textDocument/completion") then - vim.lsp.completion.enable(true, client.id, args.buf, { autotrigger = true }) - end - end, - }) - vim.opt.completeopt = { "menuone", "noinsert", "popup" } - vim.keymap.set("i", "", function() - if vim.fn.pumvisible() == 1 then - return "" - end - return "" - end, { expr = true }) - -- Reserve a space in the gutter -- This will avoid an annoying layout shift in the screen vim.opt.signcolumn = "yes" diff --git a/lua/utils/plugins.lua b/lua/utils/plugins.lua index 06c379a..434eceb 100644 --- a/lua/utils/plugins.lua +++ b/lua/utils/plugins.lua @@ -106,7 +106,7 @@ function M.parse(plugin) end end else - if type(plugin.after == "string") then + if type(plugin.after) == "string" then if M.waiting[plugin.after] == nil then M.waiting[plugin.after] = {} end diff --git a/nvim-pack-lock.json b/nvim-pack-lock.json index 9888bff..35ef6c8 100644 --- a/nvim-pack-lock.json +++ b/nvim-pack-lock.json @@ -4,6 +4,10 @@ "rev": "63462a1550878a5f1a89d5383279775e1882948e", "src": "https://github.com/0xferrous/ansi.nvim" }, + "blink.cmp": { + "rev": "5e088706d92da09949e081cc4d49e2c9ba8cfc8c", + "src": "https://github.com/saghen/blink.cmp" + }, "boo.nvim": { "rev": "926b2e92c7e4341ef5e64c7c8f3373768f5e9437", "src": "https://github.com/LukasPietzschmann/boo.nvim" @@ -24,6 +28,10 @@ "rev": "89d8110ec15021ac9a03ff2317d27b900c45bf60", "src": "https://github.com/3rd/diagram.nvim" }, + "friendly-snippets": { + "rev": "6cd7280adead7f586db6fccbd15d2cac7e2188b9", + "src": "https://github.com/rafamadriz/friendly-snippets" + }, "image.nvim": { "rev": "da2be65c153ba15a14a342b05591652a6df70d58", "src": "https://github.com/3rd/image.nvim" From a0ff79374848545adaa592e7f9d505ec942a3212 Mon Sep 17 00:00:00 2001 From: Dario48 Date: Mon, 13 Apr 2026 22:47:30 +0200 Subject: [PATCH 03/16] update plugin spec --- lua/plugins/blink-cmp.lua | 1 + lua/plugins/statusline.lua | 2 +- lua/utils/plugins.lua | 50 ++++++++++++++++++++++---------------- 3 files changed, 31 insertions(+), 22 deletions(-) diff --git a/lua/plugins/blink-cmp.lua b/lua/plugins/blink-cmp.lua index be1c8dc..90e9f02 100644 --- a/lua/plugins/blink-cmp.lua +++ b/lua/plugins/blink-cmp.lua @@ -55,4 +55,5 @@ return { vim.notify("Building blink.cmp failed", vim.log.levels.ERROR) end end, + } diff --git a/lua/plugins/statusline.lua b/lua/plugins/statusline.lua index 1400f8e..0b761ea 100644 --- a/lua/plugins/statusline.lua +++ b/lua/plugins/statusline.lua @@ -2,7 +2,7 @@ ---@type Plugin return { configure = function(load) - load({ "Dario48/darioline", source = "https://dario48.site/git/" }) + load("Dario48/darioline", { source = "https://dario48.site/git/" }) require("darioline").setup() end, } diff --git a/lua/utils/plugins.lua b/lua/utils/plugins.lua index 434eceb..faf6ce7 100644 --- a/lua/utils/plugins.lua +++ b/lua/utils/plugins.lua @@ -4,39 +4,46 @@ M.loaded = {} M.waiting = {} +---@alias pluginArray string|(pluginArray[]) + +---@class loadOpts +---@field source ?string +---@field packOpts ?vim.pack.keyset.add + +---@alias loadFn fun(plugin: pluginArray, opts?: loadOpts): nil + ---nice utility wrapper around vim.pack.add ----@param plugin string|table -function M.load(plugin) +---@type loadFn +function M.load(plugin, opts) if plugin == nil then error("value passed to load is nil") end if type(plugin) == "table" then - if type(plugin[1]) == "table" then - for _, i in ipairs(plugin) do - M.load(i) - end - elseif type(plugin[1]) == "string" then - local name = plugin[1] - if plugin.source == nil then - name = "https://github.com/" .. name - elseif type(plugin.source) == "string" then - name = plugin.source .. name + for _, i in ipairs(plugin) do + M.load(i, opts) + end + elseif type(plugin) == "string" then + if (opts == nil) then + vim.pack.add({ "https://github.com/" .. plugin }) + else + if opts.source == nil then + plugin = "https://github.com/" .. plugin + elseif type(opts.source) == "string" then + plugin = opts.source .. plugin else error("plugin source must be either string or nil") end - if plugin.load == nil then - vim.pack.add({ name }) + if opts.packOpts == nil then + vim.pack.add({ plugin }) + elseif type(opts.packOpts) == "table" then + vim.pack.add({ plugin }, opts.packOpts) else - vim.pack.add({ name }, { load = plugin.load }) + error("packOpts must be table") end - else - error("table passed to load is invalid") end - elseif type(plugin) == "string" then - vim.pack.add({ "https://github.com/" .. plugin }) else - error("value passed to load must be string or table [of tables]* of strings") + error("value passed to load must be string or table of tables or strings") end end @@ -62,7 +69,7 @@ local isDoneWaiting = function(pkg) end ---@class Plugin ----@field configure fun(load: fun(string)): nil +---@field configure fun(load: loadFn): nil ---@field after? string|table ---@field configures? string ---@field onUpdate? fun(ev): nil @@ -95,6 +102,7 @@ function M.parse(plugin) vim.api.nvim_create_autocmd("PackChanged", { callback = function(ev) local name, kind = ev.data.spec.name, ev.data.kind + print("name: ", name, ", kind: ", kind, ", configures: ", plugin.configures) if name == plugin.configures and kind == "update" then if not ev.data.active then vim.cmd.packadd(plugin.configures) From 6433e1c702617973cc6333923f9f7bc9e507da63 Mon Sep 17 00:00:00 2001 From: Dario48 Date: Mon, 13 Apr 2026 22:54:20 +0200 Subject: [PATCH 04/16] updated update script for blink-cmp --- lua/plugins/blink-cmp.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lua/plugins/blink-cmp.lua b/lua/plugins/blink-cmp.lua index 90e9f02..ebe1919 100644 --- a/lua/plugins/blink-cmp.lua +++ b/lua/plugins/blink-cmp.lua @@ -47,7 +47,16 @@ return { end, onUpdate = function() vim.notify("Building blink.cmp", vim.log.levels.INFO) - local obj = vim.system({ "cargo", "build", "--release" }, { cwd = vim.pack.get({ "blink.cmp" })[1].path }) + local cmd + if vim.fn.executable("nix") == 1 then + cmd = { "nix", "run", ".#build-plugin" } + elseif vim.fn.executable("cargo") == 1 then + cmd = { "cargo", "build", "--release" } + else + print("either cargo or nix is needed to build blink.cmp fzf") + return + end + local obj = vim.system(cmd, { cwd = vim.pack.get({ "blink.cmp" })[1].path }) :wait() if obj.code == 0 then vim.notify("Building blink.cmp done", vim.log.levels.INFO) From 65724f2aeca65ad2192feabaed70dbe841365eb6 Mon Sep 17 00:00:00 2001 From: Dario48 Date: Tue, 14 Apr 2026 15:21:16 +0200 Subject: [PATCH 05/16] change how bash path is set --- lua/config/general.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/config/general.lua b/lua/config/general.lua index 4b4c14d..e29ced4 100644 --- a/lua/config/general.lua +++ b/lua/config/general.lua @@ -3,7 +3,7 @@ vim.opt.softtabstop = 0 vim.opt.shiftwidth = 0 vim.opt.smartindent = true -vim.opt.shell = "/bin/bash" +vim.opt.shell = vim.system({ "which", "bash" }, { text = true }):wait().stdout vim.opt.linebreak = true vim.cmd("set wrap smoothscroll") From 9ea7b0dafccd5be1036cfc533e811755d20b59f8 Mon Sep 17 00:00:00 2001 From: Dario48 Date: Tue, 14 Apr 2026 15:31:30 +0200 Subject: [PATCH 06/16] fix newline --- lua/config/general.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/config/general.lua b/lua/config/general.lua index e29ced4..e98dc92 100644 --- a/lua/config/general.lua +++ b/lua/config/general.lua @@ -3,7 +3,7 @@ vim.opt.softtabstop = 0 vim.opt.shiftwidth = 0 vim.opt.smartindent = true -vim.opt.shell = vim.system({ "which", "bash" }, { text = true }):wait().stdout +vim.opt.shell, _ = vim.system({ "which", "bash" }, { text = true }):wait().stdout:gsub("\n.*", "") vim.opt.linebreak = true vim.cmd("set wrap smoothscroll") From 0024c6cb2ec01b419c0782621351091a579cb2e7 Mon Sep 17 00:00:00 2001 From: Dario48 Date: Sat, 18 Apr 2026 11:59:15 +0200 Subject: [PATCH 07/16] use execrc and add modeline explicitely --- lua/config/general.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/config/general.lua b/lua/config/general.lua index e98dc92..bb7e540 100644 --- a/lua/config/general.lua +++ b/lua/config/general.lua @@ -34,3 +34,7 @@ vim.cmd("nnoremap j gj") vim.cmd("nnoremap k gk") vim.g.zig_fmt_parse_errors = 0 + +vim.o.modeline = true +vim.o.exrc = true +vim.o.secure = true From 109b6dd7173377ebe829e39e6df231a1e5e7dcaa Mon Sep 17 00:00:00 2001 From: Dario48 Date: Fri, 31 Jul 2026 17:15:02 +0200 Subject: [PATCH 08/16] update, split web-devicons from utils and add markdown --- init.lua | 3 +++ lua/plugins/markdown.lua | 9 ++++++++ lua/plugins/utils.lua | 1 - lua/plugins/web-icons.lua | 8 +++++++ nvim-pack-lock.json | 44 +++++++++++++++++++++------------------ 5 files changed, 44 insertions(+), 21 deletions(-) create mode 100644 lua/plugins/markdown.lua create mode 100644 lua/plugins/web-icons.lua diff --git a/init.lua b/init.lua index f9f0769..1d18b23 100644 --- a/init.lua +++ b/init.lua @@ -2,6 +2,9 @@ require("config.general") require("config.lsp") local plugins = { + "web-icons", + "markdown", + "blink-cmp", "lsp", "mason-bridge", diff --git a/lua/plugins/markdown.lua b/lua/plugins/markdown.lua new file mode 100644 index 0000000..db2b19a --- /dev/null +++ b/lua/plugins/markdown.lua @@ -0,0 +1,9 @@ +---@module "utils.plugins" +---@type Plugin +return { + after = { "nvim-treesitter", "web-devicons" }, + configure = function(load) + load("MeanderingProgrammer/render-markdown.nvim") + require('render-markdown').setup({}) + end +} diff --git a/lua/plugins/utils.lua b/lua/plugins/utils.lua index a5bd714..d5d1482 100644 --- a/lua/plugins/utils.lua +++ b/lua/plugins/utils.lua @@ -32,7 +32,6 @@ return { }, } - load("nvim-tree/nvim-web-devicons") load("folke/which-key.nvim") end, } diff --git a/lua/plugins/web-icons.lua b/lua/plugins/web-icons.lua new file mode 100644 index 0000000..323d880 --- /dev/null +++ b/lua/plugins/web-icons.lua @@ -0,0 +1,8 @@ +---@module "utils.plugins" +---@type Plugin +return { + configures = "web-devicons", + configure = function (load) + load("nvim-tree/nvim-web-devicons") + end +} diff --git a/nvim-pack-lock.json b/nvim-pack-lock.json index 35ef6c8..1107490 100644 --- a/nvim-pack-lock.json +++ b/nvim-pack-lock.json @@ -1,11 +1,11 @@ { "plugins": { "ansi.nvim": { - "rev": "63462a1550878a5f1a89d5383279775e1882948e", + "rev": "195b64c3da1c22c2e95648dcbdc6ed075d507064", "src": "https://github.com/0xferrous/ansi.nvim" }, "blink.cmp": { - "rev": "5e088706d92da09949e081cc4d49e2c9ba8cfc8c", + "rev": "005f8c859997f40f65bfbec5f4b400c45fecc06a", "src": "https://github.com/saghen/blink.cmp" }, "boo.nvim": { @@ -13,19 +13,19 @@ "src": "https://github.com/LukasPietzschmann/boo.nvim" }, "conform.nvim": { - "rev": "086a40dc7ed8242c03be9f47fbcee68699cc2395", + "rev": "619363c30309d29ffa631e67c8183f2a72caa373", "src": "https://github.com/stevearc/conform.nvim" }, "cord.nvim": { - "rev": "283e4a5bdafd0d6187f28e5b739cccab6b4c9c64", + "rev": "8f081613c1314a0d6f38839c2788216621efb4d9", "src": "https://github.com/vyfor/cord.nvim" }, "darioline": { - "rev": "e13f982d3fb11ef62938f5f1b00e205965e94662", + "rev": "b5aad4bee9e93216ddf142d30a107507e8afc270", "src": "https://dario48.site/git/Dario48/darioline" }, "diagram.nvim": { - "rev": "89d8110ec15021ac9a03ff2317d27b900c45bf60", + "rev": "a221810b17cdda2d5fdddba9bab3eba6fab8fabc", "src": "https://github.com/3rd/diagram.nvim" }, "friendly-snippets": { @@ -33,7 +33,7 @@ "src": "https://github.com/rafamadriz/friendly-snippets" }, "image.nvim": { - "rev": "da2be65c153ba15a14a342b05591652a6df70d58", + "rev": "88351f1f7d9dbae286e671ce3690a49660dd8a5c", "src": "https://github.com/3rd/image.nvim" }, "lazydev.nvim": { @@ -49,15 +49,15 @@ "src": "https://github.com/frostplexx/mason-bridge.nvim" }, "mason-lspconfig.nvim": { - "rev": "25f609e7fca78af7cede4f9fa3af8a94b1c4950b", + "rev": "67029ccdac1ef8941e13b826417bc0ffac24cc86", "src": "https://github.com/mason-org/mason-lspconfig.nvim" }, "mason.nvim": { - "rev": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65", + "rev": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d", "src": "https://github.com/mason-org/mason.nvim" }, "neorg": { - "rev": "338f601c7c164e7e3ded7539f209c1f12344a5d5", + "rev": "d4dd8979c1129b5251d5565164f54d1cc258e92a", "src": "https://github.com/nvim-neorg/neorg" }, "neorg-extras": { @@ -65,27 +65,27 @@ "src": "https://github.com/juniorsundar/neorg-extras" }, "nightfox.nvim": { - "rev": "ba47d4b4c5ec308718641ba7402c143836f35aa9", + "rev": "4dacd3f0185a2227bdf3b6c0975a8f0bf87cac9a", "src": "https://github.com/EdenEast/nightfox.nvim" }, "nvim-lint": { - "rev": "4b03656c09c1561f89b6aa0665c15d292ba9499d", + "rev": "a219b2c9e5b4765e5c845aba119dad55806fcaf1", "src": "https://github.com/mfussenegger/nvim-lint" }, "nvim-lspconfig": { - "rev": "16812abf0e8d8175155f26143a8504e8253e92b0", + "rev": "9ae2b3b63b924b1329724dae76e9d2c5c40b389c", "src": "https://github.com/neovim/nvim-lspconfig" }, "nvim-nio": { - "rev": "21f5324bfac14e22ba26553caf69ec76ae8a7662", + "rev": "edcc181a875301dd21840189aa2f2f9ad69fc172", "src": "https://github.com/nvim-neotest/nvim-nio" }, "nvim-treesitter": { - "rev": "7caec274fd19c12b55902a5b795100d21531391f", + "rev": "0f32dff7f19476629c77467f887b95e5e2d33509", "src": "https://github.com/nvim-treesitter/nvim-treesitter" }, "nvim-web-devicons": { - "rev": "d7462543c9e366c0d196c7f67a945eaaf5d99414", + "rev": "2ae6958df7ced50baac5035cec0c15799eedfbf7", "src": "https://github.com/nvim-tree/nvim-web-devicons" }, "pathlib.nvim": { @@ -93,15 +93,19 @@ "src": "https://github.com/pysan3/pathlib.nvim" }, "plenary.nvim": { - "rev": "b9fd5226c2f76c951fc8ed5923d85e4de065e509", + "rev": "74b06c6c75e4eeb3108ec01852001636d85a932b", "src": "https://github.com/nvim-lua/plenary.nvim" }, "rainbow-delimiters.nvim": { - "rev": "50080ed0f44dbc18ae13b81278a01b951a06127a", + "rev": "012f1480cd9a5fc99fce7678e0a536421a53fc46", "src": "https://github.com/HiPhish/rainbow-delimiters.nvim" }, + "render-markdown.nvim": { + "rev": "f422cb5c6855f150e2ddcfaf44e7157b98b34f6a", + "src": "https://github.com/MeanderingProgrammer/render-markdown.nvim" + }, "telescope.nvim": { - "rev": "cfb85dcf7f822b79224e9e6aef9e8c794211b20b", + "rev": "427b576c16792edad01a92b89721d923c19ad60f", "src": "https://github.com/nvim-telescope/telescope.nvim" }, "venn.nvim": { @@ -113,7 +117,7 @@ "src": "https://github.com/dhruvasagar/vim-table-mode" }, "vimtex": { - "rev": "9306903316c3ddd250676b7cf97c84a84c9c8f99", + "rev": "853eb587873a7061a083655578be56dd8027b834", "src": "https://github.com/lervag/vimtex" }, "which-key.nvim": { From add1882062071480e353c68d1d42eaaa1d54c933 Mon Sep 17 00:00:00 2001 From: Dario48 Date: Thu, 6 Aug 2026 20:18:28 +0200 Subject: [PATCH 09/16] attept at a better linting experience --- lua/plugins/nvim-lint.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/plugins/nvim-lint.lua b/lua/plugins/nvim-lint.lua index 4d95fd4..66ddb1f 100644 --- a/lua/plugins/nvim-lint.lua +++ b/lua/plugins/nvim-lint.lua @@ -16,6 +16,7 @@ return { underline = true, update_in_insert = false, virtual_text = true, + virtual_lines = { current_line = true }, }) require("lint").linters_by_ft = require("mason-bridge").get_linters() From dac9d33960a6d4026d437a5015f69bb70d8e1eff Mon Sep 17 00:00:00 2001 From: Dario48 Date: Fri, 21 Aug 2026 14:44:25 +0200 Subject: [PATCH 10/16] blink.lib + neorg --- init.lua | 2 +- lua/plugins/blink-cmp.lua | 19 +++---------------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/init.lua b/init.lua index 1d18b23..3ed62a3 100644 --- a/init.lua +++ b/init.lua @@ -13,7 +13,7 @@ local plugins = { "treesitter", "nvim-lint", - -- "neorg", + "neorg", "nightfox", diff --git a/lua/plugins/blink-cmp.lua b/lua/plugins/blink-cmp.lua index ebe1919..dcee929 100644 --- a/lua/plugins/blink-cmp.lua +++ b/lua/plugins/blink-cmp.lua @@ -7,8 +7,10 @@ return { require("lazydev").setup({}) load("rafamadriz/friendly-snippets") + load("saghen/blink.lib") load("saghen/blink.cmp") + ---@module "blink.cmp" require("blink.cmp").setup({ keymap = { preset = "super-tab" }, @@ -47,22 +49,7 @@ return { end, onUpdate = function() vim.notify("Building blink.cmp", vim.log.levels.INFO) - local cmd - if vim.fn.executable("nix") == 1 then - cmd = { "nix", "run", ".#build-plugin" } - elseif vim.fn.executable("cargo") == 1 then - cmd = { "cargo", "build", "--release" } - else - print("either cargo or nix is needed to build blink.cmp fzf") - return - end - local obj = vim.system(cmd, { cwd = vim.pack.get({ "blink.cmp" })[1].path }) - :wait() - if obj.code == 0 then - vim.notify("Building blink.cmp done", vim.log.levels.INFO) - else - vim.notify("Building blink.cmp failed", vim.log.levels.ERROR) - end + require('blink.cmp').build():pwait() end, } From c9e686a19d366593d04b96442f954b17929b00be Mon Sep 17 00:00:00 2001 From: Dario48 Date: Fri, 21 Aug 2026 16:19:13 +0200 Subject: [PATCH 11/16] remove outdated plugin --- lua/plugins/neorg.lua | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lua/plugins/neorg.lua b/lua/plugins/neorg.lua index f84e0d3..6580206 100644 --- a/lua/plugins/neorg.lua +++ b/lua/plugins/neorg.lua @@ -5,17 +5,9 @@ return { configure = function(load) load("nvim-neotest/nvim-nio") load("pysan3/pathlib.nvim") - load("nvim-neorg/lua-utils.nvim") - load("juniorsundar/neorg-extras") load("nvim-neorg/neorg") require("neorg").setup({ load = { - ["external.many-mans"] = { - config = { - metadata_fold = true, -- If want @data property ... @end to fold - code_fold = true, -- If want @code ... @end to fold - }, - }, ["core.defaults"] = {}, ["core.concealer"] = {}, -- ["core.completion"] = { config = { engine = "nvim-cmp" } }, From 35718a7b1ccd32c31102045a1ffaf0c3be7971fc Mon Sep 17 00:00:00 2001 From: Dario48 Date: Fri, 21 Aug 2026 16:22:31 +0200 Subject: [PATCH 12/16] remove outdated plugin --- lua/plugins/neorg.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/plugins/neorg.lua b/lua/plugins/neorg.lua index 6580206..92fc851 100644 --- a/lua/plugins/neorg.lua +++ b/lua/plugins/neorg.lua @@ -5,6 +5,7 @@ return { configure = function(load) load("nvim-neotest/nvim-nio") load("pysan3/pathlib.nvim") + load("nvim-neorg/lua-utils.nvim") load("nvim-neorg/neorg") require("neorg").setup({ load = { From 9c2b8d00aa1d6dc4572eb1682ae178876631ab0d Mon Sep 17 00:00:00 2001 From: Dario48 Date: Fri, 21 Aug 2026 16:27:39 +0200 Subject: [PATCH 13/16] added parser install --- lua/plugins/neorg.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/plugins/neorg.lua b/lua/plugins/neorg.lua index 92fc851..33e7a4e 100644 --- a/lua/plugins/neorg.lua +++ b/lua/plugins/neorg.lua @@ -27,5 +27,6 @@ return { }, }, }) + require("nvim-treesitter").install({ "norg", "norg_meta" }):wait(300000) end, } From 408555ba205af506b1980f0b6c9cb8f0615d8a57 Mon Sep 17 00:00:00 2001 From: Dario48 Date: Fri, 21 Aug 2026 17:10:12 +0200 Subject: [PATCH 14/16] add treesitter hopefully --- lua/plugins/neorg.lua | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/lua/plugins/neorg.lua b/lua/plugins/neorg.lua index 33e7a4e..7943a4b 100644 --- a/lua/plugins/neorg.lua +++ b/lua/plugins/neorg.lua @@ -6,13 +6,46 @@ return { load("nvim-neotest/nvim-nio") load("pysan3/pathlib.nvim") load("nvim-neorg/lua-utils.nvim") + load("nvim-neorg/tree-sitter-norg") + -- parser {{{ + local data = vim.fn.stdpath("data") + local src = data .. "/site/pack/core/opt/tree-sitter-norg" + local src_meta = data .. "/site/pack/core/opt/tree-sitter-norg-meta" + local parser_dir = data .. "/site/parser" + local out = parser_dir .. "/norg.so" + local out_meta = parser_dir .. "/norg_meta.so" + + + if not vim.uv.fs_stat(out) and vim.uv.fs_stat(src) then + -- not already built, and present + vim.fn.mkdir(parser_dir, "p") + local result = vim.system({ "nix", "build" }, { cwd = src }):wait() + if result.code == 0 then + vim.system({ "cp", "result/lib/lua/5.1/parser/norg.so", out }, { cwd = src }):wait() + else + vim.notify("failed to run nix build for norg treesitter, got result " .. tostring(result), + vim.log.levels.ERROR) + end + result = vim.system({ "nix", "build" }, { cwd = src_meta }):wait() + if result.code == 0 then + vim.system({ "cp", "result/parser", out_meta }, { cwd = src_meta }):wait() + else + vim.notify("failed to run nix build for norg_meta treesitter, got result " .. tostring(result), + vim.log.levels.ERROR) + end + end + + -- }}} + load("nvim-neorg/neorg") require("neorg").setup({ load = { ["core.defaults"] = {}, ["core.concealer"] = {}, -- ["core.completion"] = { config = { engine = "nvim-cmp" } }, - -- ["core.integrations.treesitter"] = {}, + ["core.integrations.treesitter"] = { + config = { configure_parsers = false }, + }, ["core.clipboard.code-blocks"] = {}, ["core.esupports.indent"] = {}, ["core.dirman"] = { From 63d295a739ec4341dd80fa1f41c69a9677112cc6 Mon Sep 17 00:00:00 2001 From: Dario48 Date: Fri, 21 Aug 2026 17:12:45 +0200 Subject: [PATCH 15/16] add treesitter hopefully --- lua/plugins/neorg.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lua/plugins/neorg.lua b/lua/plugins/neorg.lua index 7943a4b..cd9e598 100644 --- a/lua/plugins/neorg.lua +++ b/lua/plugins/neorg.lua @@ -12,13 +12,14 @@ return { local src = data .. "/site/pack/core/opt/tree-sitter-norg" local src_meta = data .. "/site/pack/core/opt/tree-sitter-norg-meta" local parser_dir = data .. "/site/parser" + vim.fn.mkdir(parser_dir, "p") + local out = parser_dir .. "/norg.so" local out_meta = parser_dir .. "/norg_meta.so" if not vim.uv.fs_stat(out) and vim.uv.fs_stat(src) then - -- not already built, and present - vim.fn.mkdir(parser_dir, "p") + -- not already built, and src present local result = vim.system({ "nix", "build" }, { cwd = src }):wait() if result.code == 0 then vim.system({ "cp", "result/lib/lua/5.1/parser/norg.so", out }, { cwd = src }):wait() @@ -26,7 +27,10 @@ return { vim.notify("failed to run nix build for norg treesitter, got result " .. tostring(result), vim.log.levels.ERROR) end - result = vim.system({ "nix", "build" }, { cwd = src_meta }):wait() + end + if not vim.uv.fs_stat(out_meta) and vim.uv.fs_stat(src_meta) then + -- not already built, and src present + local result = vim.system({ "nix", "build" }, { cwd = src_meta }):wait() if result.code == 0 then vim.system({ "cp", "result/parser", out_meta }, { cwd = src_meta }):wait() else From 327651d68dd8fa3ba184e43485c723011bcc25f6 Mon Sep 17 00:00:00 2001 From: Dario48 Date: Fri, 21 Aug 2026 17:15:03 +0200 Subject: [PATCH 16/16] remove thing that not exist --- lua/plugins/neorg.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/plugins/neorg.lua b/lua/plugins/neorg.lua index cd9e598..9294fcc 100644 --- a/lua/plugins/neorg.lua +++ b/lua/plugins/neorg.lua @@ -64,6 +64,5 @@ return { }, }, }) - require("nvim-treesitter").install({ "norg", "norg_meta" }):wait(300000) end, }