From f095d0cbf59eab294dcfded9f6814a2a8841b488 Mon Sep 17 00:00:00 2001 From: Squibid Date: Wed, 17 Dec 2025 22:15:45 -0500 Subject: [PATCH 01/10] 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 02/10] 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 03/10] 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 04/10] 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 05/10] 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 06/10] 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", + } +} From e41b9980231303f6500d4616edfe836589d7d873 Mon Sep 17 00:00:00 2001 From: Squibid Date: Sat, 14 Feb 2026 10:12:43 -0500 Subject: [PATCH 07/10] typst --- after/ftplugin/typst.lua | 1 + lua/snippets/typst.lua | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 after/ftplugin/typst.lua create mode 100644 lua/snippets/typst.lua diff --git a/after/ftplugin/typst.lua b/after/ftplugin/typst.lua new file mode 100644 index 0000000..c642643 --- /dev/null +++ b/after/ftplugin/typst.lua @@ -0,0 +1 @@ +vim.cmd.setlocal("textwidth=80") diff --git a/lua/snippets/typst.lua b/lua/snippets/typst.lua new file mode 100644 index 0000000..6caa357 --- /dev/null +++ b/lua/snippets/typst.lua @@ -0,0 +1,9 @@ +dofile(core.snippets) + +return { + s("title", { + t("#set document(title: ["), + i(1, "theTitle"), + t({ "])", "#title()" }), + }) +} From 3ab3819befb551d8ae902d4d3ca010d9151fb885 Mon Sep 17 00:00:00 2001 From: Squibid Date: Sat, 14 Feb 2026 16:53:53 -0500 Subject: [PATCH 08/10] no more latex, typst is my new best friend --- lua/conf/plugins/vimtex.lua | 5 --- lua/snippets/tex.lua | 69 ------------------------------------- 2 files changed, 74 deletions(-) delete mode 100644 lua/conf/plugins/vimtex.lua delete mode 100644 lua/snippets/tex.lua diff --git a/lua/conf/plugins/vimtex.lua b/lua/conf/plugins/vimtex.lua deleted file mode 100644 index 660efda..0000000 --- a/lua/conf/plugins/vimtex.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { "lervag/vimtex", - setup = function() - vim.g.vimtex_view_method = "zathura" - end -} diff --git a/lua/snippets/tex.lua b/lua/snippets/tex.lua deleted file mode 100644 index 30999ea..0000000 --- a/lua/snippets/tex.lua +++ /dev/null @@ -1,69 +0,0 @@ -dofile(core.snippets) - -return { - -- document snippet - s("doc", - fmta( - [[ - \documentclass{article} - \title{<>} - \author{<>} - \begin{document} - \maketitle - <> - \end{document} - ]], - { - c(1, { - sn(nil, { f(file_name, {}), i(1) }), - i(1, "my title") - }), - i(2, "my name"), - i(0) - } - ) - ), - - s({ trig = ";begin", snippetType = "autosnippet" }, - fmta( - [[ - \begin{<>} - <> - \end{<>} - ]], - { - i(1), - i(0), - rep(1) - } - ) - ), - - s({ trig = ";href", snippetType = "autosnippet" }, - fmta( - [[\href{<>}{<>}]], - { - i(1, "url"), - i(2, "display name"), - } - ) - ), - - postfix(".b", { - f(function(_, parent) - return [[\textbf{]]..parent.snippet.env.POSTFIX_MATCH.."}" - end) - }), - - postfix(".i", { - f(function(_, parent) - return [[\textit{]]..parent.snippet.env.POSTFIX_MATCH.."}" - end) - }), - - postfix(".ul", { - f(function(_, parent) - return [[\underline{]]..parent.snippet.env.POSTFIX_MATCH.."}" - end) - }) -} From efe9241d509f5ddcf2a5f14463092097017079e3 Mon Sep 17 00:00:00 2001 From: Squibid Date: Sat, 14 Feb 2026 18:39:58 -0500 Subject: [PATCH 09/10] zls's default settings are actually good --- after/lsp/zls.lua | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 after/lsp/zls.lua diff --git a/after/lsp/zls.lua b/after/lsp/zls.lua deleted file mode 100644 index 9dc490e..0000000 --- a/after/lsp/zls.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - settings = { - zls = { - enable_build_on_save = true - } - } -} From c48196d1161fcd02ece5f69f9906d4af8b9ed729 Mon Sep 17 00:00:00 2001 From: Squibid Date: Sun, 15 Feb 2026 17:38:56 -0500 Subject: [PATCH 10/10] add init and deinit snippets for zig --- lua/snippets/zig.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lua/snippets/zig.lua b/lua/snippets/zig.lua index c0bc681..d7e244f 100644 --- a/lua/snippets/zig.lua +++ b/lua/snippets/zig.lua @@ -7,4 +7,18 @@ return { f(file_name, {}), t(" = @This();"), }), + + s("init", { + t("pub fn init() !*"), + f(file_name, {}), + t({ " {", "\tconst self = try gpa.create(" }), + f(file_name, {}), + t({ ");", "\tself.* = .{};", "\treturn self;", "}" }), + }), + + s("deinit", { + t("pub fn deinit(self: *"), + f(file_name, {}), + t({ ") void {", "\tgpa.destroy(self);", "}" }), + }), }