From a874867e978e236fa309acc4e8db3b2ada0b73b3 Mon Sep 17 00:00:00 2001 From: Dzuchun Date: Thu, 25 Dec 2025 13:30:02 +0000 Subject: [PATCH 01/15] line wrapping toggle --- nvim/lua/dzu/keymaps.lua | 3 +++ nvim/lua/dzu/macro.lua | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/nvim/lua/dzu/keymaps.lua b/nvim/lua/dzu/keymaps.lua index bdf0b82..f036d34 100644 --- a/nvim/lua/dzu/keymaps.lua +++ b/nvim/lua/dzu/keymaps.lua @@ -49,6 +49,9 @@ keymap(vm, "p", '"_dP', opts) keymap(nm, "s", "", opts) keymap(nm, "sw", ":lua require('dzu.macro').toggle_whitespace_helpers()", opts) +-- toggle line wrapping +keymap(nm, 'w', ":lua require('dzu.macro').toggle_wrapping()", opts) + -- open file browser keymap(nm, 'a', ':NvimTreeToggle', opts) -- open file explorer in the current folder, shirnk it a bit, and move to the left-most diff --git a/nvim/lua/dzu/macro.lua b/nvim/lua/dzu/macro.lua index 63c0a87..73f3cbe 100644 --- a/nvim/lua/dzu/macro.lua +++ b/nvim/lua/dzu/macro.lua @@ -14,6 +14,12 @@ function M.toggle_whitespace_helpers() end end +-- add wrapping toggle +function M.toggle_wrapping() + local wrap = vim.opt.wrap._value + vim.opt.wrap = not wrap +end + -- limiting line must be disable in readonly windows vim.api.nvim_create_autocmd("BufEnter", { callback = function(event_data) From d48f805b70ea8e6ab17ab040f78da5fa09cd4366 Mon Sep 17 00:00:00 2001 From: Dzuchun Date: Thu, 25 Dec 2025 18:13:17 +0000 Subject: [PATCH 02/15] feat(lua_ls): use spaces instead of tabs --- nvim/lua/dzu/lsp/lua_ls.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/nvim/lua/dzu/lsp/lua_ls.lua b/nvim/lua/dzu/lsp/lua_ls.lua index 74ec078..a67daa5 100644 --- a/nvim/lua/dzu/lsp/lua_ls.lua +++ b/nvim/lua/dzu/lsp/lua_ls.lua @@ -17,6 +17,13 @@ return { telemetry = { enable = false, }, - } - } + format = { + enable = true, + defaultConfig = { + indent_style = "space", + indent_size = "4", + }, + }, + }, + }, } From 1b913c19cbbf832b26315dbfa38e176098e1c8b0 Mon Sep 17 00:00:00 2001 From: Dzuchun Date: Thu, 25 Dec 2025 18:17:37 +0000 Subject: [PATCH 03/15] ench: unfold everything in diffview by default --- nvim/lua/dzu/plugins/diffview.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nvim/lua/dzu/plugins/diffview.lua b/nvim/lua/dzu/plugins/diffview.lua index 8718cb3..73abc70 100644 --- a/nvim/lua/dzu/plugins/diffview.lua +++ b/nvim/lua/dzu/plugins/diffview.lua @@ -89,7 +89,11 @@ local function config() DiffviewOpen = {}, DiffviewFileHistory = {}, }, - hooks = {}, -- See |diffview-config-hooks| + hooks = { + diff_buf_win_enter = function() + vim.opt_local.foldenable = false + end, + }, -- See |diffview-config-hooks| keymaps = { disable_defaults = false, -- Disable the default keymaps view = { From c2926c1e3aea0077ae8418905760cb0fcccf5fc3 Mon Sep 17 00:00:00 2001 From: Dzuchun Date: Thu, 25 Dec 2025 18:19:20 +0000 Subject: [PATCH 04/15] ench: remove folding --- nvim/lua/dzu/options.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/nvim/lua/dzu/options.lua b/nvim/lua/dzu/options.lua index e15c347..a47b7b9 100644 --- a/nvim/lua/dzu/options.lua +++ b/nvim/lua/dzu/options.lua @@ -42,13 +42,10 @@ local options = { errorbells = true, -- sound on errors exrc = true, -- execute possible local config fillchars = 'diff:<', - foldlevelstart = 0, -- at start, close all folds... - foldminlines = 50, -- but only fold really large things... - foldmethod = 'indent', -- and identify them by indent -- look into lang* (langmenu) lazyredraw = true, -- might be a bad idea, IDK - mouse = 'nvi', -- enable mouse at insert and visual - mousehide = true, -- hide mouse when something is being typed + mouse = 'nvi', -- enable mouse at insert and visual + mousehide = true, -- hide mouse when something is being typed -- mousefocus = true, -- focus on window where mouse is mousescroll = 'ver:2,hor:3', -- mouses = 'n:arrow,v:crosshair,i:beam', -- how mouse looks like in different modes From 92e63a74c48625bc04e624c0f49c912808e96521 Mon Sep 17 00:00:00 2001 From: Dzuchun Date: Thu, 25 Dec 2025 18:20:42 +0000 Subject: [PATCH 05/15] ench: hide mouse even more --- nvim/lua/dzu/options.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/nvim/lua/dzu/options.lua b/nvim/lua/dzu/options.lua index a47b7b9..da1d2f4 100644 --- a/nvim/lua/dzu/options.lua +++ b/nvim/lua/dzu/options.lua @@ -44,10 +44,9 @@ local options = { fillchars = 'diff:<', -- look into lang* (langmenu) lazyredraw = true, -- might be a bad idea, IDK - mouse = 'nvi', -- enable mouse at insert and visual - mousehide = true, -- hide mouse when something is being typed - -- mousefocus = true, -- focus on window where mouse is - mousescroll = 'ver:2,hor:3', + mouse = '', + mousehide = true, + mousescroll = 'ver:0,hor:0', -- mouses = 'n:arrow,v:crosshair,i:beam', -- how mouse looks like in different modes number = true, -- print numbers at the start ruler = true, -- show row&column From 5bc731de3e3a3fbbae3274dba5f7dd935a51b1c1 Mon Sep 17 00:00:00 2001 From: Dzuchun Date: Thu, 25 Dec 2025 18:26:28 +0000 Subject: [PATCH 06/15] disable automatic line breaking --- nvim/lua/dzu/options.lua | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/nvim/lua/dzu/options.lua b/nvim/lua/dzu/options.lua index da1d2f4..77f7f77 100644 --- a/nvim/lua/dzu/options.lua +++ b/nvim/lua/dzu/options.lua @@ -16,13 +16,7 @@ local options = { }, -- visualbell = true, -- FLASHES THE SCREEN -- binary - check out binary file viewing and editing - linebreak = true, - breakat = " ^I!@*-+;:,./?", -- where line breaks are allowed - -- breakindent = true, -- line breaks continue where the line starts - breakindentopt = { - 'shift:0', -- indent by no char - 'sbr', -- show line break symbol - }, + linebreak = false, showbreak = '↪ ', -- line break symbol itself cdhome = false, -- do not cd to home on :cd (won't work?) cedit = '', -- no kinding to open CL window (?) From 92ceeb006e9cc15c2b4b6234d4a085a2609ebe01 Mon Sep 17 00:00:00 2001 From: Dzuchun Date: Thu, 25 Dec 2025 18:26:52 +0000 Subject: [PATCH 07/15] ench: explicit line wrapping on by default --- nvim/lua/dzu/options.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/nvim/lua/dzu/options.lua b/nvim/lua/dzu/options.lua index 77f7f77..dff4314 100644 --- a/nvim/lua/dzu/options.lua +++ b/nvim/lua/dzu/options.lua @@ -17,6 +17,7 @@ local options = { -- visualbell = true, -- FLASHES THE SCREEN -- binary - check out binary file viewing and editing linebreak = false, + wrap = true, showbreak = '↪ ', -- line break symbol itself cdhome = false, -- do not cd to home on :cd (won't work?) cedit = '', -- no kinding to open CL window (?) From 0ab6b09300af76190fd488ce69750d9032e9782c Mon Sep 17 00:00:00 2001 From: Dzuchun Date: Thu, 25 Dec 2025 18:33:15 +0000 Subject: [PATCH 08/15] fix: "couldn't load tree-sitter" the setup code was incorrect. no idea where it came from :/ --- nvim/lua/dzu/plugins/formatting.lua | 1 - nvim/lua/dzu/plugins/tree-sitter.lua | 83 ++++++++++++++-------------- 2 files changed, 41 insertions(+), 43 deletions(-) diff --git a/nvim/lua/dzu/plugins/formatting.lua b/nvim/lua/dzu/plugins/formatting.lua index 9564951..619a87d 100644 --- a/nvim/lua/dzu/plugins/formatting.lua +++ b/nvim/lua/dzu/plugins/formatting.lua @@ -8,7 +8,6 @@ local function config() -- js/ts fomatters local web_fmt = { "biome" }; local fomatters_by_ft = { - lua = { "stylua" }, python = { "black" }, javascript = web_fmt, javascriptreact = web_fmt, diff --git a/nvim/lua/dzu/plugins/tree-sitter.lua b/nvim/lua/dzu/plugins/tree-sitter.lua index c1e9739..68f1c78 100644 --- a/nvim/lua/dzu/plugins/tree-sitter.lua +++ b/nvim/lua/dzu/plugins/tree-sitter.lua @@ -1,49 +1,48 @@ local function config() - local is_ok, configs = pcall(require, "nvim-treesitter.configs") + local is_ok, tree_sitter = pcall(require, "nvim-treesitter") if not is_ok then - vim.notify("couldn't find tree sitter config") + vim.notify("couldn't find tree sitter") return end - local config_opts = { - ensure_installed = { - "bash", - "c", - "comment", - "cpp", - "csv", - -- "cuda", -- not yet; might enable in the future - "djot", - "dockerfile", -- oh yeah. I should probably figure docker out... - "fish", - "gitignore", - "diff", - "git_rebase", - "gitcommit", - "haskell", - "html", - "javascript", - "typescript", - -- "jsx", - "tsx", - "json", - "latex", - "lua", - "luadoc", - "make", - "markdown", - "markdown_inline", - "python", - "rust", - "sql", - "toml", - "vim", - "vimdoc", - "xml", - "nu", - "java", - }, - sync_install = false, + local langs = { + "bash", + "c", + "comment", + "cpp", + "csv", + "djot", + "dockerfile", + "fish", + "gitignore", + "diff", + "git_rebase", + "gitcommit", + "haskell", + "html", + "javascript", + "typescript", + "tsx", + "json", + "latex", + "lua", + "luadoc", + "make", + "markdown", + "markdown_inline", + "python", + "rust", + "sql", + "toml", + "vim", + "vimdoc", + "xml", + "nu", + "java", + } + local opts = { + ensure_installed = langs, + sync_install = true, ignore_install = {}, -- List of parsers to ignore installing highlight = { enable = true, -- false will disable the whole extension @@ -53,7 +52,7 @@ local function config() }, indent = { enable = true, disable = {} }, } - configs.setup(config_opts) + tree_sitter.setup(opts) vim.cmd.TSUpdate() end From 0e9b9149dc5d915b7f9dbc6f4ab56026553e4ace Mon Sep 17 00:00:00 2001 From: Dzuchun Date: Thu, 25 Dec 2025 18:35:18 +0000 Subject: [PATCH 09/15] fix: load everything with mason-tools this way, I can finally ensure that all the LSPs are properly installed on editor boot --- nvim/lua/dzu/lsp/mason.lua | 18 +++++++++++++---- nvim/lua/dzu/plugins/lsp.lua | 10 ---------- nvim/lua/dzu/plugins/mason-tools.lua | 29 ++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 14 deletions(-) create mode 100644 nvim/lua/dzu/plugins/mason-tools.lua diff --git a/nvim/lua/dzu/lsp/mason.lua b/nvim/lua/dzu/lsp/mason.lua index a4fb402..ffb96dd 100644 --- a/nvim/lua/dzu/lsp/mason.lua +++ b/nvim/lua/dzu/lsp/mason.lua @@ -27,17 +27,28 @@ local servers = { { "html", nil }, { "dockerls", nil }, } -local lspconfig_servers = {} +local ensure_installed = {} +local i = 1 for _, s in pairs(servers) do local s0 = s[1] if s0 ~= nil then - table.insert(lspconfig_servers, s0) + table.insert(ensure_installed, i, s0) + i = i + 1 vim.lsp.enable(s0, true) end end +for tool, _ in pairs(ADDITIONAL_MASON_TOOLS) do + table.insert(ensure_installed, i, tool) + i = i + 1 +end + +require("mason-tool-installer").setup({ + ensure_installed = ensure_installed, + auto_update = true, + run_on_start = true, +}) require("mason-lspconfig").setup({ - ensure_installed = lspconfig_servers, automatic_enable = true, automatic_installation = true, }) @@ -50,7 +61,6 @@ for _, s in pairs(servers) do end end - local is_ok, handlers = pcall(require, "dzu.lsp.handlers") if not is_ok then vim.notify("failed to initialize LSP handlers") diff --git a/nvim/lua/dzu/plugins/lsp.lua b/nvim/lua/dzu/plugins/lsp.lua index a34cbdc..acef290 100644 --- a/nvim/lua/dzu/plugins/lsp.lua +++ b/nvim/lua/dzu/plugins/lsp.lua @@ -1,20 +1,10 @@ -local function config() - local is_ok, _ = pcall(require, 'dzu.lsp') - if not is_ok then - vim.notify("failed to setup lsp") - return - end -end - return { "mason-org/mason-lspconfig.nvim", - opts = {}, dependencies = { "mason-org/mason.nvim", "neovim/nvim-lspconfig", -- lsp completions "hrsh7th/cmp-nvim-lsp", }, - config = config, lazy = false, } diff --git a/nvim/lua/dzu/plugins/mason-tools.lua b/nvim/lua/dzu/plugins/mason-tools.lua new file mode 100644 index 0000000..cced0fc --- /dev/null +++ b/nvim/lua/dzu/plugins/mason-tools.lua @@ -0,0 +1,29 @@ +local function config() + local is_ok, _ = pcall(require, "mason-tool-installer") + if not is_ok then + vim.notify("Failed to setup mason tools") + return + end + + local is_ok, _ = pcall(require, "dzu.lsp") + if not is_ok then + vim.notify("failed to setup lsp") + return + end +end + +return { + "WhoIsSethDaniel/mason-tool-installer.nvim", + dependencies = { + "mason-org/mason-lspconfig.nvim", + }, + config = config, + lazy = false, + opts = { + integrations = { + ["mason-lspconfig"] = true, + ["mason-null-ls"] = false, + ["mason-nvim-dap"] = false, + }, + }, +} From a4c83b8e857af762f79a5ed03c16350577b318da Mon Sep 17 00:00:00 2001 From: Dzuchun Date: Thu, 25 Dec 2025 18:39:11 +0000 Subject: [PATCH 10/15] fix: remove nil_ls from the lsp config as it requires nix to be built --- nvim/lua/dzu/lsp/mason.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/nvim/lua/dzu/lsp/mason.lua b/nvim/lua/dzu/lsp/mason.lua index ffb96dd..025fe3e 100644 --- a/nvim/lua/dzu/lsp/mason.lua +++ b/nvim/lua/dzu/lsp/mason.lua @@ -20,7 +20,6 @@ local servers = { { "clangd", nil }, { "lua_ls", "lua_ls" }, -- { "hls", "hls" }, - { "nil_ls", nil }, { "tinymist", "tinymist" }, { "jdtls", nil }, -- { "nushell", nil }, -- TODO what IS the lspconfig name? From 406f21bc01a73e8937959ce9d1027f6df6a899a2 Mon Sep 17 00:00:00 2001 From: Dzuchun Date: Thu, 25 Dec 2025 18:40:03 +0000 Subject: [PATCH 11/15] fix: bring clangd back into cutom configs --- nvim/lua/dzu/lsp/mason.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvim/lua/dzu/lsp/mason.lua b/nvim/lua/dzu/lsp/mason.lua index 025fe3e..6d8994b 100644 --- a/nvim/lua/dzu/lsp/mason.lua +++ b/nvim/lua/dzu/lsp/mason.lua @@ -17,7 +17,7 @@ local servers = { { "pyright", "pyright", }, { "ts_ls", nil }, { "biome", nil }, - { "clangd", nil }, + { "clangd", "clangd" }, { "lua_ls", "lua_ls" }, -- { "hls", "hls" }, { "tinymist", "tinymist" }, From 84cf9c92623b5a18def7c18eb64fe08a83b0a5ec Mon Sep 17 00:00:00 2001 From: Dzuchun Date: Thu, 25 Dec 2025 18:41:12 +0000 Subject: [PATCH 12/15] fmt --- nvim/lua/dzu/lsp/mason.lua | 4 +--- nvim/lua/dzu/plugins/formatting.lua | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/nvim/lua/dzu/lsp/mason.lua b/nvim/lua/dzu/lsp/mason.lua index 6d8994b..1336ae2 100644 --- a/nvim/lua/dzu/lsp/mason.lua +++ b/nvim/lua/dzu/lsp/mason.lua @@ -14,15 +14,13 @@ require("mason").setup(settings) local servers = { { "rust_analyzer", "rust_analyzer" }, - { "pyright", "pyright", }, + { "pyright", "pyright" }, { "ts_ls", nil }, { "biome", nil }, { "clangd", "clangd" }, { "lua_ls", "lua_ls" }, - -- { "hls", "hls" }, { "tinymist", "tinymist" }, { "jdtls", nil }, - -- { "nushell", nil }, -- TODO what IS the lspconfig name? { "html", nil }, { "dockerls", nil }, } diff --git a/nvim/lua/dzu/plugins/formatting.lua b/nvim/lua/dzu/plugins/formatting.lua index 619a87d..ed81ac1 100644 --- a/nvim/lua/dzu/plugins/formatting.lua +++ b/nvim/lua/dzu/plugins/formatting.lua @@ -6,7 +6,7 @@ local function config() end -- js/ts fomatters - local web_fmt = { "biome" }; + local web_fmt = { "biome" } local fomatters_by_ft = { python = { "black" }, javascript = web_fmt, From e0fac2c5a112b0f0efb560bc2253c937d6440239 Mon Sep 17 00:00:00 2001 From: Dzuchun Date: Thu, 25 Dec 2025 18:41:40 +0000 Subject: [PATCH 13/15] ignore local XDG config is appeared here, while I was running nvim locally --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index b9c1460..e1eb082 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,6 @@ package-lock.json # stt model ggml-*.bin + +# xdg config, only useful for test runs +mimeapps.list From f8a497b9af452c328f8346f9b594452e68b6f3da Mon Sep 17 00:00:00 2001 From: Dzuchun Date: Thu, 25 Dec 2025 18:42:15 +0000 Subject: [PATCH 14/15] ignore: htmlhint config used to check if htmlhint correctly reacts to it's config. no point to keep it in this repo --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index e1eb082..63212a2 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,6 @@ ggml-*.bin # xdg config, only useful for test runs mimeapps.list + +# htmlhint config, not a part of nvim config +.htmlhintrc From 36e297e01237f20172c0f083c607c42163354661 Mon Sep 17 00:00:00 2001 From: Dzuchun Date: Thu, 25 Dec 2025 18:43:14 +0000 Subject: [PATCH 15/15] makefile: add `update` target - updates Lazy plugins - updates Mason registry - install all the Mason stuff - included in `install` --- makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index 4d15c44..4e993fa 100644 --- a/makefile +++ b/makefile @@ -49,8 +49,11 @@ remove_cfg: rm $(CONFIG_FILES_FILE); \ fi +update: + @ndzu --headless '+Lazy! update' '+Lazy! sync' '+MasonToolsUpdateSync' +qa + # PACMAN_DEPS: deno tree-sitter-cli nix luarocks jdk21-openjdk # CARGO_BINS: nu nu_plugin_polars -install: install_bin install_cfg +install: install_bin install_cfg update remove: remove_bin remove_cfg