From f095d0cbf59eab294dcfded9f6814a2a8841b488 Mon Sep 17 00:00:00 2001 From: Squibid Date: Wed, 17 Dec 2025 22:15:45 -0500 Subject: [PATCH 1/6] my attempt to use the treesitter rewrite it'd be nice to use this but it forces me to chase the cli util which isn't reasonable whatsoever, additionally: - It can't seem to check if something is installed before attempting to reinstall it - It won't shut the fuck up with all it's messages even though it's not even supposed to show messages by default I'm sure the codebase is less of a mess but the ergonomics from a user standpoint is absolutely worse. --- lua/conf/plugins/treesitter.lua | 87 +++++++++++++++++---------------- 1 file changed, 44 insertions(+), 43 deletions(-) diff --git a/lua/conf/plugins/treesitter.lua b/lua/conf/plugins/treesitter.lua index fbe620c..17588f6 100644 --- a/lua/conf/plugins/treesitter.lua +++ b/lua/conf/plugins/treesitter.lua @@ -1,58 +1,59 @@ -local map = core.misc.map +local map, auto = core.misc.map, core.misc.auto + +local function highlight(buf) + local lang = vim.bo[buf].ft + if table.contains({ "diff", "tex" }, lang) then + return false + end + + -- disable in big files + local ok, stats = pcall(vim.uv.fs_stat, + vim.api.nvim_buf_get_name(buf)) + if ok and stats and stats.size > (1024 * 100 * 10) --[[1MB]] then + return false + end + + return true +end + +local function indent(buf) + local lang = vim.bo[buf].ft + -- disable indenting in php (it's more broken with than without) + return not table.contains({ "php" }, lang) +end return { { "nvim-treesitter/nvim-treesitter", + branch = "main", config = function() vim.cmd("TSUpdate") end, load = function() - require("nvim-treesitter.configs").setup { - -- good default parsers - ensure_installed = { "c", "lua", "vim", "vimdoc", "markdown", - "markdown_inline", "java", "bash", "css", "html", "luadoc", - "make", "zig" - }, + local treesitter = require("nvim-treesitter") + treesitter.setup {} + treesitter.install({ + "c", "lua", "vim", "vimdoc", "markdown", + "markdown_inline", "java", "bash", "css", "html", "luadoc", + "make", "zig" + }, { + force = false, + summary = false, + }) - -- indentation - indent = { - enable = true, - - disable = function(lang, _) - -- disable indenting in php (it's more broken with than without) - return table.contains(({ - "php" - }), lang) + auto("FileType", { + callback = function(ev) + if highlight(ev.buf) then + pcall(vim.treesitter.start) + vim.bo[ev.buf].syntax = "ON" end - }, - - -- enable highlighting - highlight = { - enable = true, - -- use vim highlighting in addition to treesitter - additional_vim_regex_highlighting = true, - - disable = function(lang, buf) - -- disable in some files where vim's builtin highlighting is better - if table.contains(({ - "diff", "tex" - }), lang) then - return true - end - - -- disable in big files - local ok, stats = pcall(vim.uv.fs_stat, - vim.api.nvim_buf_get_name(buf)) - if ok and stats and stats.size > (1024 * 100 * 10) --[[1MB]] then - return true - end + if indent(ev.buf) then + vim.bo[ev.buf].indentexpr = "v:lua.require('nvim-treesitter').indentexpr()" end - } - } + end, + }) core.misc.map("n", "t", function() - pcall(vim.cmd.TSInstall, vim.api.nvim_get_option_value("ft", { - buf = vim.api.nvim_get_current_buf() - })) + treesitter.install { vim.bo[0].ft } end) end }, From ade2f0f5981a14147dfb3409da2d49d23b8d516e Mon Sep 17 00:00:00 2001 From: Squibid Date: Wed, 17 Dec 2025 22:20:40 -0500 Subject: [PATCH 2/6] good old treesitter master branch, see my treesitter-main branch for... why I'm not switching --- lua/conf/plugins/treesitter.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/conf/plugins/treesitter.lua b/lua/conf/plugins/treesitter.lua index fbe620c..30d31a5 100644 --- a/lua/conf/plugins/treesitter.lua +++ b/lua/conf/plugins/treesitter.lua @@ -2,6 +2,7 @@ local map = core.misc.map return { { "nvim-treesitter/nvim-treesitter", + branch = "master", config = function() vim.cmd("TSUpdate") end, From 47c0d051f6640fe09b813c03cf6222bad412aa72 Mon Sep 17 00:00:00 2001 From: Squibid Date: Thu, 18 Dec 2025 00:29:59 -0500 Subject: [PATCH 3/6] mason --- lua/conf/plugins/lsp.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/conf/plugins/lsp.lua b/lua/conf/plugins/lsp.lua index 128d1f1..24b110b 100644 --- a/lua/conf/plugins/lsp.lua +++ b/lua/conf/plugins/lsp.lua @@ -7,14 +7,15 @@ return { load = function() core.lsp.setup() require("mason-lspconfig").setup { - ensure_added = { + ensure_installed = { "clangd", "mesonlsp", "bashls", "jdtls", "lua_ls", "basedpyright", - "debugpy" + "zls", + "rnix" } } end From 550f5d060bf62a1eb3919418d104c6d97972e3c4 Mon Sep 17 00:00:00 2001 From: Squibid Date: Thu, 18 Dec 2025 00:33:12 -0500 Subject: [PATCH 4/6] this is the good nix lsp --- lua/conf/plugins/lsp.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/conf/plugins/lsp.lua b/lua/conf/plugins/lsp.lua index 24b110b..0d9f4c0 100644 --- a/lua/conf/plugins/lsp.lua +++ b/lua/conf/plugins/lsp.lua @@ -15,7 +15,7 @@ return { "lua_ls", "basedpyright", "zls", - "rnix" + "nil_ls" } } end From e83b9e5cfa76a37329b2472f9d07eded10b8265f Mon Sep 17 00:00:00 2001 From: Squibid Date: Mon, 12 Jan 2026 17:14:26 -0500 Subject: [PATCH 5/6] add markdown snippets --- lua/snippets/markdown.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 lua/snippets/markdown.lua diff --git a/lua/snippets/markdown.lua b/lua/snippets/markdown.lua new file mode 100644 index 0000000..77edb4a --- /dev/null +++ b/lua/snippets/markdown.lua @@ -0,0 +1,11 @@ +dofile(core.snippets) + +return { + s("[]", { + t("["), + i(1), + t("]("), + i(2), + t(")"), + }), +} From 4e73cc78aa04e34dca52f7f285aeebe6e0f6e639 Mon Sep 17 00:00:00 2001 From: Squibid Date: Sat, 17 Jan 2026 20:17:09 -0500 Subject: [PATCH 6/6] generate pdfs while typing in typst files --- after/lsp/tinymist.lua | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 after/lsp/tinymist.lua diff --git a/after/lsp/tinymist.lua b/after/lsp/tinymist.lua new file mode 100644 index 0000000..6220be5 --- /dev/null +++ b/after/lsp/tinymist.lua @@ -0,0 +1,5 @@ +return { + settings = { + exportPdf = "onType", + } +}