This commit is contained in:
Zelong Kuang
2025-10-22 14:20:19 +11:00
parent 8c11269da8
commit e4013c2193
11 changed files with 354 additions and 300 deletions

View File

@@ -101,5 +101,13 @@ return {
} }
), ),
{ condition = line_begin } { condition = line_begin }
) ),
s(
{ trig = "defop" },
fmta("#let <> = math.op(\"<>\")", {
i(1),
rep(1),
}),
{ condition = tex.in_mathzone }
),
} }

View File

@@ -72,9 +72,6 @@ return {
s({ trig = "get", wordTrig = false, snippetType = "autosnippet" }, { s({ trig = "get", wordTrig = false, snippetType = "autosnippet" }, {
t("gets"), t("gets"),
}, { condition = tex.in_mathzone }), }, { condition = tex.in_mathzone }),
s({ trig = "to", wordTrig = false, snippetType = "autosnippet" }, {
t("to"),
}, { condition = tex.in_mathzone }),
s({ trig = "mto", wordTrig = false, snippetType = "autosnippet", priority = 1001 }, { s({ trig = "mto", wordTrig = false, snippetType = "autosnippet", priority = 1001 }, {
t("mapsto"), t("mapsto"),
}, { condition = tex.in_mathzone }), }, { condition = tex.in_mathzone }),
@@ -123,17 +120,20 @@ return {
s({ trig = "subset=", wordTrig = false, snippetType = "autosnippet" }, { s({ trig = "subset=", wordTrig = false, snippetType = "autosnippet" }, {
t("subset.eq"), t("subset.eq"),
}, { condition = tex.in_mathzone }), }, { condition = tex.in_mathzone }),
s({ trig = "subset!=", wordTrig = false, snippetType = "autosnippet" }, {
t("subset.neq"),
}, { condition = tex.in_mathzone }),
s({ trig = "supp", wordTrig = false, snippetType = "autosnippet" }, { s({ trig = "supp", wordTrig = false, snippetType = "autosnippet" }, {
t("supset"), t("supset"),
}, { condition = tex.in_mathzone }), }, { condition = tex.in_mathzone }),
s({ trig = "supset=", wordTrig = false, snippetType = "autosnippet" }, { s({ trig = "supset=", wordTrig = false, snippetType = "autosnippet" }, {
t("supset.eq"), t("supset.eq"),
}, { condition = tex.in_mathzone }), }, { condition = tex.in_mathzone }),
s({ trig = "tp", wordTrig = false, snippetType = "autosnippet" }, { s({ trig = "supp", wordTrig = false, snippetType = "autosnippet" }, {
t("^top"), t("supset"),
}, { condition = tex.in_mathzone }), }, { condition = tex.in_mathzone }),
s({ trig = "dr", wordTrig = false, snippetType = "autosnippet" }, { s({ trig = "supset!=", wordTrig = false, snippetType = "autosnippet" }, {
t("^dagger"), t("supset.neq"),
}, { condition = tex.in_mathzone }), }, { condition = tex.in_mathzone }),
s({ trig = "perp", wordTrig = false, snippetType = "autosnippet" }, { s({ trig = "perp", wordTrig = false, snippetType = "autosnippet" }, {
t("perp"), t("perp"),
@@ -144,17 +144,8 @@ return {
s({ trig = "xx", wordTrig = false, snippetType = "autosnippet" }, { s({ trig = "xx", wordTrig = false, snippetType = "autosnippet" }, {
t("times"), t("times"),
}, { condition = tex.in_mathzone }), }, { condition = tex.in_mathzone }),
s({ trig = "llr", wordTrig = false, snippetType = "autosnippet" }, {
t("longleftrightarrow"),
}, { condition = tex.in_mathzone }),
s({ trig = "up", wordTrig = false, snippetType = "autosnippet" }, {
t("uparrow"),
}, { condition = tex.in_mathzone }),
s({ trig = "down", wordTrig = false, snippetType = "autosnippet" }, {
t("downarrow"),
}, { condition = tex.in_mathzone }),
s({ trig = "cir", wordTrig = false, snippetType = "autosnippet" }, { s({ trig = "cir", wordTrig = false, snippetType = "autosnippet" }, {
t("circ"), t("compose"),
}, { condition = tex.in_mathzone }), }, { condition = tex.in_mathzone }),
s({ trig = "iso", wordTrig = false, snippetType = "autosnippet" }, { s({ trig = "iso", wordTrig = false, snippetType = "autosnippet" }, {
t("cong"), t("cong"),

View File

@@ -0,0 +1,40 @@
local ls = require("luasnip")
local c = ls.choice_node
local s = ls.snippet
local t = ls.text_node
local i = ls.insert_node
local f = ls.function_node
local fmta = require("luasnip.extras.fmt").fmta
local tex = require("util.latex")
local rep = require("luasnip.extras").rep
local line_begin = require("luasnip.extras.expand_conditions").line_begin
return {
s(
{ trig = "assignment" },
fmta(
[[
#import "@preview/sleek-university-assignment:0.1.0": assignment
#import "@preview/theorion:0.4.0": *
#show: assignment.with(
title: "Assignment 3",
authors: (
(
name: "Zelong Kuang",
email: "zelongk@student.unimelb.edu.au",
student-no: "1610081",
),
),
course: "<>",
)
<>
]],
{
i(1),
i(0),
}
),
{ condition = tex.in_text * line_begin }
),
}

View File

@@ -1,69 +1,65 @@
{ {
"CopilotChat.nvim": { "branch": "main", "commit": "f68deee85b8d734db1a9fbf63ce17a8164921267" }, "CopilotChat.nvim": { "branch": "main", "commit": "4d9256418ca276b294f3e00445aa0d6faec4c1ea" },
"LazyVim": { "branch": "main", "commit": "dc1ffa5bcb66f46284f91a8593dda5c7c54a1824" }, "LazyVim": { "branch": "main", "commit": "a65d5d530d372b39a468dfbb2ce633f344770c5c" },
"LuaSnip": { "branch": "master", "commit": "113f831c4dc5b8c4e97454a7f89bb21746fe6484" }, "LuaSnip": { "branch": "master", "commit": "ccf25a5452b8697a823de3e5ecda63ed3d723b79" },
"SchemaStore.nvim": { "branch": "main", "commit": "667eaa5da8f66f1dd97c905a12dd1eb544a2d259" }, "SchemaStore.nvim": { "branch": "main", "commit": "960a5cf992c033170499ccc7003df59734ed40a8" },
"aerial.nvim": { "branch": "master", "commit": "5e687b5a14004fa2dd9eccbee042b96869fe1557" }, "aerial.nvim": { "branch": "master", "commit": "5e687b5a14004fa2dd9eccbee042b96869fe1557" },
"blink-copilot": { "branch": "main", "commit": "5d35fd07fcc148be20442da1bdd2407e03263d7d" }, "avante.nvim": { "branch": "main", "commit": "c155ce9ff495818da0127315f5c947686c6412b9" },
"blink-cmp-avante": { "branch": "master", "commit": "4f494c6e124acbe31a8f5d58effa0c14aa38a6d5" },
"blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" }, "blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" },
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
"catppuccin": { "branch": "main", "commit": "af58927c55c9f3272c940ff02b3cee94a1249f26" }, "catppuccin": { "branch": "main", "commit": "af58927c55c9f3272c940ff02b3cee94a1249f26" },
"chezmoi.nvim": { "branch": "main", "commit": "8b426285c2b0acb9b0dd46789193fa97f6480b99" }, "chezmoi.nvim": { "branch": "main", "commit": "8b426285c2b0acb9b0dd46789193fa97f6480b99" },
"chezmoi.vim": { "branch": "main", "commit": "ca5f2ed602046d5662cb76d845c4b510aae0ce84" }, "chezmoi.vim": { "branch": "main", "commit": "ca5f2ed602046d5662cb76d845c4b510aae0ce84" },
"cmake-tools.nvim": { "branch": "master", "commit": "88e07c6bff838a5bda2f461e9c1122b79ff0829f" }, "cmake-tools.nvim": { "branch": "master", "commit": "88e07c6bff838a5bda2f461e9c1122b79ff0829f" },
"code_runner.nvim": { "branch": "main", "commit": "a0aa4325ea2958ba21d77d181a838e74be6267cd" }, "code_runner.nvim": { "branch": "main", "commit": "45dfea066a6110abcbc3cd361457ac3cbaefd68b" },
"conform.nvim": { "branch": "master", "commit": "fbcb4fa7f34bfea9be702ffff481a8e336ebf6ed" }, "conform.nvim": { "branch": "master", "commit": "235dd79731c1dc51ec04abb4045cbc54727a172a" },
"copilot.lua": { "branch": "master", "commit": "92e08cd472653beaece28ad9c8508a851a613358" },
"cord.nvim": { "branch": "master", "commit": "1aadec47743e6cfe77ae6860a5b4305a465f03be" }, "cord.nvim": { "branch": "master", "commit": "1aadec47743e6cfe77ae6860a5b4305a465f03be" },
"crates.nvim": { "branch": "main", "commit": "ac9fa498a9edb96dc3056724ff69d5f40b898453" }, "crates.nvim": { "branch": "main", "commit": "ac9fa498a9edb96dc3056724ff69d5f40b898453" },
"dial.nvim": { "branch": "master", "commit": "f0404ec1f83a03f2c3457e60087c6331d1cbb83f" }, "dial.nvim": { "branch": "master", "commit": "f0404ec1f83a03f2c3457e60087c6331d1cbb83f" },
"flash.nvim": { "branch": "main", "commit": "2febce67ff9cf7638d2569d17c41af02c38401eb" }, "flash.nvim": { "branch": "main", "commit": "3be9bf7e85550045ec576379a0c45aac144d0438" },
"gitsigns.nvim": { "branch": "main", "commit": "1ee5c1fd068c81f9dd06483e639c2aa4587dc197" }, "gitsigns.nvim": { "branch": "main", "commit": "20ad4419564d6e22b189f6738116b38871082332" },
"grug-far.nvim": { "branch": "main", "commit": "3e72397465f774b01aa38e4fe8e6eecf23d766d9" }, "grug-far.nvim": { "branch": "main", "commit": "3e72397465f774b01aa38e4fe8e6eecf23d766d9" },
"haskell-snippets.nvim": { "branch": "master", "commit": "06be2f61d2970a90e8c4db16ab8cd450233db5c1" },
"haskell-tools.nvim": { "branch": "master", "commit": "65d6993eba1a56bbd5211ef13a100d26ce3e644a" },
"inc-rename.nvim": { "branch": "main", "commit": "7c79416330364976955ec8059fe3832b72ee1271" }, "inc-rename.nvim": { "branch": "main", "commit": "7c79416330364976955ec8059fe3832b72ee1271" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"lazydev.nvim": { "branch": "main", "commit": "e28ce52fc7ff79fcb76f0e79ee6fb6182fca90b9" }, "lazydev.nvim": { "branch": "main", "commit": "e28ce52fc7ff79fcb76f0e79ee6fb6182fca90b9" },
"lean.nvim": { "branch": "main", "commit": "a97dbacbd038962583efbf22cc6ef79f8e71a9fe" }, "lean.nvim": { "branch": "main", "commit": "17e1f63a6f2168f0ce5ec89d6480fd448b7854e3" },
"lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" }, "lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" },
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "6bdb14f230de0904229ec367b410fb817e59b072" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "2304ff65ecc8cb2afc2484de3e2ed9a407edf0b9" },
"mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" }, "mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
"mini.ai": { "branch": "main", "commit": "11c57180bc9084089206e211ac7aa598bedc9673" }, "mini.ai": { "branch": "main", "commit": "11c57180bc9084089206e211ac7aa598bedc9673" },
"mini.comment": { "branch": "main", "commit": "c40bc46e72f41d3db265f6d86deb3dc259c0985d" },
"mini.hipatterns": { "branch": "main", "commit": "5629d5fba132b4ab0b3f0039549308421f65ff45" }, "mini.hipatterns": { "branch": "main", "commit": "5629d5fba132b4ab0b3f0039549308421f65ff45" },
"mini.icons": { "branch": "main", "commit": "284798619aed9f4c1ac1b9417b9a5e3b4b85ef3a" }, "mini.icons": { "branch": "main", "commit": "284798619aed9f4c1ac1b9417b9a5e3b4b85ef3a" },
"mini.pairs": { "branch": "main", "commit": "b9aada8c0e59f2b938e98fbf4eae0799eba96ad9" }, "mini.pairs": { "branch": "main", "commit": "b9aada8c0e59f2b938e98fbf4eae0799eba96ad9" },
"mini.surround": { "branch": "main", "commit": "444e155147e2b5159dd28a65f9736254c16cb817" }, "mini.surround": { "branch": "main", "commit": "444e155147e2b5159dd28a65f9736254c16cb817" },
"neotab.nvim": { "branch": "master", "commit": "e99d3e28c5a2066d2d368dfe4ef3827c8d75d337" }, "neotab.nvim": { "branch": "master", "commit": "e99d3e28c5a2066d2d368dfe4ef3827c8d75d337" },
"neotest": { "branch": "master", "commit": "7166dc36af2760a76479e021e0521e23f62165f1" }, "neotest": { "branch": "master", "commit": "7166dc36af2760a76479e021e0521e23f62165f1" },
"neotest-haskell": { "branch": "master", "commit": "5266c115617186f17708344451f46ec88f3d1f6b" }, "neotest-pest": { "branch": "main", "commit": "1429445746f28a4ce887289ea6e442430629e306" },
"neotest-phpunit": { "branch": "main", "commit": "eb2f3d1e1b07cfaa59d4da9edde0cef1c84e4958" },
"neotest-python": { "branch": "master", "commit": "b0d3a861bd85689d8ed73f0590c47963a7eb1bf9" }, "neotest-python": { "branch": "master", "commit": "b0d3a861bd85689d8ed73f0590c47963a7eb1bf9" },
"noice.nvim": { "branch": "main", "commit": "38c702be0d8fea81527ee6a73e1e834e72481193" }, "noice.nvim": { "branch": "main", "commit": "c86aea584d98be7ee1167ce4d4ef946fbd7f3ae0" },
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
"nvim-dap": { "branch": "master", "commit": "6782b097af2417a4c3e33849b0a26ae2188bd7ea" },
"nvim-dap-python": { "branch": "master", "commit": "64652d1ae1db80870d9aac7132d76e37acd86a26" },
"nvim-lint": { "branch": "master", "commit": "9da1fb942dd0668d5182f9c8dee801b9c190e2bb" }, "nvim-lint": { "branch": "master", "commit": "9da1fb942dd0668d5182f9c8dee801b9c190e2bb" },
"nvim-lspconfig": { "branch": "master", "commit": "ac98db2f9f06a56498ec890a96928774eae412c3" }, "nvim-lspconfig": { "branch": "master", "commit": "e5c61b02f33b5c6538be25b2696b33b4cc91e667" },
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
"nvim-treesitter": { "branch": "main", "commit": "63fac0a576bc78a4790cbcce24646cca860bc8c1" }, "nvim-treesitter": { "branch": "main", "commit": "30c466ad571b8b99fd06e3df8b2336e3ae63a53a" },
"nvim-treesitter-textobjects": { "branch": "main", "commit": "1b2d85d3de6114c4bcea89ffb2cd1ce9e3a19931" }, "nvim-treesitter-textobjects": { "branch": "main", "commit": "1b2d85d3de6114c4bcea89ffb2cd1ce9e3a19931" },
"nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" }, "nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" },
"nvim-web-devicons": { "branch": "master", "commit": "b8221e42cf7287c4dcde81f232f58d7b947c210d" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" },
"persistence.nvim": { "branch": "main", "commit": "51eef57272742b773468949f6bd0503ec3f83874" }, "persistence.nvim": { "branch": "main", "commit": "51eef57272742b773468949f6bd0503ec3f83874" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"render-markdown.nvim": { "branch": "main", "commit": "475d3ad8cae486b0df6fc6050cf5b5ea1de42db8" }, "render-markdown.nvim": { "branch": "main", "commit": "475d3ad8cae486b0df6fc6050cf5b5ea1de42db8" },
"rustaceanvim": { "branch": "master", "commit": "2f5afad4fc62c609dfd2ef4613999a0e8bddcccc" }, "rustaceanvim": { "branch": "master", "commit": "4c5fc771694ab09ec618ea2baabaf34420d86edb" },
"sidekick.nvim": { "branch": "main", "commit": "4a492da6e863d06b15e887be97dd43c50b76f11d" }, "snacks.nvim": { "branch": "main", "commit": "d293b21fe1a603dfb4757feb82ab3e67b78589f2" },
"snacks.nvim": { "branch": "main", "commit": "454ba02d69347c0735044f159b95d2495fc79a73" },
"telescope_hoogle": { "branch": "master", "commit": "14be34fd5c464e3da0992ad094f157b0b8b098f9" },
"texpresso.vim": { "branch": "main", "commit": "d543df30b61ea886cb726a18c1d1d28ea36d30cc" }, "texpresso.vim": { "branch": "main", "commit": "d543df30b61ea886cb726a18c1d1d28ea36d30cc" },
"todo-comments.nvim": { "branch": "main", "commit": "19d461ddd543e938eb22505fb03fa878800270b6" }, "todo-comments.nvim": { "branch": "main", "commit": "19d461ddd543e938eb22505fb03fa878800270b6" },
"tokyonight.nvim": { "branch": "main", "commit": "d14614cbfc63b6037bfccd48bb982d2ad2003352" }, "tokyonight.nvim": { "branch": "main", "commit": "e63c42a42b11cd6225f009dd949b9ee0fccc15ef" },
"trouble.nvim": { "branch": "main", "commit": "c098362fe603d3922095e7db595961e020bdf2d0" }, "trouble.nvim": { "branch": "main", "commit": "c098362fe603d3922095e7db595961e020bdf2d0" },
"ts-comments.nvim": { "branch": "main", "commit": "217ab9cc137fceb6659b53790bd25e608219abe1" }, "ts-comments.nvim": { "branch": "main", "commit": "217ab9cc137fceb6659b53790bd25e608219abe1" },
"typst-preview.nvim": { "branch": "master", "commit": "dea4525d5420b7c32eebda7de15a6beb9d6574fa" }, "typst-preview.nvim": { "branch": "master", "commit": "1603d37bb44ed2efa0b4378d1dfedc087b4f2141" },
"venv-selector.nvim": { "branch": "main", "commit": "7fff64b5b1455207b9a9fd2ae8697cf9ac0b2a2d" }, "venv-selector.nvim": { "branch": "main", "commit": "9d528643ab17795c69dc42ce018120c397a36f8b" },
"vim-dadbod": { "branch": "master", "commit": "e95afed23712f969f83b4857a24cf9d59114c2e6" }, "vim-dadbod": { "branch": "master", "commit": "e95afed23712f969f83b4857a24cf9d59114c2e6" },
"vim-dadbod-completion": { "branch": "master", "commit": "a8dac0b3cf6132c80dc9b18bef36d4cf7a9e1fe6" }, "vim-dadbod-completion": { "branch": "master", "commit": "a8dac0b3cf6132c80dc9b18bef36d4cf7a9e1fe6" },
"vim-dadbod-ui": { "branch": "master", "commit": "5a83ee1fdafcdedb03222bb46f7cfd70646025ee" }, "vim-dadbod-ui": { "branch": "master", "commit": "5a83ee1fdafcdedb03222bb46f7cfd70646025ee" },
@@ -71,5 +67,5 @@
"vimtex": { "branch": "master", "commit": "be9deac3a23eeb145ccf11dd09080795838496ce" }, "vimtex": { "branch": "master", "commit": "be9deac3a23eeb145ccf11dd09080795838496ce" },
"which-key.nvim": { "branch": "main", "commit": "b4177e3eaf15fe5eb8357ebac2286d488be1ed00" }, "which-key.nvim": { "branch": "main", "commit": "b4177e3eaf15fe5eb8357ebac2286d488be1ed00" },
"yanky.nvim": { "branch": "main", "commit": "04775cc6e10ef038c397c407bc17f00a2f52b378" }, "yanky.nvim": { "branch": "main", "commit": "04775cc6e10ef038c397c407bc17f00a2f52b378" },
"yazi.nvim": { "branch": "main", "commit": "0f202fe5a92b332f996f5d4ee1e5d36b956aafc4" } "yazi.nvim": { "branch": "main", "commit": "14da37bf21964a38a1d50b66daed28b15017b37a" }
} }

View File

@@ -1,10 +1,10 @@
{ {
"extras": [ "extras": [
"lazyvim.plugins.extras.ai.copilot", "lazyvim.plugins.extras.ai.avante",
"lazyvim.plugins.extras.ai.copilot-chat", "lazyvim.plugins.extras.ai.copilot-native",
"lazyvim.plugins.extras.ai.sidekick",
"lazyvim.plugins.extras.coding.blink", "lazyvim.plugins.extras.coding.blink",
"lazyvim.plugins.extras.coding.luasnip", "lazyvim.plugins.extras.coding.luasnip",
"lazyvim.plugins.extras.coding.mini-comment",
"lazyvim.plugins.extras.coding.mini-surround", "lazyvim.plugins.extras.coding.mini-surround",
"lazyvim.plugins.extras.coding.yanky", "lazyvim.plugins.extras.coding.yanky",
"lazyvim.plugins.extras.editor.aerial", "lazyvim.plugins.extras.editor.aerial",
@@ -13,7 +13,6 @@
"lazyvim.plugins.extras.editor.snacks_picker", "lazyvim.plugins.extras.editor.snacks_picker",
"lazyvim.plugins.extras.lang.cmake", "lazyvim.plugins.extras.lang.cmake",
"lazyvim.plugins.extras.lang.docker", "lazyvim.plugins.extras.lang.docker",
"lazyvim.plugins.extras.lang.haskell",
"lazyvim.plugins.extras.lang.json", "lazyvim.plugins.extras.lang.json",
"lazyvim.plugins.extras.lang.lean", "lazyvim.plugins.extras.lang.lean",
"lazyvim.plugins.extras.lang.markdown", "lazyvim.plugins.extras.lang.markdown",

View File

@@ -2,12 +2,12 @@ return {
"stevearc/conform.nvim", "stevearc/conform.nvim",
opts = { opts = {
formatters_by_ft = { formatters_by_ft = {
["json"] = { "prettierd" }, ["json"] = { "jq" },
["jsonc"] = { "jq" }, ["jsonc"] = { "jq" },
["tex"] = { "latexindent" }, ["tex"] = { "latexindent" },
["toml"] = { "taplo "}, ["toml"] = { "taplo" },
["markdown"] = { 'prettierd', "cbfmt" }, ["markdown"] = { "prettierd", "cbfmt" },
["sh"] = { 'shfmt' }, ["sh"] = { "shfmt" },
} }
} }
} }

View File

@@ -5,27 +5,27 @@ return {
model = "gemini-2.5-pro", model = "gemini-2.5-pro",
}, },
}, },
{ -- {
"zbirenbaum/copilot.lua", -- "zbirenbaum/copilot.lua",
keys = { -- keys = {
{ -- {
-- Open in the current working directory -- -- Open in the current working directory
"<leader>ad", -- "<leader>ad",
"<cmd>Copilot detach<cr>", -- "<cmd>Copilot detach<cr>",
desc = "Copilot detach", -- desc = "Copilot detach",
}, -- },
{ -- {
-- Open in the current working directory -- -- Open in the current working directory
"<leader>at", -- "<leader>at",
"<cmd>Copilot toggle<cr>", -- "<cmd>Copilot toggle<cr>",
desc = "Copilot toggle", -- desc = "Copilot toggle",
}, -- },
}, -- },
opts = { -- opts = {
copilot_model = "gemini-2.5-pro", -- copilot_model = "gemini-2.5-pro",
keymap = { -- keymap = {
accept = "<C-l>", -- accept = "<C-l>",
}, -- },
}, -- },
}, -- },
} }

View File

@@ -1,224 +1,224 @@
-- Now don't forget to initialize lualine -- Now don't forget to initialize lualine
return { return {
{ -- {
"nvim-lualine/lualine.nvim", -- "nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" }, -- dependencies = { "nvim-tree/nvim-web-devicons" },
config = function() -- config = function()
local lualine = require("lualine") -- local lualine = require("lualine")
local colors = { -- local colors = {
bg = "#202328", -- bg = "#202328",
fg = "#bbc2cf", -- fg = "#bbc2cf",
yellow = "#ECBE7B", -- yellow = "#ECBE7B",
cyan = "#008080", -- cyan = "#008080",
darkblue = "#081633", -- darkblue = "#081633",
green = "#98be65", -- green = "#98be65",
orange = "#FF8800", -- orange = "#FF8800",
violet = "#a9a1e1", -- violet = "#a9a1e1",
magenta = "#c678dd", -- magenta = "#c678dd",
blue = "#51afef", -- blue = "#51afef",
red = "#ec5f67", -- red = "#ec5f67",
} -- }
--
local conditions = { -- local conditions = {
buffer_not_empty = function() -- buffer_not_empty = function()
return vim.fn.empty(vim.fn.expand("%:t")) ~= 1 -- return vim.fn.empty(vim.fn.expand("%:t")) ~= 1
end, -- end,
hide_in_width = function() -- hide_in_width = function()
return vim.fn.winwidth(0) > 80 -- return vim.fn.winwidth(0) > 80
end, -- end,
check_git_workspace = function() -- check_git_workspace = function()
local filepath = vim.fn.expand("%:p:h") -- local filepath = vim.fn.expand("%:p:h")
local gitdir = vim.fn.finddir(".git", filepath .. ";") -- local gitdir = vim.fn.finddir(".git", filepath .. ";")
return gitdir and #gitdir > 0 and #gitdir < #filepath -- return gitdir and #gitdir > 0 and #gitdir < #filepath
end, -- end,
} -- }
--
-- Config -- -- Config
local config = { -- local config = {
options = { -- options = {
-- Disable sections and component separators -- -- Disable sections and component separators
component_separators = "", -- component_separators = "",
section_separators = "", -- section_separators = "",
theme = 'auto' -- theme = 'auto'
-- theme = { -- -- theme = {
-- -- We are going to use lualine_c an lualine_x as left and -- -- -- We are going to use lualine_c an lualine_x as left and
-- -- right section. Both are highlighted by c theme . So we -- -- -- right section. Both are highlighted by c theme . So we
-- -- are just setting default looks o statusline -- -- -- are just setting default looks o statusline
-- normal = { c = { fg = colors.fg, bg = colors.bg } }, -- -- normal = { c = { fg = colors.fg, bg = colors.bg } },
-- inactive = { c = { fg = colors.fg, bg = colors.bg } }, -- -- inactive = { c = { fg = colors.fg, bg = colors.bg } },
-- }, -- -- },
}, -- },
sections = { -- sections = {
-- these are to remove the defaults -- -- these are to remove the defaults
lualine_a = {}, -- lualine_a = {},
lualine_b = {}, -- lualine_b = {},
lualine_y = {}, -- lualine_y = {},
lualine_z = {}, -- lualine_z = {},
-- These will be filled later -- -- These will be filled later
lualine_c = {}, -- lualine_c = {},
lualine_x = {}, -- lualine_x = {},
}, -- },
inactive_sections = { -- inactive_sections = {
-- these are to remove the defaults -- -- these are to remove the defaults
lualine_a = {}, -- lualine_a = {},
lualine_b = {}, -- lualine_b = {},
lualine_y = {}, -- lualine_y = {},
lualine_z = {}, -- lualine_z = {},
lualine_c = {}, -- lualine_c = {},
lualine_x = {}, -- lualine_x = {},
}, -- },
} -- }
--
-- Inserts a component in lualine_c at left section -- -- Inserts a component in lualine_c at left section
local function ins_left(component) -- local function ins_left(component)
table.insert(config.sections.lualine_c, component) -- table.insert(config.sections.lualine_c, component)
end -- end
--
-- Inserts a component in lualine_x at right section -- -- Inserts a component in lualine_x at right section
local function ins_right(component) -- local function ins_right(component)
table.insert(config.sections.lualine_x, component) -- table.insert(config.sections.lualine_x, component)
end -- end
--
ins_left({ -- ins_left({
function() -- function()
return "" -- return "▊"
end, -- end,
color = { fg = colors.blue }, -- Sets highlighting of component -- color = { fg = colors.blue }, -- Sets highlighting of component
padding = { left = 0, right = 1 }, -- We don't need space before this -- padding = { left = 0, right = 1 }, -- We don't need space before this
}) -- })
--
ins_left({ -- ins_left({
-- mode component -- -- mode component
function() -- function()
return "" -- return ""
end, -- end,
color = function() -- color = function()
-- auto change color according to neovims mode -- -- auto change color according to neovims mode
local mode_color = { -- local mode_color = {
n = colors.red, -- n = colors.red,
i = colors.green, -- i = colors.green,
v = colors.blue, -- v = colors.blue,
[""] = colors.blue, -- [""] = colors.blue,
V = colors.blue, -- V = colors.blue,
c = colors.magenta, -- c = colors.magenta,
no = colors.red, -- no = colors.red,
s = colors.orange, -- s = colors.orange,
S = colors.orange, -- S = colors.orange,
[""] = colors.orange, -- [""] = colors.orange,
ic = colors.yellow, -- ic = colors.yellow,
R = colors.violet, -- R = colors.violet,
Rv = colors.violet, -- Rv = colors.violet,
cv = colors.red, -- cv = colors.red,
ce = colors.red, -- ce = colors.red,
r = colors.cyan, -- r = colors.cyan,
rm = colors.cyan, -- rm = colors.cyan,
["r?"] = colors.cyan, -- ["r?"] = colors.cyan,
["!"] = colors.red, -- ["!"] = colors.red,
t = colors.red, -- t = colors.red,
} -- }
return { fg = mode_color[vim.fn.mode()] } -- return { fg = mode_color[vim.fn.mode()] }
end, -- end,
padding = { right = 1 }, -- padding = { right = 1 },
}) -- })
--
ins_left({ -- ins_left({
-- filesize component -- -- filesize component
"filesize", -- "filesize",
cond = conditions.buffer_not_empty, -- cond = conditions.buffer_not_empty,
}) -- })
--
ins_left({ -- ins_left({
"filename", -- "filename",
cond = conditions.buffer_not_empty, -- cond = conditions.buffer_not_empty,
color = { fg = colors.magenta, gui = "bold" }, -- color = { fg = colors.magenta, gui = "bold" },
}) -- })
--
ins_left({ "location" }) -- ins_left({ "location" })
--
ins_left({ "progress", color = { fg = colors.fg, gui = "bold" } }) -- ins_left({ "progress", color = { fg = colors.fg, gui = "bold" } })
--
ins_left({ -- ins_left({
"diagnostics", -- "diagnostics",
sources = { "nvim_diagnostic" }, -- sources = { "nvim_diagnostic" },
symbols = { error = "", warn = "", info = "" }, -- symbols = { error = " ", warn = " ", info = " " },
diagnostics_color = { -- diagnostics_color = {
error = { fg = colors.red }, -- error = { fg = colors.red },
warn = { fg = colors.yellow }, -- warn = { fg = colors.yellow },
info = { fg = colors.cyan }, -- info = { fg = colors.cyan },
}, -- },
}) -- })
--
-- Insert mid section. You can make any number of sections in neovim :) -- -- Insert mid section. You can make any number of sections in neovim :)
-- for lualine it's any number greater then 2 -- -- for lualine it's any number greater then 2
ins_left({ -- ins_left({
function() -- function()
return "%=" -- return "%="
end, -- end,
}) -- })
--
ins_left({ -- ins_left({
-- Lsp server name . -- -- Lsp server name .
function() -- function()
local msg = "No Active Lsp" -- local msg = "No Active Lsp"
local buf_ft = vim.api.nvim_get_option_value("filetype", { buf = 0 }) -- local buf_ft = vim.api.nvim_get_option_value("filetype", { buf = 0 })
local clients = vim.lsp.get_clients() -- local clients = vim.lsp.get_clients()
if next(clients) == nil then -- if next(clients) == nil then
return msg -- return msg
end -- end
for _, client in ipairs(clients) do -- for _, client in ipairs(clients) do
local filetypes = client.config.filetypes -- local filetypes = client.config.filetypes
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then -- if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
return client.name -- return client.name
end -- end
end -- end
return msg -- return msg
end, -- end,
icon = " LSP:", -- icon = " LSP:",
color = { fg = "#ffffff", gui = "bold" }, -- color = { fg = "#ffffff", gui = "bold" },
}) -- })
--
-- Add components to right sections -- -- Add components to right sections
ins_right({ -- ins_right({
"o:encoding", -- option component same as &encoding in viml -- "o:encoding", -- option component same as &encoding in viml
fmt = string.upper, -- I'm not sure why it's upper case either ;) -- fmt = string.upper, -- I'm not sure why it's upper case either ;)
cond = conditions.hide_in_width, -- cond = conditions.hide_in_width,
color = { fg = colors.green, gui = "bold" }, -- color = { fg = colors.green, gui = "bold" },
}) -- })
--
-- ins_right({ -- -- ins_right({
-- "fileformat", -- -- "fileformat",
-- fmt = string.upper, -- -- fmt = string.upper,
-- icons_enabled = false, -- I think icons are cool but Eviline doesn't have them. sigh -- -- icons_enabled = false, -- I think icons are cool but Eviline doesn't have them. sigh
-- color = { fg = colors.green, gui = "bold" }, -- -- color = { fg = colors.green, gui = "bold" },
-- }) -- -- })
--
ins_right({ -- ins_right({
"branch", -- "branch",
icon = "", -- icon = "",
color = { fg = colors.violet, gui = "bold" }, -- color = { fg = colors.violet, gui = "bold" },
}) -- })
--
ins_right({ -- ins_right({
"diff", -- "diff",
-- Is it me or the symbol for modified us really weird -- -- Is it me or the symbol for modified us really weird
symbols = { added = "", modified = "󰝤 ", removed = "" }, -- symbols = { added = " ", modified = "󰝤 ", removed = " " },
diff_color = { -- diff_color = {
added = { fg = colors.green }, -- added = { fg = colors.green },
modified = { fg = colors.orange }, -- modified = { fg = colors.orange },
removed = { fg = colors.red }, -- removed = { fg = colors.red },
}, -- },
cond = conditions.hide_in_width, -- cond = conditions.hide_in_width,
}) -- })
--
ins_right({ -- ins_right({
function() -- function()
return "" -- return "▊"
end, -- end,
color = { fg = colors.blue }, -- color = { fg = colors.blue },
padding = { left = 1 }, -- padding = { left = 1 },
}) -- })
--
lualine.setup(config) -- lualine.setup(config)
end, -- end,
}, -- },
} }

View File

@@ -0,0 +1,19 @@
return {
{
"nvim-mini/mini.pairs",
event = "VeryLazy",
opts = {
modes = { insert = true, command = true, terminal = false },
-- skip autopair when next character is one of these
-- skip_next = [=[[%w%%%'%[%"%.%`%$]]=],
skip_next = false,
-- skip autopair when the cursor is inside these treesitter nodes
skip_ts = { "string" },
-- skip autopair when next character is closing pair
-- and there are more closing pairs than opening pairs
skip_unbalanced = true,
-- better deal with markdown code blocks
markdown = true,
},
}
}

View File

@@ -1,6 +1,7 @@
return { return {
{ {
"folke/snacks.nvim", "folke/snacks.nvim",
---@type snacks.Config
opts = { opts = {
-- image = {}, -- image = {},
indent = { indent = {

View File

@@ -8,7 +8,7 @@ return {
dependencies_bin = { dependencies_bin = {
["tinymist"] = "tinymist", ["tinymist"] = "tinymist",
}, },
invert_colors = 'always', -- invert_colors = 'always',
-- open_cmd = "brave %s --class typst-preview", -- open_cmd = "brave %s --class typst-preview",
}, },
keys = { keys = {