├── .gitignore ├── .neoconf.json ├── LICENSE ├── LuaSnip ├── all.lua ├── lua.lua ├── markdown │ ├── math.lua │ └── text.lua └── tex │ ├── completion.lua │ ├── derivative.lua │ ├── env.lua │ ├── font.lua │ ├── greek-letter.lua │ ├── math-commands.lua │ ├── matrix.lua │ ├── physics.lua │ ├── physics2.lua │ ├── py.lua │ ├── quantikz.lua │ ├── symbol-short.lua │ ├── temporary.lua │ ├── text.lua │ └── tikz.lua ├── README.md ├── after └── ftplugin │ └── tex.lua ├── init.lua ├── lazy-lock.json ├── lua ├── config │ ├── autocmds.lua │ ├── keymaps.lua │ ├── lazy.lua │ └── options.lua ├── plugins │ ├── code-runner.lua │ ├── default │ │ ├── alpha.lua │ │ ├── cmp.lua │ │ ├── default.lua │ │ ├── lspconfig.lua │ │ ├── luasnip.lua │ │ ├── neo-tree.lua │ │ ├── tree-sitter.lua │ │ └── which-key.lua │ ├── dial.lua │ ├── disabled.lua │ ├── jukit.lua │ ├── kitty.lua │ ├── neoclip.lua │ ├── playground.lua │ ├── tabout.lua │ ├── twilight.lua │ ├── ui │ │ ├── colorscheme.lua │ │ └── transparent.lua │ ├── write │ │ ├── clipboard-image.lua │ │ ├── femaco.lua │ │ ├── knap.lua │ │ ├── latex-conceal.lua │ │ ├── latex.lua │ │ ├── leetcode.lua │ │ ├── peek.lua │ │ └── texlabconfig.lua │ └── zen-mode.lua └── util │ ├── init.lua │ └── latex.lua ├── queries └── latex │ └── highlights.scm ├── spell ├── en.utf-8.add ├── en.utf-8.add.spl ├── nl.utf-8.add └── nl.utf-8.add.spl └── stylua.toml /.gitignore: -------------------------------------------------------------------------------- 1 | /~ 2 | /spell 3 | -------------------------------------------------------------------------------- /.neoconf.json: -------------------------------------------------------------------------------- 1 | { 2 | "neodev": { 3 | "library": { 4 | "enabled": true, 5 | "plugins": true 6 | } 7 | }, 8 | "neoconf": { 9 | "plugins": { 10 | "sumneko_lua": { 11 | "enabled": true 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /LuaSnip/all.lua: -------------------------------------------------------------------------------- 1 | local ls = require("luasnip") 2 | local s = ls.snippet 3 | local sn = ls.snippet_node 4 | local t = ls.text_node 5 | local i = ls.insert_node 6 | local f = ls.function_node 7 | local d = ls.dynamic_node 8 | local c = ls.choice_node 9 | local fmt = require("luasnip.extras.fmt").fmt 10 | local fmta = require("luasnip.extras.fmt").fmta 11 | local rep = require("luasnip.extras").rep 12 | return { 13 | s( 14 | "date", 15 | f(function() 16 | return os.date("%D - %H:%M") 17 | end) 18 | ), 19 | s("choicenode", c(1, { t("choice 1"), t("choice 2"), t("choice 3") })), 20 | } 21 | -------------------------------------------------------------------------------- /LuaSnip/lua.lua: -------------------------------------------------------------------------------- 1 | local ls = require("luasnip") 2 | local s = ls.snippet 3 | local sn = ls.snippet_node 4 | local t = ls.text_node 5 | local i = ls.insert_node 6 | local f = ls.function_node 7 | local c = ls.choice_node 8 | local d = ls.dynamic_node 9 | local extras = require("luasnip.extras") 10 | local l = extras.lambda 11 | local fmt = require("luasnip.extras.fmt").fmt 12 | local fmta = require("luasnip.extras.fmt").fmta 13 | local rep = require("luasnip.extras").rep 14 | local line_begin = require("luasnip.extras.expand_conditions").line_begin 15 | 16 | return { 17 | s( 18 | "localreq", 19 | fmt('local {} = require("{}")', { 20 | l(l._1:match("[^.]*$"):gsub("[^%a]+", "_"), 1), 21 | i(1, "module"), 22 | }) 23 | ), 24 | s( 25 | { trig = "add", snippetType = "autosnippet" }, 26 | fmta('["<>"] = "<>",', { 27 | i(1), 28 | i(2), 29 | }) 30 | ), 31 | ls.parser.parse_snippet("lm", "local M = {}\n\n$1 \n\nreturn M"), 32 | s( 33 | { trig = "optsnip", snippetType = "autosnippet" }, 34 | fmta( 35 | [[ 36 | s( 37 | { trig = "<>", snippetType = "autosnippet" }, 38 | c(1, { sn(nil, { t("\\<>{"), i(1), t("}") }), sn(nil, { t("\\<>["), i(1), t("]{"), i(2), t("}") }) }), 39 | { condition = tex.<> } 40 | ), 41 | ]], 42 | { i(1), rep(1), rep(1), c(2, { t("in_quantikz"), t("in_mathzone") }) } 43 | ), 44 | { condition = line_begin } 45 | ), 46 | s( 47 | { trig = "starsnip", snippetType = "autosnippet" }, 48 | fmta( 49 | [[ 50 | s( 51 | { trig = "<>", snippetType = "autosnippet" }, 52 | c(1, { sn(nil, { t("\\<>{"), i(1), t("}") }), sn(nil, { t("\\<>*{"), i(1), t("}") }) }), 53 | { condition = tex.<> } 54 | ), 55 | ]], 56 | { i(1), rep(1), rep(1), c(2, { t("in_quantikz"), t("in_mathzone") }) } 57 | ), 58 | { condition = line_begin } 59 | ), 60 | s( 61 | { trig = "fmtasnip", snippetType = "autosnippet" }, 62 | fmta( 63 | [[ 64 | s({ trig = "<>", snippetType = "autosnippet" }, 65 | fmta("\\<>{<<>>}", { 66 | <> 67 | }), 68 | { condition = tex.<> }), 69 | ]], 70 | { i(1), rep(1), i(2, "i(0),"), c(3, { t("in_mathzone"), t("in_quantikz") }) } 71 | ), 72 | { condition = line_begin } 73 | ), 74 | s( 75 | { trig = "tsnip", snippetType = "autosnippet" }, 76 | fmta( 77 | [[ 78 | s({ trig = "<>", snippetType = "autosnippet" }, { 79 | t("\\<>"), 80 | }, { condition = tex.<> }), 81 | ]], 82 | { i(1), rep(1), c(2, { t("in_mathzone"), t("in_quantikz") }) } 83 | ), 84 | { condition = line_begin } 85 | ), 86 | } 87 | -------------------------------------------------------------------------------- /LuaSnip/markdown/math.lua: -------------------------------------------------------------------------------- 1 | local ls = require("luasnip") 2 | local s = ls.snippet 3 | local sn = ls.snippet_node 4 | local t = ls.text_node 5 | local i = ls.insert_node 6 | local f = ls.function_node 7 | local d = ls.dynamic_node 8 | local c = ls.choice_node 9 | local fmt = require("luasnip.extras.fmt").fmt 10 | local fmta = require("luasnip.extras.fmt").fmta 11 | local rep = require("luasnip.extras").rep 12 | local get_visual = function(args, parent) 13 | if #parent.snippet.env.SELECT_RAW > 0 then 14 | return sn(nil, i(1, parent.snippet.env.SELECT_RAW)) 15 | else -- If SELECT_RAW is empty, return a blank insert node 16 | return sn(nil, i(1)) 17 | end 18 | end 19 | local tex = require("util.latex") 20 | 21 | return { 22 | s({ trig = "ii", snippetType = "autosnippet" }, fmta("$<>$", i(1))), 23 | s({ trig = "dd", snippetType = "autosnippet" }, fmta("$$\n<>\n$$", i(1))), 24 | } 25 | -------------------------------------------------------------------------------- /LuaSnip/markdown/text.lua: -------------------------------------------------------------------------------- 1 | local ls = require("luasnip") 2 | local s = ls.snippet 3 | local sn = ls.snippet_node 4 | local t = ls.text_node 5 | local i = ls.insert_node 6 | local f = ls.function_node 7 | local d = ls.dynamic_node 8 | local c = ls.choice_node 9 | local fmt = require("luasnip.extras.fmt").fmt 10 | local fmta = require("luasnip.extras.fmt").fmta 11 | local rep = require("luasnip.extras").rep 12 | local get_visual = function(args, parent) 13 | if #parent.snippet.env.SELECT_RAW > 0 then 14 | return sn(nil, i(1, parent.snippet.env.SELECT_RAW)) 15 | else -- If SELECT_RAW is empty, return a blank insert node 16 | return sn(nil, i(1)) 17 | end 18 | end 19 | 20 | return { 21 | s( 22 | "link", 23 | fmta("[<>](<>)", { i(1), f(function(_, snip) 24 | return snip.env.TM_SELECTED_TEXT[1] or {} 25 | end, {}) }) 26 | ), 27 | s({ trig = ";b", snippetType = "autosnippet" }, fmta("**<>**", i(1))), 28 | s({ trig = ";t", snippetType = "autosnippet" }, fmta("*<>*", i(1))), 29 | s({ trig = "xx", snippetType = "autosnippet" }, fmta("$\\times$", {})), 30 | s( 31 | { trig = ";c", snippetType = "autosnippet" }, 32 | fmta( 33 | [[ 34 | ```<> 35 | <> 36 | ``` 37 | ]], 38 | { i(1), i(0) } 39 | ) 40 | ), 41 | } 42 | -------------------------------------------------------------------------------- /LuaSnip/tex/completion.lua: -------------------------------------------------------------------------------- 1 | local ls = require("luasnip") 2 | local s = ls.snippet 3 | local sn = ls.snippet_node 4 | local t = ls.text_node 5 | local i = ls.insert_node 6 | local f = ls.function_node 7 | local d = ls.dynamic_node 8 | local fmt = require("luasnip.extras.fmt").fmt 9 | local fmta = require("luasnip.extras.fmt").fmta 10 | local rep = require("luasnip.extras").rep 11 | local line_begin = require("luasnip.extras.expand_conditions").line_begin 12 | local tex = require("util.latex") 13 | 14 | local get_visual = function(args, parent) 15 | if #parent.snippet.env.SELECT_RAW > 0 then 16 | return sn(nil, i(1, parent.snippet.env.SELECT_RAW)) 17 | else -- If SELECT_RAW is empty, return a blank insert node 18 | return sn(nil, i(1)) 19 | end 20 | end 21 | 22 | return { 23 | s( 24 | { trig = "(%a);", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, 25 | fmta("\\hat{<>}", { 26 | f(function(_, snip) 27 | return snip.captures[1] 28 | end), 29 | }), 30 | { condition = tex.in_mathzone } 31 | ), 32 | s( 33 | { trig = "([%a%)%]%}])(%d)", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, 34 | fmta("<>_<>", { 35 | f(function(_, snip) 36 | return snip.captures[1] 37 | end), 38 | f(function(_, snip) 39 | return snip.captures[2] 40 | end), 41 | }), 42 | { condition = tex.in_mathzone } 43 | ), 44 | s( 45 | { trig = "([%a%)%]%}])_(%d)(%d)", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, 46 | fmta("<>_{<><>}", { 47 | f(function(_, snip) 48 | return snip.captures[1] 49 | end), 50 | f(function(_, snip) 51 | return snip.captures[2] 52 | end), 53 | f(function(_, snip) 54 | return snip.captures[3] 55 | end), 56 | }), 57 | { condition = tex.in_mathzone } 58 | ), 59 | s( 60 | { trig = "([%a%)%]%}])(%a)%2", regTrig = true, wordTrig = false, snippetType = "autosnippet", priority = 100 }, 61 | fmta("<>_<>", { 62 | f(function(_, snip) 63 | return snip.captures[1] 64 | end), 65 | f(function(_, snip) 66 | return snip.captures[2] 67 | end), 68 | }), 69 | { condition = tex.in_mathzone } 70 | ), 71 | s( 72 | { trig = "([%a%)%]%}])_(%a)(%a)%3", regTrig = true, wordTrig = false, snippetType = "autosnippet", priority = 2000 }, 73 | fmta("<>_{<><>}", { 74 | f(function(_, snip) 75 | return snip.captures[1] 76 | end), 77 | f(function(_, snip) 78 | return snip.captures[2] 79 | end), 80 | f(function(_, snip) 81 | return snip.captures[3] 82 | end), 83 | }), 84 | { condition = tex.in_mathzone } 85 | ), 86 | s( 87 | { trig = "(%d+)/", regTrig = true, wordTrig = false, snippetType = "autosnippet", priority = 100 }, 88 | fmta("\\frac{<>}{<>}", { 89 | f(function(_, snip) 90 | return snip.captures[1] 91 | end), 92 | i(1), 93 | }), 94 | { condition = tex.in_mathzone } 95 | ), 96 | s( 97 | { trig = "(%a)/", regTrig = true, wordTrig = false, snippetType = "autosnippet", priority = 100 }, 98 | fmta("\\frac{<>}{<>}", { 99 | f(function(_, snip) 100 | return snip.captures[1] 101 | end), 102 | i(1), 103 | }), 104 | { condition = tex.in_mathzone } 105 | ), 106 | s( 107 | { trig = "%((.+)%)/", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, 108 | fmta("\\frac{<>}{<>}", { 109 | f(function(_, snip) 110 | return snip.captures[1] 111 | end), 112 | i(1), 113 | }), 114 | { condition = tex.in_mathzone } 115 | ), 116 | s( 117 | { trig = "(\\%a+)/", regTrig = true, wordTrig = false, snippetType = "autosnippet", priority = 2000 }, 118 | fmta("\\frac{<>}{<>}", { 119 | f(function(_, snip) 120 | return snip.captures[1] 121 | end), 122 | i(1), 123 | }), 124 | { condition = tex.in_mathzone } 125 | ), 126 | s( 127 | { trig = "(\\%a+%{%a+%})/", regTrig = true, wordTrig = false, snippetType = "autosnippet", priority = 3000 }, 128 | fmta("\\frac{<>}{<>}", { 129 | f(function(_, snip) 130 | return snip.captures[1] 131 | end), 132 | i(1), 133 | }), 134 | { condition = tex.in_mathzone } 135 | ), 136 | s( 137 | { trig = "\\%)(%a)", regTrig = true, wordTrig = false, snippetType = "autosnippet", priority = 2000 }, 138 | fmta("\\) <>", { 139 | f(function(_, snip) 140 | return snip.captures[1] 141 | end), 142 | }) 143 | ), 144 | s( 145 | { trig = "lim", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, 146 | fmta("\\lim\\limits_{<>}", { 147 | i(0), 148 | }), 149 | { condition = tex.in_mathzone } 150 | ), 151 | -- s( 152 | -- { trig = "sum", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, 153 | -- fmta("\\sum\\limits_{<>}^{<>}", { 154 | -- i(1), 155 | -- i(0), 156 | -- }), 157 | -- { condition = tex.in_mathzone } 158 | -- ), 159 | s( 160 | { trig = "sum", snippetType = "autosnippet" }, 161 | c(1, { 162 | sn(nil, { t("\\sum\\limits_{"), i(1), t("} ") }), 163 | sn(nil, { t("\\sum\\limits_{"), i(1), t("}^{"), i(2), t("} ") }), 164 | }), 165 | { condition = tex.in_mathzone } 166 | ), 167 | s( 168 | { trig = "bot", regTrig = true, wordTrig = false, snippetType = "autosnippet", priority = 2000 }, 169 | fmta("\\bigotimes\\limits_{<>}^{<>}", { 170 | i(1), 171 | i(0), 172 | }), 173 | { condition = tex.in_mathzone } 174 | ), 175 | s( 176 | { trig = "pd", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, 177 | fmta("\\prod\\limits_{<>}^{<>}", { 178 | i(1), 179 | i(0), 180 | }), 181 | { condition = tex.in_mathzone } 182 | ), 183 | s( 184 | { trig = "bcap", regTrig = true, wordTrig = false, snippetType = "autosnippet", priority = 2000 }, 185 | fmta("\\bigcap\\limits_{<>}^{<>}", { 186 | i(1), 187 | i(0), 188 | }), 189 | { condition = tex.in_mathzone } 190 | ), 191 | s( 192 | { trig = "bcup", regTrig = true, wordTrig = false, snippetType = "autosnippet", priority = 2000 }, 193 | fmta("\\bigcup\\limits_{<>}^{<>}", { 194 | i(1), 195 | i(0), 196 | }), 197 | { condition = tex.in_mathzone } 198 | ), 199 | s( 200 | { trig = "bscap", regTrig = true, wordTrig = false, snippetType = "autosnippet", priority = 2000 }, 201 | fmta("\\bigsqcap\\limits_{<>}^{<>}", { 202 | i(1), 203 | i(0), 204 | }), 205 | { condition = tex.in_mathzone } 206 | ), 207 | s( 208 | { trig = "bscup", regTrig = true, wordTrig = false, snippetType = "autosnippet", priority = 2000 }, 209 | fmta("\\bigsqcup\\limits_{<>}^{<>}", { 210 | i(1), 211 | i(0), 212 | }), 213 | { condition = tex.in_mathzone } 214 | ), 215 | s( 216 | { trig = "int", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, 217 | fmta("\\int_{<>}^{<>} <> \\d <>", { 218 | i(1), 219 | i(2), 220 | i(3), 221 | i(0), 222 | }), 223 | { condition = tex.in_mathzone } 224 | ), 225 | s( 226 | { trig = "2int", regTrig = true, wordTrig = false, snippetType = "autosnippet", priority = 2000 }, 227 | fmta("\\int_{<>}^{<>}\\int_{<>}^{<>} <> \\d <>\\d <>", { 228 | i(1), 229 | i(2), 230 | i(3), 231 | i(4), 232 | i(5), 233 | i(6), 234 | i(0), 235 | }), 236 | { condition = tex.in_mathzone } 237 | ), 238 | s( 239 | { trig = "iint", regTrig = true, wordTrig = false, snippetType = "autosnippet", priority = 2000 }, 240 | fmta("\\iint\\limits_{<>}^{<>} <> \\d <>", { 241 | i(1, "-\\infty"), 242 | i(2, "\\infty"), 243 | i(3), 244 | i(0), 245 | }), 246 | { condition = tex.in_mathzone } 247 | ), 248 | s( 249 | { trig = "lint", regTrig = true, wordTrig = false, snippetType = "autosnippet", priority = 2000 }, 250 | fmta("\\int\\limits_{<>} <> \\d <>", { 251 | i(1, "\\infty"), 252 | i(2), 253 | i(0), 254 | }), 255 | { condition = tex.in_mathzone } 256 | ), 257 | } 258 | -------------------------------------------------------------------------------- /LuaSnip/tex/derivative.lua: -------------------------------------------------------------------------------- 1 | local ls = require("luasnip") 2 | local s = ls.snippet 3 | local sn = ls.snippet_node 4 | local t = ls.text_node 5 | local i = ls.insert_node 6 | local f = ls.function_node 7 | local d = ls.dynamic_node 8 | local fmt = require("luasnip.extras.fmt").fmt 9 | local fmta = require("luasnip.extras.fmt").fmta 10 | local rep = require("luasnip.extras").rep 11 | local line_begin = require("luasnip.extras.expand_conditions").line_begin 12 | 13 | local tex = require("util.latex") 14 | 15 | local get_visual = function(args, parent) 16 | if #parent.snippet.env.SELECT_RAW > 0 then 17 | return sn(nil, t(parent.snippet.env.SELECT_RAW)) 18 | else -- If SELECT_RAW is empty, return a blank insert node 19 | return sn(nil, i(1)) 20 | end 21 | end 22 | 23 | return { 24 | -- s( 25 | -- { trig = "pv", snippetType = "autosnippet" }, 26 | -- fmta("\\pdv[order={<>}]{<>}{<>}", { 27 | -- i(0), 28 | -- i(1), 29 | -- i(2), 30 | -- }), 31 | -- { condition = tex.in_mathzone } 32 | -- ), 33 | s( 34 | { trig = "pv", snippetType = "autosnippet" }, 35 | c(1, { 36 | sn(nil, { t("\\pdv{"), i(1), t("}{"), i(2), t("}") }), 37 | sn(nil, { t("\\pdv[order={"), i(3), t("}]{"), i(1), t("}{"), i(2), t("}") }), 38 | }), 39 | { condition = tex.in_mathzone } 40 | ), 41 | s( 42 | { trig = "ov", snippetType = "autosnippet" }, 43 | c(1, { 44 | sn(nil, { t("\\odv{"), i(1), t("}{"), i(2), t("}") }), 45 | sn(nil, { t("\\odv[order={"), i(3), t("}]{"), i(1), t("}{"), i(2), t("}") }), 46 | }), 47 | { condition = tex.in_mathzone } 48 | ), 49 | s( 50 | { trig = "ov", snippetType = "autosnippet" }, 51 | fmta("\\odv[order={<>}]{<>}{<>}", { 52 | i(0), 53 | i(1), 54 | i(2), 55 | }), 56 | { condition = tex.in_mathzone } 57 | ), 58 | } 59 | -------------------------------------------------------------------------------- /LuaSnip/tex/env.lua: -------------------------------------------------------------------------------- 1 | local ls = require("luasnip") 2 | local s = ls.snippet 3 | local sn = ls.snippet_node 4 | local t = ls.text_node 5 | local i = ls.insert_node 6 | local f = ls.function_node 7 | local d = ls.dynamic_node 8 | local fmta = require("luasnip.extras.fmt").fmta 9 | local rep = require("luasnip.extras").rep 10 | local line_begin = require("luasnip.extras.expand_conditions").line_begin 11 | local tex = require("util.latex") 12 | local get_visual = function(args, parent) 13 | if #parent.snippet.env.SELECT_RAW > 0 then 14 | return sn(nil, t(parent.snippet.env.SELECT_RAW)) 15 | else -- If SELECT_RAW is empty, return a blank insert node 16 | return sn(nil, i(1)) 17 | end 18 | end 19 | 20 | return { 21 | s( 22 | { trig = "ii", wordTrig = false, snippetType = "autosnippet" }, 23 | fmta( 24 | [[ 25 | \(<>\) 26 | ]], 27 | { 28 | i(0), 29 | } 30 | ), 31 | { condition = tex.in_text } 32 | ), 33 | s( 34 | { trig = "dd", snippetType = "autosnippet" }, 35 | fmta( 36 | [[ 37 | \[ 38 | <> 39 | .\] 40 | ]], 41 | { 42 | i(0), 43 | } 44 | ), 45 | { condition = tex.in_text } 46 | ), 47 | s( 48 | { trig = "bad", snippetType = "autosnippet" }, 49 | fmta( 50 | [[ 51 | \begin{adjustbox}{width=0.<>\textwidth} 52 | <> 53 | \end{adjustbox} 54 | ]], 55 | { 56 | i(1, "8"), 57 | i(0), 58 | } 59 | ), 60 | { condition = line_begin } 61 | ), 62 | s( 63 | { trig = "bp", snippetType = "autosnippet" }, 64 | fmta( 65 | [[ 66 | \begin{homeworkProblem}[<>] 67 | <> 68 | \end{homeworkProblem} 69 | ]], 70 | { 71 | i(1), 72 | i(0), 73 | } 74 | ), 75 | { condition = line_begin } 76 | ), 77 | s( 78 | { trig = "bf", snippetType = "autosnippet" }, 79 | fmta( 80 | [[ 81 | \begin{proof} 82 | <> 83 | \end{proof} 84 | ]], 85 | { 86 | i(0), 87 | } 88 | ), 89 | { condition = line_begin } 90 | ), 91 | s( 92 | { trig = "beg", snippetType = "autosnippet" }, 93 | fmta( 94 | [[ 95 | \begin{<>}[<>] 96 | <> 97 | \end{<>} 98 | ]], 99 | { 100 | i(1), 101 | i(2), 102 | i(0), 103 | rep(1), 104 | } 105 | ), 106 | { condition = line_begin } 107 | ), 108 | s( 109 | { trig = "ben", snippetType = "autosnippet" }, 110 | fmta( 111 | [[ 112 | \begin{enumerate}[<>] 113 | \item <> 114 | \end{enumerate} 115 | ]], 116 | { 117 | i(1, "(a)"), 118 | i(0), 119 | } 120 | ), 121 | { condition = line_begin } 122 | ), 123 | s( 124 | { trig = "box", snippetType = "autosnippet" }, 125 | fmta( 126 | [[ 127 | \begin{framed} 128 | <> 129 | \end{framed} 130 | ]], 131 | { 132 | i(0), 133 | } 134 | ), 135 | { condition = tex.in_text * line_begin } 136 | ), 137 | s( 138 | { trig = "dcase", snippetType = "autosnippet", priority = 2000 }, 139 | fmta( 140 | [[ 141 | \begin{dcases} 142 | <> 143 | \end{dcases} 144 | ]], 145 | { 146 | i(0), 147 | } 148 | ), 149 | { condition = tex.in_mathzone } 150 | ), 151 | s( 152 | { trig = "case", snippetType = "autosnippet" }, 153 | fmta( 154 | [[ 155 | \begin{cases} 156 | <> 157 | \end{cases} 158 | ]], 159 | { 160 | i(0), 161 | } 162 | ), 163 | { condition = tex.in_mathzone } 164 | ), 165 | s( 166 | { trig = "bal", snippetType = "autosnippet" }, 167 | fmta( 168 | [[ 169 | \begin{aligned} 170 | <> 171 | \end{aligned} 172 | ]], 173 | { 174 | i(0), 175 | } 176 | ), 177 | { condition = tex.in_mathzone } 178 | ), 179 | s( 180 | { trig = "bal", snippetType = "autosnippet", priority = 2000 }, 181 | fmta( 182 | [[ 183 | \begin{aligned} 184 | <> 185 | \end{aligned} 186 | ]], 187 | { 188 | d(1, get_visual), 189 | } 190 | ), 191 | { condition = tex.in_mathzone } 192 | ), 193 | s( 194 | { trig = "bit", snippetType = "autosnippet" }, 195 | fmta( 196 | [[ 197 | \begin{itemize} 198 | \item <> 199 | \end{itemize} 200 | ]], 201 | { 202 | i(0), 203 | } 204 | ), 205 | { condition = line_begin } 206 | ), 207 | s({ trig = "im", snippetType = "autosnippet" }, { 208 | t("\\item"), 209 | }, { condition = tex.in_item * line_begin }), 210 | s( 211 | { trig = "bcr", snippetType = "autosnippet" }, 212 | fmta( 213 | [[ 214 | \begin{center} 215 | <> 216 | \end{center} 217 | ]], 218 | { 219 | i(0), 220 | } 221 | ), 222 | { condition = line_begin } 223 | ), 224 | s( 225 | { trig = "btr", snippetType = "autosnippet" }, 226 | fmta( 227 | [[ 228 | \begin{tabular}{<>} 229 | \hline 230 | <> 231 | \hline 232 | \end{tabular} 233 | ]], 234 | { 235 | i(1), 236 | i(0), 237 | } 238 | ), 239 | { condition = line_begin } 240 | ), 241 | s( 242 | { trig = "cha", snippetType = "autosnippet" }, 243 | fmta( 244 | [[ 245 | \chapter{<>} 246 | ]], 247 | { 248 | i(0), 249 | } 250 | ), 251 | { condition = line_begin } 252 | ), 253 | s( 254 | { trig = "sec", snippetType = "autosnippet" }, 255 | fmta( 256 | [[ 257 | \section{<>} 258 | ]], 259 | { 260 | i(0), 261 | } 262 | ), 263 | { condition = line_begin } 264 | ), 265 | s( 266 | { trig = "ssec", snippetType = "autosnippet" }, 267 | fmta( 268 | [[ 269 | \subsection{<>} 270 | ]], 271 | { 272 | i(0), 273 | } 274 | ), 275 | { condition = line_begin } 276 | ), 277 | s( 278 | { trig = "sss", snippetType = "autosnippet" }, 279 | fmta( 280 | [[ 281 | \subsubsection{<>} 282 | ]], 283 | { 284 | i(0), 285 | } 286 | ), 287 | { condition = line_begin } 288 | ), 289 | } 290 | -------------------------------------------------------------------------------- /LuaSnip/tex/font.lua: -------------------------------------------------------------------------------- 1 | local ls = require("luasnip") 2 | local s = ls.snippet 3 | local sn = ls.snippet_node 4 | local i = ls.insert_node 5 | local d = ls.dynamic_node 6 | local fmta = require("luasnip.extras.fmt").fmta 7 | local rep = require("luasnip.extras").rep 8 | local line_begin = require("luasnip.extras.expand_conditions").line_begin 9 | local get_visual = function(args, parent) 10 | if #parent.snippet.env.SELECT_RAW > 0 then 11 | return sn(nil, t(parent.snippet.env.SELECT_RAW)) 12 | else -- If SELECT_RAW is empty, return a blank insert node 13 | return sn(nil, i(1)) 14 | end 15 | end 16 | 17 | local tex = require("util.latex") 18 | 19 | return { 20 | s( 21 | { trig = "msf", snippetType = "autosnippet", priority = 2000 }, 22 | fmta("\\mathsf{<>}", { 23 | d(1, get_visual), 24 | }), 25 | { condition = tex.in_mathzone } 26 | ), 27 | s( 28 | { trig = "msf", snippetType = "autosnippet" }, 29 | fmta("\\mathsf{<>}", { 30 | i(0), 31 | }), 32 | { condition = tex.in_mathzone } 33 | ), 34 | s( 35 | { trig = "cal", snippetType = "autosnippet", priority = 2000 }, 36 | fmta("\\mathcal{<>}", { 37 | d(1, get_visual), 38 | }), 39 | { condition = tex.in_mathzone } 40 | ), 41 | s( 42 | { trig = "cal", snippetType = "autosnippet" }, 43 | fmta("\\mathcal{<>}", { 44 | i(0), 45 | }), 46 | { condition = tex.in_mathzone } 47 | ), 48 | s( 49 | { trig = "scr", snippetType = "autosnippet", priority = 2000 }, 50 | fmta("\\mathscr{<>}", { 51 | d(1, get_visual), 52 | }), 53 | { condition = tex.in_mathzone } 54 | ), 55 | s( 56 | { trig = "scr", snippetType = "autosnippet" }, 57 | fmta("\\mathscr{<>}", { 58 | i(0), 59 | }), 60 | { condition = tex.in_mathzone } 61 | ), 62 | s( 63 | { trig = "mbb", snippetType = "autosnippet", priority = 2000 }, 64 | fmta("\\mathbb{<>}", { 65 | d(1, get_visual), 66 | }), 67 | { condition = tex.in_mathzone } 68 | ), 69 | s( 70 | { trig = "mbb", snippetType = "autosnippet" }, 71 | fmta("\\mathbb{<>}", { 72 | i(0), 73 | }), 74 | { condition = tex.in_mathzone } 75 | ), 76 | s( 77 | { trig = "mrm", snippetType = "autosnippet", priority = 2000 }, 78 | fmta("\\mathrm{<>}", { 79 | d(1, get_visual), 80 | }), 81 | { condition = tex.in_mathzone } 82 | ), 83 | s( 84 | { trig = "mrm", snippetType = "autosnippet" }, 85 | fmta("\\mathrm{<>}", { 86 | i(0), 87 | }), 88 | { condition = tex.in_mathzone } 89 | ), 90 | s( 91 | { trig = "tit", snippetType = "autosnippet", priority = 2000 }, 92 | fmta("\\textit{<>}", { 93 | d(1, get_visual), 94 | }) 95 | ), 96 | s( 97 | { trig = "tit", snippetType = "autosnippet" }, 98 | fmta("\\textit{<>}", { 99 | i(0), 100 | }) 101 | ), 102 | s( 103 | { trig = "tbf", snippetType = "autosnippet", priority = 2000 }, 104 | fmta("\\textbf{<>}", { 105 | d(1, get_visual), 106 | }) 107 | ), 108 | s( 109 | { trig = "tbf", snippetType = "autosnippet" }, 110 | fmta("\\textbf{<>}", { 111 | i(0), 112 | }) 113 | ), 114 | s( 115 | { trig = "qq", snippetType = "autosnippet", priority = 2000 }, 116 | fmta("\\text{\\ <>\\ }", { 117 | d(1, get_visual), 118 | }, { conditon = tex.in_mathzone }) 119 | ), 120 | s( 121 | { trig = "tet", snippetType = "autosnippet" }, 122 | fmta("\\text{<>}", { 123 | i(0), 124 | }) 125 | ), 126 | } 127 | -------------------------------------------------------------------------------- /LuaSnip/tex/greek-letter.lua: -------------------------------------------------------------------------------- 1 | local ls = require("luasnip") 2 | local s = ls.snippet 3 | local t = ls.text_node 4 | local tex = require("util.latex") 5 | 6 | return { 7 | s({ trig = "alp", snippetType = "autosnippet", wordTrig = false }, { 8 | t("\\alpha"), 9 | }, { condition = tex.in_mathzone }), 10 | s({ trig = "Alp", snippetType = "autosnippet", wordTrig = false }, { 11 | t("\\Alpha"), 12 | }, { condition = tex.in_mathzone }), 13 | s({ trig = ";a", snippetType = "autosnippet", wordTrig = false }, { 14 | t("\\alpha"), 15 | }, { condition = tex.in_mathzone }), 16 | s({ trig = "beta", snippetType = "autosnippet", wordTrig = false }, { 17 | t("\\beta"), 18 | }, { condition = tex.in_mathzone }), 19 | s({ trig = ";b", snippetType = "autosnippet", wordTrig = false }, { 20 | t("\\beta"), 21 | }, { condition = tex.in_mathzone }), 22 | s({ trig = "Beta", snippetType = "autosnippet", wordTrig = false }, { 23 | t("\\Beta"), 24 | }, { condition = tex.in_mathzone }), 25 | s({ trig = "gam", snippetType = "autosnippet", wordTrig = false }, { 26 | t("\\gamma"), 27 | }, { condition = tex.in_mathzone }), 28 | s({ trig = ";c", snippetType = "autosnippet", wordTrig = false }, { 29 | t("\\gamma"), 30 | }, { condition = tex.in_mathzone }), 31 | s({ trig = "Gam", snippetType = "autosnippet", wordTrig = false }, { 32 | t("\\Gamma"), 33 | }, { condition = tex.in_mathzone }), 34 | s({ trig = "del", snippetType = "autosnippet", wordTrig = false }, { 35 | t("\\delta"), 36 | }, { condition = tex.in_mathzone }), 37 | s({ trig = ";d", snippetType = "autosnippet", wordTrig = false }, { 38 | t("\\delta"), 39 | }, { condition = tex.in_mathzone }), 40 | s({ trig = "Del", snippetType = "autosnippet", wordTrig = false }, { 41 | t("\\Delta"), 42 | }, { condition = tex.in_mathzone }), 43 | s({ trig = "eps", snippetType = "autosnippet", wordTrig = false }, { 44 | t("\\epsilon"), 45 | }, { condition = tex.in_mathzone }), 46 | s({ trig = "vps", snippetType = "autosnippet", wordTrig = false }, { 47 | t("\\varepsilon"), 48 | }, { condition = tex.in_mathzone }), 49 | s({ trig = "Eps", snippetType = "autosnippet", wordTrig = false }, { 50 | t("\\Epsilon"), 51 | }, { condition = tex.in_mathzone }), 52 | s({ trig = "zeta", snippetType = "autosnippet", wordTrig = false }, { 53 | t("\\zeta"), 54 | }, { condition = tex.in_mathzone }), 55 | s({ trig = "Zeta", snippetType = "autosnippet", wordTrig = false }, { 56 | t("\\Zeta"), 57 | }, { condition = tex.in_mathzone }), 58 | s({ trig = "eta", snippetType = "autosnippet", wordTrig = false }, { 59 | t("\\eta"), 60 | }, { condition = tex.in_mathzone }), 61 | s({ trig = "Eta", snippetType = "autosnippet", wordTrig = false }, { 62 | t("\\Eta"), 63 | }, { condition = tex.in_mathzone }), 64 | s({ trig = "the", snippetType = "autosnippet", wordTrig = false }, { 65 | t("\\theta"), 66 | }, { condition = tex.in_mathzone }), 67 | s({ trig = "The", snippetType = "autosnippet", wordTrig = false }, { 68 | t("\\Theta"), 69 | }, { condition = tex.in_mathzone }), 70 | s({ trig = "iot", snippetType = "autosnippet", wordTrig = false }, { 71 | t("\\iota"), 72 | }, { condition = tex.in_mathzone }), 73 | s({ trig = "Iot", snippetType = "autosnippet", wordTrig = false }, { 74 | t("\\Iota"), 75 | }, { condition = tex.in_mathzone }), 76 | s({ trig = "kap", snippetType = "autosnippet", wordTrig = false }, { 77 | t("\\kappa"), 78 | }, { condition = tex.in_mathzone }), 79 | s({ trig = "Kap", snippetType = "autosnippet", wordTrig = false }, { 80 | t("\\Kappa"), 81 | }, { condition = tex.in_mathzone }), 82 | s({ trig = "lam", snippetType = "autosnippet", wordTrig = false }, { 83 | t("\\lambda"), 84 | }, { condition = tex.in_mathzone }), 85 | s({ trig = "Lam", snippetType = "autosnippet", wordTrig = false }, { 86 | t("\\Lambda"), 87 | }, { condition = tex.in_mathzone }), 88 | s({ trig = "mu", snippetType = "autosnippet", wordTrig = false }, { 89 | t("\\mu"), 90 | }, { condition = tex.in_mathzone }), 91 | s({ trig = "Mu", snippetType = "autosnippet", wordTrig = false }, { 92 | t("\\Mu"), 93 | }, { condition = tex.in_mathzone }), 94 | s({ trig = "nu", snippetType = "autosnippet", wordTrig = false }, { 95 | t("\\nu"), 96 | }, { condition = tex.in_mathzone }), 97 | s({ trig = "Nu", snippetType = "autosnippet", wordTrig = false }, { 98 | t("\\Nu"), 99 | }, { condition = tex.in_mathzone }), 100 | -- s({ trig = "xi", snippetType = "autosnippet", wordTrig = false }, { 101 | -- t("\\xi"), 102 | -- }, { condition = tex.in_mathzone }), 103 | -- s({ trig = "Xi", snippetType = "autosnippet", wordTrig = false }, { 104 | -- t("\\Xi"), 105 | -- }, { condition = tex.in_mathzone }), 106 | s({ trig = "omi", snippetType = "autosnippet", wordTrig = false }, { 107 | t("\\omicron"), 108 | }, { condition = tex.in_mathzone }), 109 | s({ trig = "pi", snippetType = "autosnippet", wordTrig = false }, { 110 | t("\\pi"), 111 | }, { condition = tex.in_mathzone }), 112 | s({ trig = "\\pii", snippetType = "autosnippet", wordTrig = false, priority = 2000 }, { 113 | t("p_i"), 114 | }, { condition = tex.in_mathzone }), 115 | s({ trig = "Pi", snippetType = "autosnippet", wordTrig = false }, { 116 | t("\\Pi"), 117 | }, { condition = tex.in_mathzone }), 118 | s({ trig = "rho", snippetType = "autosnippet", wordTrig = false }, { 119 | t("\\rho"), 120 | }, { condition = tex.in_mathzone }), 121 | s({ trig = "Rho", snippetType = "autosnippet", wordTrig = false }, { 122 | t("\\Rho"), 123 | }, { condition = tex.in_mathzone }), 124 | s({ trig = "sig", snippetType = "autosnippet", wordTrig = false }, { 125 | t("\\sigma"), 126 | }, { condition = tex.in_mathzone }), 127 | s({ trig = "Sig", snippetType = "autosnippet", wordTrig = false }, { 128 | t("\\Sigma"), 129 | }, { condition = tex.in_mathzone }), 130 | s({ trig = "tau", snippetType = "autosnippet", wordTrig = false }, { 131 | t("\\tau"), 132 | }, { condition = tex.in_mathzone }), 133 | s({ trig = "Tau", snippetType = "autosnippet", wordTrig = false }, { 134 | t("\\Tau"), 135 | }, { condition = tex.in_mathzone }), 136 | s({ trig = "ups", snippetType = "autosnippet", wordTrig = false }, { 137 | t("\\ups"), 138 | }, { condition = tex.in_mathzone }), 139 | s({ trig = "Ups", snippetType = "autosnippet", wordTrig = false }, { 140 | t("\\Ups"), 141 | }, { condition = tex.in_mathzone }), 142 | s({ trig = "phi", snippetType = "autosnippet", wordTrig = false }, { 143 | t("\\phi"), 144 | }, { condition = tex.in_mathzone }), 145 | s({ trig = "Phi", snippetType = "autosnippet", wordTrig = false }, { 146 | t("\\Phi"), 147 | }, { condition = tex.in_mathzone }), 148 | s({ trig = "vhi", snippetType = "autosnippet", wordTrig = false }, { 149 | t("\\varphi"), 150 | }, { condition = tex.in_mathzone }), 151 | s({ trig = "Vhi", snippetType = "autosnippet", wordTrig = false }, { 152 | t("\\Varphi"), 153 | }, { condition = tex.in_mathzone }), 154 | s({ trig = "chi", snippetType = "autosnippet", wordTrig = false }, { 155 | t("\\chi"), 156 | }, { condition = tex.in_mathzone }), 157 | s({ trig = "Chi", snippetType = "autosnippet", wordTrig = false }, { 158 | t("\\Chi"), 159 | }, { condition = tex.in_mathzone }), 160 | s({ trig = "psi", snippetType = "autosnippet", wordTrig = false }, { 161 | t("\\psi"), 162 | }, { condition = tex.in_mathzone }), 163 | s({ trig = "Psi", snippetType = "autosnippet", wordTrig = false }, { 164 | t("\\Psi"), 165 | }, { condition = tex.in_mathzone }), 166 | s({ trig = "ome", snippetType = "autosnippet", wordTrig = false }, { 167 | t("\\omega"), 168 | }, { condition = tex.in_mathzone }), 169 | s({ trig = "Ome", snippetType = "autosnippet", wordTrig = false }, { 170 | t("\\Omega"), 171 | }, { condition = tex.in_mathzone }), 172 | } 173 | -------------------------------------------------------------------------------- /LuaSnip/tex/math-commands.lua: -------------------------------------------------------------------------------- 1 | local ls = require("luasnip") 2 | local s = ls.snippet 3 | local sn = ls.snippet_node 4 | local t = ls.text_node 5 | local i = ls.insert_node 6 | local d = ls.dynamic_node 7 | local fmt = require("luasnip.extras.fmt").fmt 8 | local fmta = require("luasnip.extras.fmt").fmta 9 | local rep = require("luasnip.extras").rep 10 | local line_begin = require("luasnip.extras.expand_conditions").line_begin 11 | 12 | local tex = require("util.latex") 13 | 14 | local get_visual = function(args, parent) 15 | if #parent.snippet.env.SELECT_RAW > 0 then 16 | return sn(nil, t(parent.snippet.env.SELECT_RAW)) 17 | else -- If SELECT_RAW is empty, return a blank insert node 18 | return sn(nil, i(1)) 19 | end 20 | end 21 | 22 | return { 23 | s({ trig = "sin", snippetType = "autosnippet" }, { 24 | t("\\sin"), 25 | }, { condition = tex.in_mathzone }), 26 | s({ trig = "asin", snippetType = "autosnippet" }, { 27 | t("\\arcsin"), 28 | }, { condition = tex.in_mathzone }), 29 | s({ trig = "cos", snippetType = "autosnippet" }, { 30 | t("\\cos"), 31 | }, { condition = tex.in_mathzone }), 32 | s({ trig = "acos", snippetType = "autosnippet" }, { 33 | t("\\arccos"), 34 | }, { condition = tex.in_mathzone }), 35 | s({ trig = "tan", snippetType = "autosnippet" }, { 36 | t("\\tan"), 37 | }, { condition = tex.in_mathzone }), 38 | s({ trig = "atan", snippetType = "autosnippet" }, { 39 | t("\\arctan"), 40 | }, { condition = tex.in_mathzone }), 41 | s({ trig = "cot", snippetType = "autosnippet" }, { 42 | t("\\cot"), 43 | }, { condition = tex.in_mathzone }), 44 | s({ trig = "acot", snippetType = "autosnippet" }, { 45 | t("\\arccot"), 46 | }, { condition = tex.in_mathzone }), 47 | s({ trig = "csc", snippetType = "autosnippet" }, { 48 | t("\\csc"), 49 | }, { condition = tex.in_mathzone }), 50 | s({ trig = "acsc", snippetType = "autosnippet" }, { 51 | t("\\arccsc"), 52 | }, { condition = tex.in_mathzone }), 53 | s({ trig = "sec", snippetType = "autosnippet" }, { 54 | t("\\sec"), 55 | }, { condition = tex.in_mathzone }), 56 | s({ trig = "asec", snippetType = "autosnippet" }, { 57 | t("\\arcsec"), 58 | }, { condition = tex.in_mathzone }), 59 | s({ trig = "log", snippetType = "autosnippet" }, { 60 | t("\\log"), 61 | }, { condition = tex.in_mathzone }), 62 | s({ trig = "ln", snippetType = "autosnippet" }, { 63 | t("\\ln"), 64 | }, { condition = tex.in_mathzone }), 65 | s({ trig = "exp", snippetType = "autosnippet" }, { 66 | t("\\exp"), 67 | }, { condition = tex.in_mathzone }), 68 | s({ trig = "grad", snippetType = "autosnippet" }, { 69 | t("\\grad"), 70 | }, { condition = tex.in_mathzone }), 71 | s({ trig = "curl", snippetType = "autosnippet" }, { 72 | t("\\curl"), 73 | }, { condition = tex.in_mathzone }), 74 | s({ trig = "div", snippetType = "autosnippet" }, { 75 | t("\\div"), 76 | }, { condition = tex.in_mathzone }), 77 | s({ trig = "lap", snippetType = "autosnippet" }, { 78 | t("\\laplacian"), 79 | }, { condition = tex.in_mathzone }), 80 | s({ trig = "bbr", snippetType = "autosnippet" }, { 81 | t("\\mathbb{R}"), 82 | }, { condition = tex.in_mathzone }), 83 | s({ trig = "bbq", snippetType = "autosnippet" }, { 84 | t("\\mathbb{Q}"), 85 | }, { condition = tex.in_mathzone }), 86 | s({ trig = "bbh", snippetType = "autosnippet" }, { 87 | t("\\mathbb{H}"), 88 | }, { condition = tex.in_mathzone }), 89 | s({ trig = "bbc", snippetType = "autosnippet" }, { 90 | t("\\mathbb{C}"), 91 | }, { condition = tex.in_mathzone }), 92 | s({ trig = "bbz", snippetType = "autosnippet" }, { 93 | t("\\mathbb{Z}"), 94 | }, { condition = tex.in_mathzone }), 95 | s({ trig = "bbn", snippetType = "autosnippet" }, { 96 | t("\\mathbb{N}"), 97 | }, { condition = tex.in_mathzone }), 98 | s({ trig = "bb1", snippetType = "autosnippet", priority = 2000 }, { 99 | t("\\mathbbm{1}"), 100 | }, { condition = tex.in_mathzone }), 101 | s({ trig = "bbe", snippetType = "autosnippet" }, { 102 | t("\\mathbb{E}"), 103 | }, { condition = tex.in_mathzone }), 104 | s( 105 | { trig = "bb(%w)", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, 106 | fmta("\\mathbb{<>}", { 107 | f(function(_, snip) 108 | return string.upper(snip.captures[1]) 109 | end), 110 | }), 111 | { condition = tex.in_mathzone } 112 | ), 113 | s({ trig = "exp", snippetType = "autosnippet" }, { 114 | t("\\exp"), 115 | }, { condition = tex.in_mathzone }), 116 | s( 117 | { trig = "bar", snippetType = "autosnippet", priority = 2000 }, 118 | fmta("\\overline{<>}", { 119 | d(1, get_visual), 120 | }), 121 | { condition = tex.in_mathzone } 122 | ), 123 | s( 124 | { trig = "bar", snippetType = "autosnippet" }, 125 | fmta("\\overline{<>}", { 126 | i(0), 127 | }), 128 | { condition = tex.in_mathzone } 129 | ), 130 | s( 131 | { trig = "(\\%a+)bar", wordTrig = false, regTrig = true, snippetType = "autosnippet" }, 132 | fmta("\\overline{<>}", { 133 | f(function(_, snip) 134 | return snip.captures[1] 135 | end), 136 | }), 137 | { condition = tex.in_mathzone } 138 | ), 139 | s( 140 | { trig = "(%a)bar", wordTrig = false, regTrig = true, snippetType = "autosnippet" }, 141 | fmta("\\overline{<>}", { 142 | f(function(_, snip) 143 | return snip.captures[1] 144 | end), 145 | }), 146 | { condition = tex.in_mathzone } 147 | ), 148 | s( 149 | { trig = "td", snippetType = "autosnippet", priority = 2000 }, 150 | fmta("\\tilde{<>}", { 151 | d(1, get_visual), 152 | }), 153 | { condition = tex.in_mathzone } 154 | ), 155 | s( 156 | { trig = "td", snippetType = "autosnippet" }, 157 | fmta("\\ttlde{<>}", { 158 | i(0), 159 | }), 160 | { condition = tex.in_mathzone } 161 | ), 162 | s( 163 | { trig = "(\\%a+)~", wordTrig = false, regTrig = true, snippetType = "autosnippet" }, 164 | fmta("\\tilde{<>}", { 165 | f(function(_, snip) 166 | return snip.captures[1] 167 | end), 168 | }), 169 | { condition = tex.in_mathzone } 170 | ), 171 | s( 172 | { trig = "(%a)~", wordTrig = false, regTrig = true, snippetType = "autosnippet" }, 173 | fmta("\\tilde{<>}", { 174 | f(function(_, snip) 175 | return snip.captures[1] 176 | end), 177 | }), 178 | { condition = tex.in_mathzone } 179 | ), 180 | s( 181 | { trig = "dot", snippetType = "autosnippet", priority = 2000 }, 182 | fmta("\\dot{<>}", { 183 | d(1, get_visual), 184 | }), 185 | { condition = tex.in_mathzone } 186 | ), 187 | s( 188 | { trig = "dot", snippetType = "autosnippet" }, 189 | fmta("\\dot{<>}", { 190 | i(0), 191 | }), 192 | { condition = tex.in_mathzone } 193 | ), 194 | s( 195 | { trig = "doo", snippetType = "autosnippet", priority = 2000 }, 196 | fmta("\\ddot{<>}", { 197 | i(0), 198 | }), 199 | { condition = tex.in_mathzone } 200 | ), 201 | s( 202 | { trig = "vb", snippetType = "autosnippet" }, 203 | c(1, { sn(nil, { t("\\vb{"), i(1), t("}") }), sn(nil, { t("\\vb*{"), i(1), t("}") }) }), 204 | { condition = tex.in_mathzone } 205 | ), 206 | s( 207 | { trig = "vu", snippetType = "autosnippet" }, 208 | c(1, { sn(nil, { t("\\vu{"), i(1), t("}") }), sn(nil, { t("\\vu*{"), i(1), t("}") }) }), 209 | { condition = tex.in_mathzone } 210 | ), 211 | s( 212 | { trig = "hat", snippetType = "autosnippet", priority = 2000 }, 213 | fmta("\\hat{<>}", { 214 | d(1, get_visual), 215 | }), 216 | { condition = tex.in_mathzone } 217 | ), 218 | s( 219 | { trig = "hat", snippetType = "autosnippet" }, 220 | fmta("\\hat{<>}", { 221 | i(0), 222 | }), 223 | { condition = tex.in_mathzone } 224 | ), 225 | s( 226 | { trig = "vec", snippetType = "autosnippet", priority = 2000 }, 227 | fmta("\\vec{<>}", { 228 | d(1, get_visual), 229 | }), 230 | { condition = tex.in_mathzone } 231 | ), 232 | s( 233 | { trig = "vec", snippetType = "autosnippet" }, 234 | fmta("\\vec{<>}", { 235 | i(0), 236 | }), 237 | { condition = tex.in_mathzone } 238 | ), 239 | -- s({ trig = "rr", snippetType = "autosnippet" }, fmta("\\ran", {}), { condition = tex.in_mathzone }), 240 | s({ trig = "kk", snippetType = "autosnippet" }, fmta("\\ker", {}), { condition = tex.in_mathzone }), 241 | s({ trig = "aut", snippetType = "autosnippet" }, fmta("\\Aut", {}), { condition = tex.in_mathzone }), 242 | s({ trig = "gal", snippetType = "autosnippet" }, fmta("\\Gal", {}), { condition = tex.in_mathzone }), 243 | s({ trig = "rank", snippetType = "autosnippet" }, fmta("\\rank", {}), { condition = tex.in_mathzone }), 244 | s({ trig = "dim", snippetType = "autosnippet" }, fmta("\\dim", {}), { condition = tex.in_mathzone }), 245 | s({ trig = "det", snippetType = "autosnippet" }, fmta("\\det", {}), { condition = tex.in_mathzone }), 246 | s({ trig = "vol", snippetType = "autosnippet" }, fmta("\\Vol", {}), { condition = tex.in_mathzone }), 247 | s( 248 | { trig = "->", snippetType = "autosnippet" }, 249 | fmta("\\xlongrightarrow{<>}", { 250 | i(0), 251 | }), 252 | { condition = tex.in_mathzone } 253 | ), 254 | s( 255 | { trig = "<-", snippetType = "autosnippet" }, 256 | fmta("\\xlongleftarrow{<>}", { 257 | i(0), 258 | }), 259 | { condition = tex.in_mathzone } 260 | ), 261 | s({ trig = "--", snippetType = "autosnippet" }, fmta("\\longleftrightarrow", {}), { condition = tex.in_mathzone }), 262 | s( 263 | { trig = "gt", snippetType = "autosnippet" }, 264 | fmta("\\gt{<>}", { 265 | i(0), 266 | }), 267 | { condition = tex.in_mathzone } 268 | ), 269 | s({ trig = "min", snippetType = "autosnippet" }, fmta("\\min", {}), { condition = tex.in_mathzone }), 270 | s( 271 | { trig = "\\minl", snippetType = "autosnippet" }, 272 | fmta("\\min\\limits_{<>}", { 273 | i(0), 274 | }), 275 | { condition = tex.in_mathzone } 276 | ), 277 | s({ trig = "max", snippetType = "autosnippet" }, fmta("\\max", {}), { condition = tex.in_mathzone }), 278 | s( 279 | { trig = "\\maxl", snippetType = "autosnippet" }, 280 | fmta("\\max\\limits_{<>}", { i(0) }), 281 | { condition = tex.in_mathzone } 282 | ), 283 | s( 284 | { trig = "amin", snippetType = "autosnippet" }, 285 | fmta("\\argmin\\limits_{<>}", { 286 | i(0), 287 | }), 288 | { condition = tex.in_mathzone } 289 | ), 290 | s( 291 | { trig = "amax", snippetType = "autosnippet" }, 292 | fmta("\\argmax\\limits_{<>}", { 293 | i(0), 294 | }), 295 | { condition = tex.in_mathzone } 296 | ), 297 | s( 298 | { trig = "sup", snippetType = "autosnippet" }, 299 | fmta("\\sup\\limits_{<>}", { 300 | i(0), 301 | }), 302 | { condition = tex.in_mathzone } 303 | ), 304 | s( 305 | { trig = "inf", snippetType = "autosnippet" }, 306 | fmta("\\inf\\limits_{<>}", { 307 | i(0), 308 | }), 309 | { condition = tex.in_mathzone } 310 | ), 311 | s( 312 | { trig = ";r", wordTrig = false, snippetType = "autosnippet" }, 313 | fmta("\\frac{<>}{<>}", { 314 | i(1), 315 | i(0), 316 | }), 317 | { condition = tex.in_mathzone } 318 | ), 319 | s( 320 | { trig = ";r", snippetType = "autosnippet", priority = 2000 }, 321 | fmta("\\frac{<>}{<>}", { 322 | d(1, get_visual), 323 | i(0), 324 | }), 325 | { condition = tex.in_mathzone } 326 | ), 327 | s( 328 | { trig = "binom", snippetType = "autosnippet" }, 329 | fmta("\\binom{<>}{<>}", { 330 | i(1), 331 | i(0), 332 | }), 333 | { condition = tex.in_mathzone } 334 | ), 335 | s({ trig = "dd", snippetType = "autosnippet" }, fmta("\\d ", {}), { condition = tex.in_mathzone }), 336 | s({ trig = "poly", snippetType = "autosnippet" }, fmta("\\poly", {}), { condition = tex.in_mathzone }), 337 | s( 338 | { trig = "sq", wordTrig = false, snippetType = "autosnippet" }, 339 | c(1, { sn(nil, { t("\\sqrt{"), i(1), t("}") }), sn(nil, { t("\\sqrt["), i(1), t("]{"), i(2), t("}") }) }), 340 | { condition = tex.in_mathzone } 341 | ), 342 | s( 343 | { trig = "mod", wordTrig = false, snippetType = "autosnippet" }, 344 | fmta("\\mod{<>}", { 345 | i(0), 346 | }), 347 | { condition = tex.in_mathzone } 348 | ), 349 | s( 350 | { trig = "nmod", wordTrig = false, snippetType = "autosnippet", priority = 2000 }, 351 | fmta("\\nmod{<>}", { 352 | i(0), 353 | }), 354 | { condition = tex.in_mathzone } 355 | ), 356 | s( 357 | { trig = "pmod", wordTrig = false, snippetType = "autosnippet", priority = 2000 }, 358 | fmta("\\pmod{<>}", { 359 | i(0), 360 | }), 361 | { condition = tex.in_mathzone } 362 | ), 363 | s( 364 | { trig = "sgn", wordTrig = false, snippetType = "autosnippet", priority = 2000 }, 365 | fmta("\\sgn", {}), 366 | { condition = tex.in_mathzone } 367 | ), 368 | s( 369 | { trig = "gcd", wordTrig = false, snippetType = "autosnippet", priority = 2000 }, 370 | fmta("\\gcd", {}), 371 | { condition = tex.in_mathzone } 372 | ), 373 | s( 374 | { trig = "deg", wordTrig = false, snippetType = "autosnippet", priority = 2000 }, 375 | fmta("\\degree", {}), 376 | { condition = tex.in_mathzone } 377 | ), 378 | s({ trig = "pr", wordTrig = false, snippetType = "autosnippet" }, fmta("\\Pr", {}), { condition = tex.in_mathzone }), 379 | } 380 | -------------------------------------------------------------------------------- /LuaSnip/tex/matrix.lua: -------------------------------------------------------------------------------- 1 | local ls = require("luasnip") 2 | local s = ls.snippet 3 | local sn = ls.snippet_node 4 | local t = ls.text_node 5 | local i = ls.insert_node 6 | local f = ls.function_node 7 | local d = ls.dynamic_node 8 | local fmta = require("luasnip.extras.fmt").fmta 9 | local rep = require("luasnip.extras").rep 10 | local line_begin = require("luasnip.extras.expand_conditions").line_begin 11 | 12 | local tex = require("util.latex") 13 | 14 | local get_visual = function(args, parent) 15 | if #parent.snippet.env.SELECT_RAW > 0 then 16 | return sn(nil, i(1, parent.snippet.env.SELECT_RAW)) 17 | else -- If SELECT_RAW is empty, return a blank insert node 18 | return sn(nil, i(1)) 19 | end 20 | end 21 | 22 | return { 23 | s( 24 | { trig = "bmat", snippetType = "autosnippet" }, 25 | fmta( 26 | [[ 27 | \begin{bmatrix} 28 | <> 29 | \end{bmatrix} 30 | ]], 31 | { 32 | i(0), 33 | } 34 | ), 35 | { condition = tex.in_mathzone } 36 | ), 37 | s( 38 | { trig = "Bmat", snippetType = "autosnippet" }, 39 | fmta( 40 | [[ 41 | \begin{Bmatrix} 42 | <> 43 | \end{Bmatrix} 44 | ]], 45 | { 46 | i(0), 47 | } 48 | ), 49 | { condition = tex.in_mathzone } 50 | ), 51 | s( 52 | { trig = "pmat", snippetType = "autosnippet" }, 53 | fmta( 54 | [[ 55 | \begin{pmatrix} 56 | <> 57 | \end{pmatrix} 58 | ]], 59 | { 60 | i(0), 61 | } 62 | ), 63 | { condition = tex.in_mathzone } 64 | ), 65 | s( 66 | { trig = "Vmat", snippetType = "autosnippet" }, 67 | fmta( 68 | [[ 69 | \begin{Vmatrix} 70 | <> 71 | \end{Vmatrix} 72 | ]], 73 | { 74 | i(0), 75 | } 76 | ), 77 | { condition = tex.in_mathzone } 78 | ), 79 | s( 80 | { trig = "pmat", snippetType = "autosnippet" }, 81 | fmta( 82 | [[ 83 | \pmat{<>} 84 | ]], 85 | { 86 | i(0), 87 | } 88 | ), 89 | { condition = tex.in_mathzone } 90 | ), 91 | s( 92 | { trig = "Bmat", snippetType = "autosnippet" }, 93 | fmta( 94 | [[ 95 | \Bmat{<>} 96 | ]], 97 | { 98 | i(0), 99 | } 100 | ), 101 | { condition = tex.in_mathzone } 102 | ), 103 | s( 104 | { trig = "vmat", snippetType = "autosnippet" }, 105 | fmta( 106 | [[ 107 | \vmat{<>} 108 | ]], 109 | { 110 | i(0), 111 | } 112 | ), 113 | { condition = tex.in_mathzone } 114 | ), 115 | s( 116 | { trig = "Vmat", snippetType = "autosnippet" }, 117 | fmta( 118 | [[ 119 | \Vmat{<>} 120 | ]], 121 | { 122 | i(0), 123 | } 124 | ), 125 | { condition = tex.in_mathzone } 126 | ), 127 | s( 128 | { trig = "pma(%a)", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, 129 | fmta("\\pmat<>{<>}", { 130 | f(function(_, snip) 131 | return snip.captures[1] 132 | end), 133 | i(0), 134 | }), 135 | { condition = tex.in_mathzone } 136 | ), 137 | } 138 | -------------------------------------------------------------------------------- /LuaSnip/tex/physics.lua: -------------------------------------------------------------------------------- 1 | local ls = require("luasnip") 2 | local s = ls.snippet 3 | local sn = ls.snippet_node 4 | local t = ls.text_node 5 | local i = ls.insert_node 6 | local f = ls.function_node 7 | local d = ls.dynamic_node 8 | local fmt = require("luasnip.extras.fmt").fmt 9 | local fmta = require("luasnip.extras.fmt").fmta 10 | local rep = require("luasnip.extras").rep 11 | local line_begin = require("luasnip.extras.expand_conditions").line_begin 12 | 13 | local tex = require("util.latex") 14 | 15 | local get_visual = function(args, parent) 16 | if #parent.snippet.env.SELECT_RAW > 0 then 17 | return sn(nil, t(parent.snippet.env.SELECT_RAW)) 18 | else -- If SELECT_RAW is empty, return a blank insert node 19 | return sn(nil, i(1)) 20 | end 21 | end 22 | 23 | return { 24 | -- -- s( 25 | -- -- { trig = "qb", snippetType = "autosnippet", priority = 2000 }, 26 | -- -- fmta("\\qty(<>)", { 27 | -- -- d(1, get_visual), 28 | -- -- }), 29 | -- -- { condition = tex.in_mathzone } 30 | -- -- ), 31 | -- -- s( 32 | -- -- { trig = "qb", snippetType = "autosnippet" }, 33 | -- -- fmta("\\qty(<>)", { 34 | -- -- i(0), 35 | -- -- }), 36 | -- -- { condition = tex.in_mathzone } 37 | -- -- ), 38 | -- -- s( 39 | -- -- { trig = "qB", snippetType = "autosnippet", priority = 2000 }, 40 | -- -- fmta("\\qty{<>}", { 41 | -- -- d(1, get_visual), 42 | -- -- }), 43 | -- -- { condition = tex.in_mathzone } 44 | -- -- ), 45 | -- -- s( 46 | -- -- { trig = "qB", snippetType = "autosnippet" }, 47 | -- -- fmta("\\qty{<>}", { 48 | -- -- i(0), 49 | -- -- }), 50 | -- -- { condition = tex.in_mathzone } 51 | -- -- ), 52 | -- -- s( 53 | -- -- { trig = "qp", snippetType = "autosnippet", priority = 2000 }, 54 | -- -- fmta("\\qty[<>]", { 55 | -- -- d(1, get_visual), 56 | -- -- }), 57 | -- -- { condition = tex.in_mathzone } 58 | -- -- ), 59 | -- -- s( 60 | -- -- { trig = "qp", snippetType = "autosnippet" }, 61 | -- -- fmta("\\qty[<>]", { 62 | -- -- i(0), 63 | -- -- }), 64 | -- -- { condition = tex.in_mathzone } 65 | -- -- ), 66 | -- -- s( 67 | -- -- { trig = "mb", snippetType = "autosnippet" }, 68 | -- -- fmta("\\mqty(<>)", { 69 | -- -- i(0), 70 | -- -- }), 71 | -- -- { condition = tex.in_mathzone } 72 | -- -- ), 73 | -- -- s( 74 | -- -- { trig = "mB", snippetType = "autosnippet" }, 75 | -- -- fmta("\\mqty{<>}", { 76 | -- -- i(0), 77 | -- -- }), 78 | -- -- { condition = tex.in_mathzone } 79 | -- -- ), 80 | -- -- s( 81 | -- -- { trig = "mp", snippetType = "autosnippet" }, 82 | -- -- fmta("\\mqty[<>]", { 83 | -- -- i(0), 84 | -- -- }), 85 | -- -- { condition = tex.in_mathzone } 86 | -- -- ), 87 | -- -- s( 88 | -- -- { trig = "im", snippetType = "autosnippet" }, 89 | -- -- fmta("\\imat{<>}", { 90 | -- -- i(0), 91 | -- -- }), 92 | -- -- { condition = tex.in_mathzone } 93 | -- -- ), 94 | -- -- s( 95 | -- -- { trig = "xm", snippetType = "autosnippet" }, 96 | -- -- fmta("\\xmat{<>}{<>}{<>}", { 97 | -- -- i(1), 98 | -- -- i(2), 99 | -- -- i(0), 100 | -- -- }), 101 | -- -- { condition = tex.in_mathzone } 102 | -- -- ), 103 | -- -- s( 104 | -- -- { trig = "zm", snippetType = "autosnippet" }, 105 | -- -- fmta("\\zmat{<>}{<>}", { 106 | -- -- i(1), 107 | -- -- i(0), 108 | -- -- }), 109 | -- -- { condition = tex.in_mathzone } 110 | -- -- ), 111 | -- -- s( 112 | -- -- { trig = "pmat", snippetType = "autosnippet" }, 113 | -- -- fmta("\\pmat{<>}", { 114 | -- -- i(0), 115 | -- -- }), 116 | -- -- { condition = tex.in_mathzone } 117 | -- -- ), 118 | -- -- s( 119 | -- -- { trig = "dm", snippetType = "autosnippet" }, 120 | -- -- fmta("\\dmat{<>}", { 121 | -- -- i(0), 122 | -- -- }), 123 | -- -- { condition = tex.in_mathzone } 124 | -- -- ), 125 | -- -- s( 126 | -- -- { trig = "adm", snippetType = "autosnippet" }, 127 | -- -- fmta("\\admat{<>}", { 128 | -- -- i(0), 129 | -- -- }), 130 | -- -- { condition = tex.in_mathzone } 131 | -- -- ), 132 | -- -- s( 133 | -- -- { trig = "comm", snippetType = "autosnippet" }, 134 | -- -- fmta("\\comm{<>}{<>}", { 135 | -- -- i(1), 136 | -- -- i(0), 137 | -- -- }), 138 | -- -- { condition = tex.in_mathzone } 139 | -- -- ), 140 | -- -- s( 141 | -- -- { trig = "acom", snippetType = "autosnippet" }, 142 | -- -- fmta("\\acomm{<>}{<>}", { 143 | -- -- i(1), 144 | -- -- i(0), 145 | -- -- }), 146 | -- -- { condition = tex.in_mathzone } 147 | -- -- ), 148 | -- -- s( 149 | -- -- { trig = "ket", snippetType = "autosnippet", priority = 2000 }, 150 | -- -- fmta("\\ket{<>}", { 151 | -- -- d(1, get_visual), 152 | -- -- }), 153 | -- -- { condition = tex.in_mathzone } 154 | -- -- ), 155 | -- -- s( 156 | -- -- { trig = "ket", snippetType = "autosnippet" }, 157 | -- -- fmta("\\ket{<>}", { 158 | -- -- i(0), 159 | -- -- }), 160 | -- -- { condition = tex.in_mathzone } 161 | -- -- ), 162 | -- -- s( 163 | -- -- { trig = "bra", snippetType = "autosnippet", priority = 2000 }, 164 | -- -- fmta("\\bra{<>}", { 165 | -- -- d(1, get_visual), 166 | -- -- }), 167 | -- -- { condition = tex.in_mathzone } 168 | -- -- ), 169 | -- -- s( 170 | -- -- { trig = "bra", snippetType = "autosnippet" }, 171 | -- -- fmta("\\bra{<>}", { 172 | -- -- i(0), 173 | -- -- }), 174 | -- -- { condition = tex.in_mathzone } 175 | -- -- ), 176 | -- -- s( 177 | -- -- { trig = "norm", snippetType = "autosnippet", priority = 2000 }, 178 | -- -- fmta("\\norm{<>}", { 179 | -- -- d(1, get_visual), 180 | -- -- }), 181 | -- -- { condition = tex.in_mathzone } 182 | -- -- ), 183 | -- -- s( 184 | -- -- { trig = "norm", snippetType = "autosnippet" }, 185 | -- -- fmta("\\norm{<>}", { 186 | -- -- i(0), 187 | -- -- }), 188 | -- -- { condition = tex.in_mathzone } 189 | -- -- ), 190 | -- -- s( 191 | -- -- { trig = "abs", snippetType = "autosnippet", priority = 2000 }, 192 | -- -- fmta("\\abs{<>}", { 193 | -- -- d(1, get_visual), 194 | -- -- }), 195 | -- -- { condition = tex.in_mathzone } 196 | -- -- ), 197 | -- -- s( 198 | -- -- { trig = "abs", snippetType = "autosnippet" }, 199 | -- -- fmta("\\abs*{<>}", { 200 | -- -- i(0), 201 | -- -- }), 202 | -- -- { condition = tex.in_mathzone } 203 | -- -- ), 204 | -- -- s( 205 | -- -- { trig = "vu", snippetType = "autosnippet" }, 206 | -- -- fmta("\\vu{<>}", { 207 | -- -- i(0), 208 | -- -- }), 209 | -- -- { condition = tex.in_mathzone } 210 | -- -- ), 211 | -- -- s( 212 | -- -- { trig = "bk", snippetType = "autosnippet" }, 213 | -- -- fmta("\\ip{<>}{<>}", { 214 | -- -- i(1), 215 | -- -- i(0), 216 | -- -- }), 217 | -- -- { condition = tex.in_mathzone } 218 | -- -- ), 219 | -- -- s( 220 | -- -- { trig = "kb", snippetType = "autosnippet" }, 221 | -- -- fmta("\\op{<>}{<>}", { 222 | -- -- i(1), 223 | -- -- i(0), 224 | -- -- }), 225 | -- -- { condition = tex.in_mathzone } 226 | -- -- ), 227 | -- s( 228 | -- { trig = "ev", snippetType = "autosnippet" }, 229 | -- fmta("\\ev{<>}", { 230 | -- i(0), 231 | -- }), 232 | -- { condition = tex.in_mathzone } 233 | -- ), 234 | -- s( 235 | -- { trig = "mev", snippetType = "autosnippet" }, 236 | -- fmta("\\ev{<>}{<>}", { 237 | -- i(1), 238 | -- i(0), 239 | -- }), 240 | -- { condition = tex.in_mathzone } 241 | -- ), 242 | -- s( 243 | -- { trig = "mel", snippetType = "autosnippet" }, 244 | -- fmta("\\mel{<>}{<>}{<>}", { 245 | -- i(1), 246 | -- i(2), 247 | -- i(0), 248 | -- }), 249 | -- { condition = tex.in_mathzone } 250 | -- ), 251 | -- s( 252 | -- { trig = "mdet", snippetType = "autosnippet" }, 253 | -- fmta("\\mdet{<>}", { 254 | -- i(0), 255 | -- }), 256 | -- { condition = tex.in_mathzone } 257 | -- ), 258 | -- s( 259 | -- { trig = "ord", wordTrig = false, snippetType = "autosnippet" }, 260 | -- fmta("\\order{<>}", { 261 | -- i(0), 262 | -- }), 263 | -- { condition = tex.in_mathzone } 264 | -- ), 265 | -- s( 266 | -- { trig = "qif", wordTrig = false, snippetType = "autosnippet" }, 267 | -- fmta("\\qif", {}), 268 | -- { condition = tex.in_mathzone } 269 | -- ), 270 | -- s( 271 | -- { trig = "qq", wordTrig = false, snippetType = "autosnippet" }, 272 | -- fmta("\\qq{<>}", { 273 | -- i(0), 274 | -- }), 275 | -- { condition = tex.in_mathzone } 276 | -- ), 277 | -- s( 278 | -- { trig = "qor", wordTrig = false, snippetType = "autosnippet" }, 279 | -- fmta("\\qor", {}), 280 | -- { condition = tex.in_mathzone } 281 | -- ), 282 | -- s( 283 | -- { trig = "qif", wordTrig = false, snippetType = "autosnippet" }, 284 | -- fmta("\\qif", {}), 285 | -- { condition = tex.in_mathzone } 286 | -- ), 287 | -- -- s( 288 | -- -- { trig = "dv", wordTrig = false, snippetType = "autosnippet" }, 289 | -- -- fmta("\\dv[<>]{<>}{<>}", { 290 | -- -- i(1), 291 | -- -- i(2), 292 | -- -- i(0), 293 | -- -- }), 294 | -- -- { condition = tex.in_mathzone } 295 | -- -- ), 296 | -- -- s( 297 | -- -- { trig = "pv", wordTrig = false, snippetType = "autosnippet" }, 298 | -- -- fmta("\\pdv{<>}{<>}", { 299 | -- -- i(1), 300 | -- -- i(0), 301 | -- -- }), 302 | -- -- { condition = tex.in_mathzone } 303 | -- -- ), 304 | -- s({ trig = "tr", wordTrig = false, snippetType = "autosnippet" }, fmta("\\tr", {}), { condition = tex.in_mathzone }), 305 | } 306 | -------------------------------------------------------------------------------- /LuaSnip/tex/physics2.lua: -------------------------------------------------------------------------------- 1 | local ls = require("luasnip") 2 | local s = ls.snippet 3 | local sn = ls.snippet_node 4 | local t = ls.text_node 5 | local i = ls.insert_node 6 | local f = ls.function_node 7 | local d = ls.dynamic_node 8 | local fmt = require("luasnip.extras.fmt").fmt 9 | local fmta = require("luasnip.extras.fmt").fmta 10 | local rep = require("luasnip.extras").rep 11 | local line_begin = require("luasnip.extras.expand_conditions").line_begin 12 | 13 | local tex = require("util.latex") 14 | 15 | local get_visual = function(args, parent) 16 | if #parent.snippet.env.SELECT_RAW > 0 then 17 | return sn(nil, t(parent.snippet.env.SELECT_RAW)) 18 | else -- If SELECT_RAW is empty, return a blank insert node 19 | return sn(nil, i(1)) 20 | end 21 | end 22 | 23 | return { 24 | s( 25 | { trig = "bra", wordTrig = false, snippetType = "autosnippet", priority = 1000 }, 26 | fmta("\\bra<<<>|", { 27 | i(1), 28 | }), 29 | { condition = tex.in_mathzone } 30 | ), 31 | s( 32 | { trig = "ket", wordTrig = false, snippetType = "autosnippet", priority = 1000 }, 33 | fmta("\\ket|<>>>", { 34 | i(1), 35 | }), 36 | { condition = tex.in_mathzone } 37 | ), 38 | s( 39 | { trig = "bk", wordTrig = false, snippetType = "autosnippet", priority = 1000 }, 40 | fmta("\\braket<<<>>>", { 41 | i(1), 42 | }), 43 | { condition = tex.in_mathzone } 44 | ), 45 | s( 46 | { trig = "kb", wordTrig = false, snippetType = "autosnippet", priority = 1000 }, 47 | fmta("\\ketbra|<>>><<<>|", { 48 | i(1), 49 | i(2), 50 | }), 51 | { condition = tex.in_mathzone } 52 | ), 53 | s( 54 | { trig = "pab", wordTrig = false, snippetType = "autosnippet", priority = 1000 }, 55 | fmta("\\ab( <> )", { 56 | i(0), 57 | }), 58 | { condition = tex.in_mathzone } 59 | ), 60 | s( 61 | { trig = "Bab", wordTrig = false, snippetType = "autosnippet", priority = 1000 }, 62 | fmta("\\ab\\{ <> \\}", { 63 | i(0), 64 | }), 65 | { condition = tex.in_mathzone } 66 | ), 67 | s( 68 | { trig = "bab", wordTrig = false, snippetType = "autosnippet", priority = 1000 }, 69 | fmta("\\ab[ <> ]", { 70 | i(0), 71 | }), 72 | { condition = tex.in_mathzone } 73 | ), 74 | s( 75 | { trig = "\\forallb", wordTrig = false, snippetType = "autosnippet", priority = 1000 }, 76 | fmta("\\ab<< <> >>", { 77 | i(0), 78 | }), 79 | { condition = tex.in_mathzone } 80 | ), 81 | s( 82 | { trig = "vab", snippetType = "autosnippet" }, 83 | c(1, { sn(nil, { t("\\ab|"), i(1), t("|") }), sn(nil, { t("\\ab*|"), i(1), t("|") }) }), 84 | { condition = tex.in_mathzone } 85 | ), 86 | s( 87 | { trig = "Vab", wordTrig = false, snippetType = "autosnippet", priority = 1000 }, 88 | fmta("\\ab\\| <> \\|", { 89 | i(1), 90 | }), 91 | { condition = tex.in_mathzone } 92 | ), 93 | } 94 | -------------------------------------------------------------------------------- /LuaSnip/tex/py.lua: -------------------------------------------------------------------------------- 1 | local ls = require("luasnip") 2 | local s = ls.snippet 3 | local sn = ls.snippet_node 4 | local t = ls.text_node 5 | local i = ls.insert_node 6 | local f = ls.function_node 7 | local d = ls.dynamic_node 8 | local fmta = require("luasnip.extras.fmt").fmta 9 | local rep = require("luasnip.extras").rep 10 | local line_begin = require("luasnip.extras.expand_conditions").line_begin 11 | local tex = require("util.latex") 12 | local get_visual = function(args, parent) 13 | if #parent.snippet.env.SELECT_RAW > 0 then 14 | return sn(nil, t(parent.snippet.env.SELECT_RAW)) 15 | else -- If SELECT_RAW is empty, return a blank insert node 16 | return sn(nil, i(1)) 17 | end 18 | end 19 | 20 | return { 21 | s( 22 | { trig = "sym", wordTrig = false, snippetType = "autosnippet" }, 23 | fmta("sympy <> sympy", { 24 | i(0), 25 | }), 26 | { condition = tex.in_mathzone } 27 | ), 28 | s( 29 | { trig = "sym", wordTrig = false, snippetType = "autosnippet", priority = 2000 }, 30 | fmta("sympy <> sympy", { 31 | d(1, get_visual), 32 | }), 33 | { condition = tex.in_mathzone } 34 | ), 35 | s( -- This one evaluates anything inside the simpy block 36 | { trig = "sympy.*sympys", regTrig = true, desc = "Sympy block evaluator", snippetType = "autosnippet" }, 37 | d(1, function(_, parent) 38 | -- Gets the part of the block we actually want, and replaces spaces 39 | -- at the beginning and at the end 40 | local to_eval = string.gsub(parent.trigger, "^sympy(.*)sympys", "%1") 41 | to_eval = string.gsub(to_eval, "^%s+(.*)%s+$", "%1") 42 | 43 | local Job = require("plenary.job") 44 | 45 | local sympy_script = string.format( 46 | [[ 47 | from latex2sympy2 import latex2latex 48 | import re 49 | origin = r'%s' 50 | # remove white space 51 | standard = re.sub(r"\\d", "d", origin) 52 | latex = latex2latex(standard) 53 | output = origin + " = " + latex 54 | print(output) 55 | ]], 56 | -- origin = re.sub(r'^\s+|\s+$', '', origin) 57 | -- parsed = parse_expr(origin) 58 | -- output = origin + parsed 59 | -- print_latex(parsed) 60 | to_eval 61 | ) 62 | 63 | sympy_script = string.gsub(sympy_script, "^[\t%s]+", "") 64 | local result = "" 65 | 66 | Job:new({ 67 | command = "python3", 68 | args = { 69 | "-c", 70 | sympy_script, 71 | }, 72 | on_exit = function(j) 73 | result = j:result() 74 | end, 75 | }):sync() 76 | 77 | return sn(nil, t(result)) 78 | end) 79 | ), 80 | s( -- This one evaluates anything inside the simpy block 81 | { trig = "sympy.*sympy ", regTrig = true, desc = "Sympy block evaluator", snippetType = "autosnippet" }, 82 | d(1, function(_, parent) 83 | -- Gets the part of the block we actually want, and replaces spaces 84 | -- at the beginning and at the end 85 | local to_eval = string.gsub(parent.trigger, "^sympy(.*)sympy", "%1") 86 | to_eval = string.gsub(to_eval, "^%s+(.*)%s+$", "%1") 87 | local pattern = { "\\ab" } 88 | local repl = { "" } 89 | for i = 1, #pattern do 90 | to_eval = string.gsub(to_eval, pattern[i], repl[i]) 91 | end 92 | 93 | local Job = require("plenary.job") 94 | 95 | local sympy_script = string.format( 96 | [[ 97 | from sympy import * 98 | from latex2sympy2 import latex2sympy, latex2latex 99 | import re 100 | origin = r'%s' 101 | origin = re.sub(r"\\d", "d", origin) 102 | latex = latex2latex(origin) 103 | print(latex) 104 | ]], 105 | to_eval 106 | ) 107 | 108 | sympy_script = string.gsub(sympy_script, "^[\t%s]+", "") 109 | local result = "" 110 | 111 | Job:new({ 112 | command = "python3", 113 | args = { 114 | "-c", 115 | sympy_script, 116 | }, 117 | on_exit = function(j) 118 | result = j:result() 119 | end, 120 | }):sync() 121 | 122 | return sn(nil, t(result)) 123 | end) 124 | ), 125 | s( 126 | { trig = "qcircuit", wordTrig = false }, 127 | fmta("QCircuit <> QCircuit", { 128 | i(1), 129 | }), 130 | { condition = tex.in_text } 131 | ), 132 | s( 133 | { trig = "qcircuit", wordTrig = false, priority = 2000 }, 134 | fmta("QCircuit <> QCircuit", { 135 | d(1, get_visual), 136 | }), 137 | { condition = tex.in_text } 138 | ), 139 | s( -- This one evaluates anything inside the simpy block 140 | { trig = "QCircuit.*QCircuit ", regTrig = true, desc = "QCircuit block evaluator", snippetType = "autosnippet" }, 141 | d(1, function(_, parent) 142 | -- Gets the part of the block we actually want, and replaces spaces 143 | -- at the beginning and at the end 144 | local to_eval = string.gsub(parent.trigger, "^QCircuit(.*)QCircuit ", "%1") 145 | to_eval = string.gsub(to_eval, "^%s+(.*)%s+$", "%1") 146 | 147 | -- Replace lsh with rsh for to_eval 148 | local pattern = { "ts", "I_?(%d)", "C(%w)", "dagger" } 149 | local repl = { "TensorProduct", "eye(%1)", "controlled_gate_12(%1)", ".conjugate().transpose()" } 150 | for i = 1, #pattern do 151 | to_eval = string.gsub(to_eval, pattern[i], repl[i]) 152 | end 153 | print(to_eval) 154 | 155 | local Job = require("plenary.job") 156 | 157 | local sympy_script = string.format( 158 | [[ 159 | from sympy import * 160 | from sympy.physics.quantum import * 161 | def controlled_gate_12(gate): 162 | return TensorProduct(Matrix([ [1, 0], [0, 0] ]), eye(2))+TensorProduct(Matrix([ [0, 0], [0, 1] ]), gate) 163 | def controlled_gate_21(gate): 164 | return TensorProduct(eye(2), Matrix([ [1, 0], [0, 0] ]))+TensorProduct(gate, Matrix([ [0, 0], [0, 1] ])) 165 | H = Matrix([ [1, 1], [1, -1] ]) / sqrt(2) 166 | X = Matrix([ [0, 1], [1, 0] ]) 167 | Y = Matrix([ [0, -I], [I, 0] ]) 168 | Z = Matrix([ [1, 0], [0, -1] ]) 169 | e1 = Matrix([ [1], [0], [0], [0] ]) 170 | e2 = Matrix([ [0], [1], [0], [0] ]) 171 | e3 = Matrix([ [0], [0], [1], [0] ]) 172 | e4 = Matrix([ [0], [0], [0], [1] ]) 173 | out00 = e1*e1.transpose() 174 | out01 = e2*e2.transpose() 175 | out10 = e3*e3.transpose() 176 | out11 = e4*e4.transpose() 177 | %s 178 | output = latex(res) 179 | print(output) 180 | ]], 181 | to_eval 182 | ) 183 | 184 | sympy_script = string.gsub(sympy_script, "^[\t%s]+", "") 185 | local result = "" 186 | 187 | Job:new({ 188 | command = "python3", 189 | args = { 190 | "-c", 191 | sympy_script, 192 | }, 193 | on_exit = function(j) 194 | result = j:result() 195 | end, 196 | }):sync() 197 | 198 | return sn(nil, t(result)) 199 | end) 200 | ), 201 | s( 202 | { trig = "exd", wordTrig = false, snippetType = "autosnippet" }, 203 | fmta("expand <> expand", { 204 | i(1), 205 | }), 206 | { condition = tex.in_mathzone } 207 | ), 208 | s( -- This one evaluates anything inside the simpy block 209 | { trig = "expand.*expand ", regTrig = true, desc = "expand block evaluator", snippetType = "autosnippet" }, 210 | d(1, function(_, parent) 211 | -- Gets the part of the block we actually want, and replaces spaces 212 | -- at the beginning and at the end 213 | local to_eval = string.gsub(parent.trigger, "^expand(.*)expand ", "%1") 214 | to_eval = string.gsub(to_eval, "^%s+(.*)%s+$", "%1") 215 | local pattern = { "\\ab" } 216 | local repl = { "" } 217 | for i = 1, #pattern do 218 | to_eval = string.gsub(to_eval, pattern[i], repl[i]) 219 | end 220 | 221 | local Job = require("plenary.job") 222 | 223 | local sympy_script = string.format( 224 | [[ 225 | from sympy import * 226 | from latex2sympy2 import latex2sympy, latex2latex 227 | x, y = symbols('x y') 228 | theta = symbols('theta') 229 | origin = r'%s' 230 | expand = latex2sympy(origin).expand() 231 | print(latex(expand)) 232 | ]], 233 | to_eval 234 | ) 235 | 236 | sympy_script = string.gsub(sympy_script, "^[\t%s]+", "") 237 | local result = "" 238 | 239 | Job:new({ 240 | command = "python3", 241 | args = { 242 | "-c", 243 | sympy_script, 244 | }, 245 | on_exit = function(j) 246 | result = j:result() 247 | end, 248 | }):sync() 249 | 250 | return sn(nil, t(result)) 251 | end) 252 | ), 253 | } 254 | -------------------------------------------------------------------------------- /LuaSnip/tex/quantikz.lua: -------------------------------------------------------------------------------- 1 | local ls = require("luasnip") 2 | local s = ls.snippet 3 | local sn = ls.snippet_node 4 | local t = ls.text_node 5 | local i = ls.insert_node 6 | local f = ls.function_node 7 | local c = ls.choice_node 8 | local d = ls.dynamic_node 9 | local fmt = require("luasnip.extras.fmt").fmt 10 | local fmta = require("luasnip.extras.fmt").fmta 11 | local rep = require("luasnip.extras").rep 12 | local line_begin = require("luasnip.extras.expand_conditions").line_begin 13 | 14 | local tex = require("util.latex") 15 | 16 | local get_visual = function(args, parent) 17 | if #parent.snippet.env.SELECT_RAW > 0 then 18 | return sn(nil, t(parent.snippet.env.SELECT_RAW)) 19 | else -- If SELECT_RAW is empty, return a blank insert node 20 | return sn(nil, i(1)) 21 | end 22 | end 23 | 24 | return { 25 | s( 26 | { trig = "bqu", snippetType = "autosnippet" }, 27 | fmta( 28 | [[ 29 | \begin{quantikz} 30 | & <> 31 | \end{quantikz} 32 | ]], 33 | { 34 | i(0), 35 | } 36 | ), 37 | { condition = tex.in_text } 38 | ), 39 | s( 40 | { trig = "cl", snippetType = "autosnippet" }, 41 | c(1, { sn(nil, { t("\\ctrl{"), i(1), t("}") }), sn(nil, { t("\\ctrl["), i(1), t("]{"), i(2), t("}") }) }), 42 | { condition = tex.in_quantikz } 43 | ), 44 | s( 45 | { trig = "ocl", snippetType = "autosnippet", priority = 2000 }, 46 | c(1, { sn(nil, { t("\\octrl{"), i(1), t("}") }), sn(nil, { t("\\octrl["), i(1), t("]{"), i(2), t("}") }) }), 47 | { condition = tex.in_quantikz } 48 | ), 49 | s( 50 | { trig = "tar", snippetType = "autosnippet" }, 51 | c(1, { sn(nil, { t("\\targ{"), i(1), t("}") }), sn(nil, { t("\\targX{"), i(1), t("}") }) }), 52 | { condition = tex.in_quantikz } 53 | ), 54 | s( 55 | { trig = "gate", snippetType = "autosnippet" }, 56 | c(1, { sn(nil, { t("\\gate{"), i(1), t("}") }), sn(nil, { t("\\gate["), i(1), t("]{"), i(2), t("}") }) }), 57 | { condition = tex.in_quantikz } 58 | ), 59 | s( 60 | { trig = "g(%a)", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, 61 | fmta("\\gate{<>}", { 62 | f(function(_, snip) 63 | return snip.captures[1] 64 | end), 65 | }), 66 | { condition = tex.in_quantikz } 67 | ), 68 | s( 69 | { trig = "wire", snippetType = "autosnippet" }, 70 | c(1, { sn(nil, { t("\\wire["), i(1), t("]{"), i(2), t("}") }), sn(nil, { t("\\wire{"), i(1), t("}") }) }), 71 | { condition = tex.in_quantikz } 72 | ), 73 | s( 74 | { trig = "mt", snippetType = "autosnippet" }, 75 | c(1, { sn(nil, { t("\\meter{"), i(1), t("}") }), sn(nil, { t("\\meter["), i(1), t("]{"), i(2), t("}") }) }), 76 | { condition = tex.in_quantikz } 77 | ), 78 | s( 79 | { trig = "phase", snippetType = "autosnippet" }, 80 | fmta("\\phase{<>}", { 81 | i(0), 82 | }), 83 | { condition = tex.in_quantikz } 84 | ), 85 | s( 86 | { trig = "swap", snippetType = "autosnippet" }, 87 | fmta("\\swap{<>}", { 88 | i(0), 89 | }), 90 | { condition = tex.in_quantikz } 91 | ), 92 | s( 93 | { trig = "ls", snippetType = "autosnippet" }, 94 | c(1, { sn(nil, { t("\\lstick{"), i(1), t("}") }), sn(nil, { t("\\lstick["), i(1), t("]{"), i(2), t("}") }) }), 95 | { condition = tex.in_quantikz } 96 | ), 97 | s( 98 | { trig = "rs", snippetType = "autosnippet" }, 99 | c(1, { sn(nil, { t("\\rstick{"), i(1), t("}") }), sn(nil, { t("\\rstick["), i(1), t("]{"), i(2), t("}") }) }), 100 | { condition = tex.in_quantikz } 101 | ), 102 | s( 103 | { trig = "group", snippetType = "autosnippet" }, 104 | fmta("\\gategroup[<>,steps=<>]{<>}", { 105 | i(1), 106 | i(2), 107 | i(0), 108 | }), 109 | { condition = tex.in_quantikz } 110 | ), 111 | s( 112 | { trig = "slice", snippetType = "autosnippet" }, 113 | fmta("\\slice{<>}", { 114 | i(0), 115 | }), 116 | { condition = tex.in_quantikz } 117 | ), 118 | s( 119 | { trig = "push", snippetType = "autosnippet" }, 120 | fmta("\\push{<>}", { 121 | i(0), 122 | }), 123 | { condition = tex.in_quantikz } 124 | ), 125 | s( 126 | { trig = "ms", snippetType = "autosnippet" }, 127 | c(1, { 128 | sn(nil, { t("\\measure{"), i(1), t("}") }), 129 | sn(nil, { t("\\measuretab{"), i(1), t("}") }), 130 | }), 131 | { condition = tex.in_quantikz } 132 | ), 133 | s( 134 | { trig = "ket", snippetType = "autosnippet" }, 135 | fmta("\\ket{<>}", { 136 | i(0), 137 | }), 138 | { condition = tex.in_quantikz } 139 | ), 140 | s( 141 | { trig = "bra", snippetType = "autosnippet" }, 142 | fmta("\\bra{<>}", { 143 | i(0), 144 | }), 145 | { condition = tex.in_quantikz } 146 | ), 147 | s({ trig = "alp", snippetType = "autosnippet", wordTrig = false }, { 148 | t("\\alpha"), 149 | }, { condition = tex.in_quantikz }), 150 | s({ trig = "Alp", snippetType = "autosnippet", wordTrig = false }, { 151 | t("\\Alpha"), 152 | }, { condition = tex.in_quantikz }), 153 | s({ trig = "beta", snippetType = "autosnippet", wordTrig = false }, { 154 | t("\\beta"), 155 | }, { condition = tex.in_quantikz }), 156 | s({ trig = "Beta", snippetType = "autosnippet", wordTrig = false }, { 157 | t("\\Beta"), 158 | }, { condition = tex.in_quantikz }), 159 | s({ trig = "gam", snippetType = "autosnippet", wordTrig = false }, { 160 | t("\\gamma"), 161 | }, { condition = tex.in_quantikz }), 162 | s({ trig = "Gam", snippetType = "autosnippet", wordTrig = false }, { 163 | t("\\Gamma"), 164 | }, { condition = tex.in_quantikz }), 165 | s({ trig = "del", snippetType = "autosnippet", wordTrig = false }, { 166 | t("\\delta"), 167 | }, { condition = tex.in_quantikz }), 168 | s({ trig = "Del", snippetType = "autosnippet", wordTrig = false }, { 169 | t("\\Delta"), 170 | }, { condition = tex.in_quantikz }), 171 | s({ trig = "eps", snippetType = "autosnippet", wordTrig = false }, { 172 | t("\\epsilon"), 173 | }, { condition = tex.in_quantikz }), 174 | s({ trig = "vps", snippetType = "autosnippet", wordTrig = false }, { 175 | t("\\varepsilon"), 176 | }, { condition = tex.in_quantikz }), 177 | s({ trig = "Eps", snippetType = "autosnippet", wordTrig = false }, { 178 | t("\\Epsilon"), 179 | }, { condition = tex.in_quantikz }), 180 | s({ trig = "zeta", snippetType = "autosnippet", wordTrig = false }, { 181 | t("\\zeta"), 182 | }, { condition = tex.in_quantikz }), 183 | s({ trig = "Zeta", snippetType = "autosnippet", wordTrig = false }, { 184 | t("\\Zeta"), 185 | }, { condition = tex.in_quantikz }), 186 | s({ trig = "eta", snippetType = "autosnippet", wordTrig = false }, { 187 | t("\\eta"), 188 | }, { condition = tex.in_quantikz }), 189 | s({ trig = "Eta", snippetType = "autosnippet", wordTrig = false }, { 190 | t("\\Eta"), 191 | }, { condition = tex.in_quantikz }), 192 | s({ trig = "the", snippetType = "autosnippet", wordTrig = false }, { 193 | t("\\theta"), 194 | }, { condition = tex.in_quantikz }), 195 | s({ trig = "The", snippetType = "autosnippet", wordTrig = false }, { 196 | t("\\Theta"), 197 | }, { condition = tex.in_quantikz }), 198 | s({ trig = "iot", snippetType = "autosnippet", wordTrig = false }, { 199 | t("\\iota"), 200 | }, { condition = tex.in_quantikz }), 201 | s({ trig = "Iot", snippetType = "autosnippet", wordTrig = false }, { 202 | t("\\Iota"), 203 | }, { condition = tex.in_quantikz }), 204 | s({ trig = "kap", snippetType = "autosnippet", wordTrig = false }, { 205 | t("\\kappa"), 206 | }, { condition = tex.in_quantikz }), 207 | s({ trig = "Kap", snippetType = "autosnippet", wordTrig = false }, { 208 | t("\\Kappa"), 209 | }, { condition = tex.in_quantikz }), 210 | s({ trig = "lam", snippetType = "autosnippet", wordTrig = false }, { 211 | t("\\lambda"), 212 | }, { condition = tex.in_quantikz }), 213 | s({ trig = "Lam", snippetType = "autosnippet", wordTrig = false }, { 214 | t("\\Lambda"), 215 | }, { condition = tex.in_quantikz }), 216 | s({ trig = "mu", snippetType = "autosnippet", wordTrig = false }, { 217 | t("\\mu"), 218 | }, { condition = tex.in_quantikz }), 219 | s({ trig = "Mu", snippetType = "autosnippet", wordTrig = false }, { 220 | t("\\Mu"), 221 | }, { condition = tex.in_quantikz }), 222 | s({ trig = "nu", snippetType = "autosnippet", wordTrig = false }, { 223 | t("\\nu"), 224 | }, { condition = tex.in_quantikz }), 225 | s({ trig = "Nu", snippetType = "autosnippet", wordTrig = false }, { 226 | t("\\Nu"), 227 | }, { condition = tex.in_quantikz }), 228 | -- s({ trig = "xi", snippetType = "autosnippet", wordTrig = false }, { 229 | -- t("\\xi"), 230 | -- }, { condition = tex.in_quantikz }), 231 | -- s({ trig = "Xi", snippetType = "autosnippet", wordTrig = false }, { 232 | -- t("\\Xi"), 233 | -- }, { condition = tex.in_quantikz }), 234 | s({ trig = "omi", snippetType = "autosnippet", wordTrig = false }, { 235 | t("\\omicron"), 236 | }, { condition = tex.in_quantikz }), 237 | s({ trig = "pi", snippetType = "autosnippet", wordTrig = false }, { 238 | t("\\pi"), 239 | }, { condition = tex.in_quantikz }), 240 | s({ trig = "\\pii", snippetType = "autosnippet", wordTrig = false, priority = 2000 }, { 241 | t("p_i"), 242 | }, { condition = tex.in_quantikz }), 243 | s({ trig = "Pi", snippetType = "autosnippet", wordTrig = false }, { 244 | t("\\Pi"), 245 | }, { condition = tex.in_quantikz }), 246 | s({ trig = "rho", snippetType = "autosnippet", wordTrig = false }, { 247 | t("\\rho"), 248 | }, { condition = tex.in_quantikz }), 249 | s({ trig = "Rho", snippetType = "autosnippet", wordTrig = false }, { 250 | t("\\Rho"), 251 | }, { condition = tex.in_quantikz }), 252 | s({ trig = "sig", snippetType = "autosnippet", wordTrig = false }, { 253 | t("\\sigma"), 254 | }, { condition = tex.in_quantikz }), 255 | s({ trig = "Sig", snippetType = "autosnippet", wordTrig = false }, { 256 | t("\\Sigma"), 257 | }, { condition = tex.in_quantikz }), 258 | s({ trig = "tau", snippetType = "autosnippet", wordTrig = false }, { 259 | t("\\tau"), 260 | }, { condition = tex.in_quantikz }), 261 | s({ trig = "Tau", snippetType = "autosnippet", wordTrig = false }, { 262 | t("\\Tau"), 263 | }, { condition = tex.in_quantikz }), 264 | s({ trig = "ups", snippetType = "autosnippet", wordTrig = false }, { 265 | t("\\ups"), 266 | }, { condition = tex.in_quantikz }), 267 | s({ trig = "Ups", snippetType = "autosnippet", wordTrig = false }, { 268 | t("\\Ups"), 269 | }, { condition = tex.in_quantikz }), 270 | s({ trig = "phi", snippetType = "autosnippet", wordTrig = false }, { 271 | t("\\phi"), 272 | }, { condition = tex.in_quantikz }), 273 | s({ trig = "Phi", snippetType = "autosnippet", wordTrig = false }, { 274 | t("\\Phi"), 275 | }, { condition = tex.in_quantikz }), 276 | s({ trig = "vhi", snippetType = "autosnippet", wordTrig = false }, { 277 | t("\\varphi"), 278 | }, { condition = tex.in_quantikz }), 279 | s({ trig = "Vhi", snippetType = "autosnippet", wordTrig = false }, { 280 | t("\\Varphi"), 281 | }, { condition = tex.in_quantikz }), 282 | s({ trig = "chi", snippetType = "autosnippet", wordTrig = false }, { 283 | t("\\chi"), 284 | }, { condition = tex.in_quantikz }), 285 | s({ trig = "Chi", snippetType = "autosnippet", wordTrig = false }, { 286 | t("\\Chi"), 287 | }, { condition = tex.in_quantikz }), 288 | s({ trig = "psi", snippetType = "autosnippet", wordTrig = false }, { 289 | t("\\psi"), 290 | }, { condition = tex.in_quantikz }), 291 | s({ trig = "Psi", snippetType = "autosnippet", wordTrig = false }, { 292 | t("\\Psi"), 293 | }, { condition = tex.in_quantikz }), 294 | s({ trig = "ome", snippetType = "autosnippet", wordTrig = false }, { 295 | t("\\omega"), 296 | }, { condition = tex.in_quantikz }), 297 | s({ trig = "Ome", snippetType = "autosnippet", wordTrig = false }, { 298 | t("\\Omega"), 299 | }, { condition = tex.in_quantikz }), 300 | } 301 | -------------------------------------------------------------------------------- /LuaSnip/tex/symbol-short.lua: -------------------------------------------------------------------------------- 1 | local ls = require("luasnip") 2 | local s = ls.snippet 3 | local sn = ls.snippet_node 4 | local t = ls.text_node 5 | local i = ls.insert_node 6 | local f = ls.function_node 7 | local d = ls.dynamic_node 8 | local fmt = require("luasnip.extras.fmt").fmt 9 | local fmta = require("luasnip.extras.fmt").fmta 10 | local rep = require("luasnip.extras").rep 11 | local line_begin = require("luasnip.extras.expand_conditions").line_begin 12 | 13 | local tex = require("util.latex") 14 | 15 | local get_visual = function(args, parent) 16 | if #parent.snippet.env.SELECT_RAW > 0 then 17 | return sn(nil, i(1, parent.snippet.env.SELECT_RAW)) 18 | else -- If SELECT_RAW is empty, return a blank insert node 19 | return sn(nil, i(1)) 20 | end 21 | end 22 | 23 | return { 24 | s({ trig = "...", wordTrig = false, snippetType = "autosnippet" }, { 25 | t("\\dots"), 26 | }, { condition = tex.in_mathzone }), 27 | s({ trig = "c.", wordTrig = false, snippetType = "autosnippet" }, { 28 | t("\\cdot"), 29 | }, { condition = tex.in_mathzone }), 30 | s({ trig = "\\cdot.", wordTrig = false, snippetType = "autosnippet" }, { 31 | t("\\cdots"), 32 | }, { condition = tex.in_mathzone }), 33 | s({ trig = "v.", wordTrig = false, snippetType = "autosnippet" }, { 34 | t("\\vdot"), 35 | }, { condition = tex.in_mathzone }), 36 | s({ trig = "\\vdot.", wordTrig = false, snippetType = "autosnippet" }, { 37 | t("\\vdots"), 38 | }, { condition = tex.in_mathzone }), 39 | s({ trig = "iff", wordTrig = false, snippetType = "autosnippet" }, { 40 | t("\\iff"), 41 | }, { condition = tex.in_mathzone }), 42 | s({ trig = "inn", wordTrig = false, snippetType = "autosnippet" }, { 43 | t("\\in"), 44 | }, { condition = tex.in_mathzone }), 45 | s({ trig = "notin", wordTrig = false, snippetType = "autosnippet" }, { 46 | t("not\\in"), 47 | }, { condition = tex.in_mathzone }), 48 | s({ trig = "aa", wordTrig = false, snippetType = "autosnippet" }, { 49 | t("\\forall"), 50 | }, { condition = tex.in_mathzone }), 51 | s({ trig = "ee", wordTrig = false, snippetType = "autosnippet" }, { 52 | t("\\exists"), 53 | }, { condition = tex.in_mathzone }), 54 | s({ trig = "!=", wordTrig = false, snippetType = "autosnippet" }, { 55 | t("\\neq"), 56 | }, { condition = tex.in_mathzone }), 57 | s({ trig = "==", wordTrig = false, snippetType = "autosnippet" }, { 58 | t("&="), 59 | }, { condition = tex.in_mathzone }), 60 | s({ trig = "~=", wordTrig = false, snippetType = "autosnippet" }, { 61 | t("\\approx"), 62 | }, { condition = tex.in_mathzone }), 63 | s({ trig = "~~", wordTrig = false, snippetType = "autosnippet" }, { 64 | t("\\sim"), 65 | }, { condition = tex.in_mathzone }), 66 | s({ trig = ">=", wordTrig = false, snippetType = "autosnippet" }, { 67 | t("\\geq"), 68 | }, { condition = tex.in_mathzone }), 69 | s({ trig = "<=", wordTrig = false, snippetType = "autosnippet" }, { 70 | t("\\leq"), 71 | }, { condition = tex.in_mathzone }), 72 | s({ trig = ">>", wordTrig = false, snippetType = "autosnippet" }, { 73 | t("\\gg"), 74 | }, { condition = tex.in_mathzone }), 75 | s({ trig = "<<", wordTrig = false, snippetType = "autosnippet" }, { 76 | t("\\ll"), 77 | }, { condition = tex.in_mathzone }), 78 | s({ trig = "cp", wordTrig = false, snippetType = "autosnippet" }, { 79 | t("\\cp"), 80 | }, { condition = tex.in_mathzone }), 81 | s({ trig = "get", wordTrig = false, snippetType = "autosnippet" }, { 82 | t("\\get"), 83 | }, { condition = tex.in_mathzone }), 84 | s({ trig = "to", wordTrig = false, snippetType = "autosnippet" }, { 85 | t("\\to"), 86 | }, { condition = tex.in_mathzone }), 87 | s({ trig = "mto", wordTrig = false, snippetType = "autosnippet", priority = 1001 }, { 88 | t("\\mapsto"), 89 | }, { condition = tex.in_mathzone }), 90 | s({ trig = "\\\\\\", wordTrig = false, snippetType = "autosnippet" }, { 91 | t("\\setminus"), 92 | }, { condition = tex.in_mathzone }), 93 | s({ trig = "||", wordTrig = false, snippetType = "autosnippet" }, { 94 | t("\\mid"), 95 | }, { condition = tex.in_mathzone }), 96 | s({ trig = "mid", wordTrig = false, snippetType = "autosnippet" }, { 97 | t("\\mid"), 98 | }, { condition = tex.in_mathzone }), 99 | s({ trig = "nmid", wordTrig = false, snippetType = "autosnippet", priority = 2000 }, { 100 | t("\\nmid"), 101 | }, { condition = tex.in_mathzone }), 102 | s({ trig = "sr", wordTrig = false, snippetType = "autosnippet" }, { 103 | t("^2"), 104 | }, { condition = tex.in_mathzone }), 105 | s({ trig = "cb", wordTrig = false, snippetType = "autosnippet" }, { 106 | t("^3"), 107 | }, { condition = tex.in_mathzone }), 108 | s({ trig = "inv", wordTrig = false, snippetType = "autosnippet" }, { 109 | t("^{-1}"), 110 | }, { condition = tex.in_mathzone }), 111 | s({ trig = "**", wordTrig = false, snippetType = "autosnippet" }, { 112 | t("^*"), 113 | }, { condition = tex.in_mathzone }), 114 | s({ trig = " ", wordTrig = false, snippetType = "autosnippet" }, { 115 | t("\\,"), 116 | }, { condition = tex.in_mathzone }), 117 | s({ trig = "<>", wordTrig = false, snippetType = "autosnippet" }, { 118 | t("\\diamond"), 119 | }, { condition = tex.in_mathzone }), 120 | s({ trig = "+-", wordTrig = false, snippetType = "autosnippet" }, { 121 | t("\\pm"), 122 | }, { condition = tex.in_mathzone }), 123 | s({ trig = "-+", wordTrig = false, snippetType = "autosnippet" }, { 124 | t("\\mp"), 125 | }, { condition = tex.in_mathzone }), 126 | s({ trig = "rhs", wordTrig = false, snippetType = "autosnippet" }, { 127 | t("\\mathrm{R.H.S}"), 128 | }, { condition = tex.in_mathzone }), 129 | s({ trig = "lhs", wordTrig = false, snippetType = "autosnippet" }, { 130 | t("\\mathrm{L.H.S}"), 131 | }, { condition = tex.in_mathzone }), 132 | s({ trig = "cap", wordTrig = false, snippetType = "autosnippet" }, { 133 | t("\\cap"), 134 | }, { condition = tex.in_mathzone }), 135 | s({ trig = "cup", wordTrig = false, snippetType = "autosnippet" }, { 136 | t("\\cup"), 137 | }, { condition = tex.in_mathzone }), 138 | s({ trig = "sub", wordTrig = false, snippetType = "autosnippet" }, { 139 | t("\\subseteq"), 140 | }, { condition = tex.in_mathzone }), 141 | -- s({ trig = "sup", wordTrig = false, snippetType = "autosnippet" }, { 142 | -- t("\\supseteq"), 143 | -- }, { condition = tex.in_mathzone }), 144 | s({ trig = "oo", wordTrig = false, snippetType = "autosnippet" }, { 145 | t("\\infty"), 146 | }, { condition = tex.in_mathzone }), 147 | s({ trig = "tp", wordTrig = false, snippetType = "autosnippet" }, { 148 | t("^\\top"), 149 | }, { condition = tex.in_mathzone }), 150 | s({ trig = "dr", wordTrig = false, snippetType = "autosnippet" }, { 151 | t("^\\dagger"), 152 | }, { condition = tex.in_mathzone }), 153 | s({ trig = "perp", wordTrig = false, snippetType = "autosnippet" }, { 154 | t("^\\perp"), 155 | }, { condition = tex.in_mathzone }), 156 | s({ trig = "ss", wordTrig = false, snippetType = "autosnippet" }, { 157 | t("\\star"), 158 | }, { condition = tex.in_mathzone }), 159 | s({ trig = "xx", wordTrig = false, snippetType = "autosnippet" }, { 160 | t("\\times"), 161 | }, { condition = tex.in_mathzone }), 162 | s({ trig = "=>", wordTrig = false, snippetType = "autosnippet" }, { 163 | t("\\implies"), 164 | }, { condition = tex.in_mathzone }), 165 | s({ trig = "llr", wordTrig = false, snippetType = "autosnippet" }, { 166 | t("\\longleftrightarrow"), 167 | }, { condition = tex.in_mathzone }), 168 | s({ trig = "cir", wordTrig = false, snippetType = "autosnippet" }, { 169 | t("\\circ"), 170 | }, { condition = tex.in_mathzone }), 171 | s({ trig = "iso", wordTrig = false, snippetType = "autosnippet" }, { 172 | t("\\cong"), 173 | }, { condition = tex.in_mathzone }), 174 | s({ trig = "ihbar", wordTrig = false, snippetType = "autosnippet", priority = 2000 }, { 175 | t("i\\hbar"), 176 | }, { condition = tex.in_mathzone }), 177 | s({ trig = "hbar", wordTrig = false, snippetType = "autosnippet" }, { 178 | t("\\hbar"), 179 | }, { condition = tex.in_mathzone }), 180 | s({ trig = "ns", wordTrig = false, snippetType = "autosnippet" }, { 181 | t("\\unlhd"), 182 | }, { condition = tex.in_mathzone }), 183 | s({ trig = "eqv", wordTrig = false, snippetType = "autosnippet" }, { 184 | t("\\equiv"), 185 | }, { condition = tex.in_mathzone }), 186 | s({ trig = "##", wordTrig = false, snippetType = "autosnippet" }, { 187 | t("\\#"), 188 | }, { condition = tex.in_mathzone }), 189 | s({ trig = "ell", wordTrig = false, snippetType = "autosnippet", priority = 2000 }, { 190 | t("\\ell"), 191 | }, { condition = tex.in_mathzone }), 192 | s({ trig = "ot", wordTrig = false, snippetType = "autosnippet" }, { 193 | t("\\otimes"), 194 | }, { condition = tex.in_mathzone }), 195 | s({ trig = "op", wordTrig = false, snippetType = "autosnippet" }, { 196 | t("\\oplus"), 197 | }, { condition = tex.in_mathzone }), 198 | s({ trig = "not", wordTrig = false, snippetType = "autosnippet", priority = 2000 }, { 199 | t("\\not"), 200 | }, { condition = tex.in_mathzone }), 201 | s({ trig = "par", wordTrig = false, snippetType = "autosnippet", priority = 2000 }, { 202 | t("\\partial"), 203 | }, { condition = tex.in_mathzone }), 204 | s({ trig = "land", snippetType = "autosnippet" }, { 205 | t("\\land"), 206 | }, { condition = tex.in_mathzone }), 207 | s({ trig = "lor", snippetType = "autosnippet" }, { 208 | t("\\lor"), 209 | }, { condition = tex.in_mathzone }), 210 | s( 211 | { trig = "jk", wordTrig = false, snippetType = "autosnippet" }, 212 | fmta( 213 | [[ 214 | _{<>} 215 | ]], 216 | { i(1) } 217 | ), 218 | { condition = tex.in_mathzone } 219 | ), 220 | s( 221 | { trig = "kj", wordTrig = false, snippetType = "autosnippet" }, 222 | fmta( 223 | [[ 224 | ^{<>} 225 | ]], 226 | { i(1) } 227 | ), 228 | { condition = tex.in_mathzone } 229 | ), 230 | } 231 | -------------------------------------------------------------------------------- /LuaSnip/tex/temporary.lua: -------------------------------------------------------------------------------- 1 | local ls = require("luasnip") 2 | local s = ls.snippet 3 | local sn = ls.snippet_node 4 | local t = ls.text_node 5 | local i = ls.insert_node 6 | local f = ls.function_node 7 | local d = ls.dynamic_node 8 | local fmt = require("luasnip.extras.fmt").fmt 9 | local fmta = require("luasnip.extras.fmt").fmta 10 | local rep = require("luasnip.extras").rep 11 | local line_begin = require("luasnip.extras.expand_conditions").line_begin 12 | 13 | local tex = require("util.latex") 14 | 15 | local get_visual = function(args, parent) 16 | if #parent.snippet.env.SELECT_RAW > 0 then 17 | return sn(nil, i(1, parent.snippet.env.SELECT_RAW)) 18 | else -- If SELECT_RAW is empty, return a blank insert node 19 | return sn(nil, i(1)) 20 | end 21 | end 22 | 23 | return { 24 | -- s({ trig = "sp", snippetType = "autosnippet" }, fmta("\\hat{\\$}", {}), { condition = tex.in_mathzone }), 25 | -- s({ trig = "T", snippetType = "autosnippet" }, fmta("\\mathcal{T}", {}), { condition = tex.in_mathzone }), 26 | -- s({ trig = "tv", snippetType = "autosnippet" }, fmta("\\mathrm{TV}", {}), { condition = tex.in_mathzone }), 27 | -- s({ trig = "ce", snippetType = "autosnippet" }, fmta("\\mathrm{couple}", {}), { condition = tex.in_mathzone }), 28 | -- s({ trig = "mix", snippetType = "autosnippet" }, fmta("\\mathrm{mix}", {}), { condition = tex.in_mathzone }), 29 | } 30 | -------------------------------------------------------------------------------- /LuaSnip/tex/text.lua: -------------------------------------------------------------------------------- 1 | local ls = require("luasnip") 2 | local c = ls.choice_node 3 | local s = ls.snippet 4 | local t = ls.text_node 5 | local i = ls.insert_node 6 | local fmta = require("luasnip.extras.fmt").fmta 7 | local tex = require("util.latex") 8 | 9 | return { 10 | s({ trig = "dps", snippetType = "autosnippet" }, { 11 | t("\\displaystyle"), 12 | }, { condition = tex.in_mathzone }), 13 | s({ trig = "if", snippetType = "autosnippet" }, { 14 | t("\\text{\\ if\\ }"), 15 | }, { condition = tex.in_mathzone }), 16 | s({ trig = "or", snippetType = "autosnippet" }, { t("\\text{\\ or\\ }") }, { condition = tex.in_mathzone }), 17 | s({ trig = "otherwise", snippetType = "autosnippet" }, { 18 | t("\\text{\\ otherwise\\ }"), 19 | }, { condition = tex.in_mathzone }), 20 | s({ trig = "then", snippetType = "autosnippet" }, { 21 | t("\\text{\\ then\\ }"), 22 | }, { condition = tex.in_mathzone }), 23 | s({ trig = "since", snippetType = "autosnippet" }, { 24 | t("\\text{\\ since\\ }"), 25 | }, { condition = tex.in_mathzone }), 26 | s({ trig = "by", snippetType = "autosnippet" }, { 27 | t("\\text{\\ by\\ }"), 28 | }, { condition = tex.in_mathzone }), 29 | s({ trig = "and", snippetType = "autosnippet" }, { 30 | t("\\text{\\ and\\ }"), 31 | }, { condition = tex.in_mathzone }), 32 | 33 | s({ trig = "label", snippetType = "autosnippet" }, { 34 | t("\\label{"), 35 | i(0), 36 | t("}"), 37 | }, { condition = tex.in_text, show_condition = tex.in_text }), 38 | 39 | s({ trig = "wlog", snippetType = "autosnippet" }, { 40 | t("without loss of generality"), 41 | }, { condition = tex.in_text }), 42 | s({ trig = "Wlog", snippetType = "autosnippet" }, { 43 | t("Without loss of generality"), 44 | }, { condition = tex.in_text }), 45 | s({ trig = "%%", snippetType = "autosnippet" }, { 46 | t("\\%"), 47 | }, { condition = tex.in_text }), 48 | s({ trig = "&&", snippetType = "autosnippet" }, { 49 | t("\\&"), 50 | }, { condition = tex.in_text }), 51 | s({ trig = "##", snippetType = "autosnippet" }, { 52 | t("\\#"), 53 | }, { condition = tex.in_text }), 54 | s({ trig = "thm", snippetType = "autosnippet" }, { 55 | t("theorem"), 56 | }, { condition = tex.in_text }), 57 | s({ trig = "propp", snippetType = "autosnippet" }, { 58 | t("proposition"), 59 | }, { condition = tex.in_text }), 60 | s({ trig = "deff", snippetType = "autosnippet" }, { 61 | t("definition"), 62 | }, { condition = tex.in_text }), 63 | s({ trig = "exaa", snippetType = "autosnippet" }, { 64 | t("example"), 65 | }, { condition = tex.in_text }), 66 | s({ trig = "iee", snippetType = "autosnippet" }, { 67 | t("i.e."), 68 | }, { condition = tex.in_text }), 69 | s({ trig = "stt", snippetType = "autosnippet" }, { 70 | t("such that"), 71 | }, { condition = tex.in_text }), 72 | s({ trig = "iff", snippetType = "autosnippet" }, { 73 | t("if and only if"), 74 | }, { condition = tex.in_text }), 75 | s({ trig = "iso" }, { 76 | t("isomorphic"), 77 | }, { condition = tex.in_text }), 78 | s({ trig = "iso" }, { 79 | t("isomorphism"), 80 | }, { condition = tex.in_text }), 81 | s({ trig = "homo" }, { 82 | t("homomorphism"), 83 | }, { condition = tex.in_text }), 84 | s({ trig = "homo" }, { 85 | t("homomorphic"), 86 | }, { condition = tex.in_text }), 87 | -- s({ trig = "psp", snippetType = "autosnippet" }, { 88 | -- t("\\(p\\)-subgroup"), 89 | -- }, { condition = tex.in_text }), 90 | -- s({ trig = "pgp", snippetType = "autosnippet" }, { 91 | -- t("\\(p\\)-subgroup"), 92 | -- }, { condition = tex.in_text }), 93 | -- s({ trig = "spsp", snippetType = "autosnippet" }, { 94 | -- t("Sylow \\(p\\)-subgroup"), 95 | -- }, { condition = tex.in_text }), 96 | s({ trig = "=>", snippetType = "autosnippet" }, { 97 | t("\\(\\implies\\)"), 98 | }, { condition = tex.in_text }), 99 | s({ trig = "pid", snippetType = "autosnippet" }, { 100 | t("P.I.D."), 101 | }, { condition = tex.in_text }), 102 | s({ trig = "ufd", snippetType = "autosnippet" }, { 103 | t("U.F.D."), 104 | }, { condition = tex.in_text }), 105 | s({ trig = "ed", snippetType = "autosnippet" }, { 106 | t("E.D."), 107 | }, { condition = tex.in_text }), 108 | s( 109 | { trig = "homework" }, 110 | fmta( 111 | [[ 112 | \documentclass{article} 113 | \newcommand{\Class}{<>} 114 | \newcommand{\Title}{Homework <>} 115 | \input{~/Documents/Latex/Package_elegantbook.tex} 116 | \input{~/Documents/Latex/Sample_Homework.tex} 117 | \begin{document} 118 | \begin{spacing}{1.1} 119 | \maketitle \thispagestyle{empty} 120 | 121 | <> 122 | 123 | \end{spacing} 124 | \end{document} 125 | ]], 126 | { 127 | c( 128 | 1, 129 | { 130 | t("Abstract Algebra"), 131 | t("Mathematics for Artificial Intelligence"), 132 | t("Quantum Computer Science"), 133 | t("Algebra and Computation"), 134 | } 135 | ), 136 | i(2, "number"), 137 | i(0), 138 | } 139 | ), 140 | { condition = tex.in_text } 141 | ), 142 | } 143 | -------------------------------------------------------------------------------- /LuaSnip/tex/tikz.lua: -------------------------------------------------------------------------------- 1 | local ls = require("luasnip") 2 | local s = ls.snippet 3 | local sn = ls.snippet_node 4 | local t = ls.text_node 5 | local f = ls.function_node 6 | local i = ls.insert_node 7 | local d = ls.dynamic_node 8 | local fmta = require("luasnip.extras.fmt").fmta 9 | local rep = require("luasnip.extras").rep 10 | local line_begin = require("luasnip.extras.expand_conditions").line_begin 11 | local tex = require("util.latex") 12 | 13 | local get_visual = function(args, parent) 14 | if #parent.snippet.env.SELECT_RAW > 0 then 15 | return sn(nil, t(parent.snippet.env.SELECT_RAW)) 16 | else -- If SELECT_RAW is empty, return a blank insert node 17 | return sn(nil, i(1)) 18 | end 19 | end 20 | 21 | return { 22 | s({ trig = "vsp", snippetType = "autosnippet" }, { 23 | t("\\vspace{\\baselineskip}"), 24 | }), 25 | s( 26 | { trig = "bti", snippetType = "autosnippet" }, 27 | fmta( 28 | [[ 29 | \begin{tikzpicture}<> 30 | <> 31 | \end{tikzpicture} 32 | ]], 33 | { 34 | c(1, { t("[overlay,remember picture,>=stealth,nodes={align=left,inner ysep=1pt},<-]"), t("") }), 35 | i(0), 36 | } 37 | ), 38 | { condition = line_begin } 39 | ), 40 | s( 41 | { trig = "tm", snippetType = "autosnippet" }, 42 | fmta( 43 | [[ 44 | \tikzmarknode{<>}{<>} 45 | ]], 46 | { 47 | i(1, "markname"), 48 | i(0), 49 | } 50 | ), 51 | { condition = tex.in_tikz } 52 | ), 53 | s( 54 | { trig = "tm", snippetType = "autosnippet", priority = 2000 }, 55 | fmta( 56 | [[ 57 | \tikzmarknode{<>}{<>} 58 | ]], 59 | { 60 | i(1, "markname"), 61 | d(2, get_visual), 62 | } 63 | ), 64 | { condition = tex.in_mathzone } 65 | ), 66 | s( 67 | { trig = "lu", snippetType = "autosnippet", dscr = "Left up annotate" }, 68 | fmta( 69 | [[ 70 | \path (<>.north) ++ (0,1em) node[anchor=south east,color=<>!67] (<>_node){<>}; 71 | \draw [color=<>!57](<>.north) |- ([xshift=-0.3ex,color=<>]<>_node.south west); 72 | ]], 73 | { 74 | i(1, "markname"), 75 | i(2, "color"), 76 | rep(1), 77 | i(3, "text"), 78 | rep(2), 79 | rep(1), 80 | rep(2), 81 | rep(1), 82 | } 83 | ), 84 | { condition = tex.in_tikz } 85 | ), 86 | s( 87 | { trig = "rd", snippetType = "autosnippet", dscr = "Right down annotate" }, 88 | fmta( 89 | [[ 90 | \path (<>.south) ++ (0,-0.8em) node[anchor=north west,color=<>!67] (<>_node){<>}; 91 | \draw [color=<>!57](<>.south) |- ([xshift=-0.3ex,color=<>]<>_node.south east); 92 | ]], 93 | { 94 | i(1, "markname"), 95 | i(2, "color"), 96 | rep(1), 97 | i(3, "text"), 98 | rep(2), 99 | rep(1), 100 | rep(2), 101 | rep(1), 102 | } 103 | ), 104 | { condition = tex.in_tikz } 105 | ), 106 | s( 107 | { trig = "ld", snippetType = "autosnippet", dscr = "Left down annotate" }, 108 | fmta( 109 | [[ 110 | \path (<>.south) ++ (0,-0.8em) node[anchor=north east,color=<>!67] (<>_node){<>}; 111 | \draw [color=<>!57](<>.south) |- ([xshift=-0.3ex,color=<>]<>_node.south west); 112 | ]], 113 | { 114 | i(1, "markname"), 115 | i(2, "color"), 116 | rep(1), 117 | i(3, "text"), 118 | rep(2), 119 | rep(1), 120 | rep(2), 121 | rep(1), 122 | } 123 | ), 124 | { condition = tex.in_tikz } 125 | ), 126 | s( 127 | { trig = "hl", snippetType = "autosnippet" }, 128 | fmta( 129 | [[ 130 | \hlmath{<>}{<>} 131 | ]], 132 | { 133 | i(1, "red"), 134 | i(2), 135 | } 136 | ), 137 | { condition = tex.in_mathzone } 138 | ), 139 | s( 140 | { trig = "hl", snippetType = "autosnippet", priority = 2000 }, 141 | fmta( 142 | [[ 143 | \hlmath{<>}{<>} 144 | ]], 145 | { 146 | i(1, "red"), 147 | d(2, get_visual), 148 | } 149 | ), 150 | { condition = tex.in_mathzone } 151 | ), 152 | s( 153 | { trig = "hl", snippetType = "autosnippet" }, 154 | fmta( 155 | [[ 156 | \hltext{<>}{<>} 157 | ]], 158 | { 159 | i(1, "red"), 160 | i(2), 161 | } 162 | ), 163 | { condition = tex.in_text } 164 | ), 165 | s( 166 | { trig = "hl", snippetType = "autosnippet", priority = 2000 }, 167 | fmta( 168 | [[ 169 | \hltext{<>}{<>} 170 | ]], 171 | { 172 | i(1, "red"), 173 | d(2, get_visual), 174 | } 175 | ), 176 | { condition = tex.in_text } 177 | ), 178 | } 179 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Personal Neovim config 2 | 3 | :exclamation: Noevim config is now in my [dotfiles](https://github.com/Fireond/dotfiles/tree/main/nvim/.config/nvim). 4 | 5 | Neovim config for writing latex and markdown. Using [LazyVim](https://github.com/LazyVim/LazyVim) as starter. 6 | -------------------------------------------------------------------------------- /after/ftplugin/tex.lua: -------------------------------------------------------------------------------- 1 | vim.opt.conceallevel = 2 2 | 3 | vim.keymap.set({ "n", "i" }, "", "TexlabForward", { desc = "Forward search" }) 4 | vim.keymap.set({ "n", "i" }, "", function() 5 | require("util.latex").format() 6 | end, { desc = "Build" }) 7 | -------------------------------------------------------------------------------- /init.lua: -------------------------------------------------------------------------------- 1 | -- bootstrap lazy.nvim, LazyVim and your plugins 2 | require("config.lazy") 3 | -------------------------------------------------------------------------------- /lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "LazyVim": { "branch": "main", "commit": "fb1f29c32c516601b4074d113202482769ef030e" }, 3 | "LuaSnip": { "branch": "master", "commit": "0b4950a237ce441a6a3a947d501622453f6860ea" }, 4 | "alpha-nvim": { "branch": "main", "commit": "e4fc5e29b731bdf55d204c5c6a11dc3be70f3b65" }, 5 | "bufferline.nvim": { "branch": "main", "commit": "d24378edc14a675c820a303b4512af3bbc5761e9" }, 6 | "catppuccin": { "branch": "main", "commit": "a96334d46f5cc6c5d196585a85ebc863327a331c" }, 7 | "clipboard-image.nvim": { "branch": "main", "commit": "d1550dc26729b7954f95269952e90471b838fa25" }, 8 | "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, 9 | "cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" }, 10 | "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, 11 | "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, 12 | "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, 13 | "code_runner.nvim": { "branch": "main", "commit": "01ce754d162170a3fcf372ad9f188a65c010f235" }, 14 | "copilot-cmp": { "branch": "master", "commit": "c2cdb3c0f5078b0619055af192295830a7987790" }, 15 | "copilot.lua": { "branch": "master", "commit": "e48bd7020a98be217d85c006a298656294fd6210" }, 16 | "dial.nvim": { "branch": "master", "commit": "c6657df5453a6cbe4e8356e1675e9652cadc332f" }, 17 | "dressing.nvim": { "branch": "master", "commit": "39611852fd7bbac117e939a26759bb37361f0c90" }, 18 | "flash.nvim": { "branch": "main", "commit": "636bcf84af487d2b8c4a5351d1d123ae3cac2ffe" }, 19 | "gitsigns.nvim": { "branch": "main", "commit": "adcf2c7f2f495f5df148683764bf7cba6a70f34c" }, 20 | "gruvbox": { "branch": "main", "commit": "df149bccb19a02c5c2b9fa6ec0716f0c0487feb0" }, 21 | "gruvbox-baby": { "branch": "main", "commit": "4f45f5182b986ea8099b8ad0207e07f1bc49a47f" }, 22 | "indent-blankline.nvim": { "branch": "master", "commit": "4541d690816cb99a7fc248f1486aa87f3abce91c" }, 23 | "joshuto.nvim": { "branch": "master", "commit": "2993aca60f56757e854b509e34fcba4f25e778ba" }, 24 | "latex.nvim": { "branch": "main", "commit": "1a88416293900258be25251f43a7dfdf47db62e7" }, 25 | "lazy.nvim": { "branch": "main", "commit": "14d76aac4bd3ff07c1fca074c210f28f766a931e" }, 26 | "lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" }, 27 | "mason-lspconfig.nvim": { "branch": "main", "commit": "828a538ac8419f586c010996aefa5df6eb7c250b" }, 28 | "mason.nvim": { "branch": "main", "commit": "5ad3e113b0c3fde3caba8630599373046f6197e8" }, 29 | "mini.ai": { "branch": "main", "commit": "5218ea75e635df78a807bc9d5a7162594fb76d02" }, 30 | "mini.bufremove": { "branch": "main", "commit": "7821606e35c1ac931b56d8e3155f45ffe76ee7e5" }, 31 | "mini.comment": { "branch": "main", "commit": "877acea5b2a32ff55f808fc0ebe9aa898648318c" }, 32 | "mini.indentscope": { "branch": "main", "commit": "f60e9b51a6214c73a170ffc5445ce91560981031" }, 33 | "mini.pairs": { "branch": "main", "commit": "dfa9f6e2576bb8853be277d96b735af59d9be7c2" }, 34 | "mini.surround": { "branch": "main", "commit": "9d1956b576d7051da3a483b251dfc778121c60db" }, 35 | "neo-tree.nvim": { "branch": "v3.x", "commit": "981a43adcca25e7ccc3c589902d49f25e4d48ebc" }, 36 | "neoconf.nvim": { "branch": "main", "commit": "08f146d53e075055500dca35e93281faff95716b" }, 37 | "neodev.nvim": { "branch": "main", "commit": "62515f64dfb196e8abe1263e17e2546559e41292" }, 38 | "neotest-python": { "branch": "master", "commit": "054f22129405e747adfc2cbeddfcc59537df50ba" }, 39 | "noice.nvim": { "branch": "main", "commit": "c0917d2775b0d77b0297af16936aaf96abb678ac" }, 40 | "nui.nvim": { "branch": "main", "commit": "9e3916e784660f55f47daa6f26053ad044db5d6a" }, 41 | "null-ls.nvim": { "branch": "main", "commit": "db09b6c691def0038c456551e4e2772186449f35" }, 42 | "nvim-cmp": { "branch": "main", "commit": "c4e491a87eeacf0408902c32f031d802c7eafce8" }, 43 | "nvim-dap-python": { "branch": "master", "commit": "37b4cba02e337a95cb62ad1609b3d1dccb2e5d42" }, 44 | "nvim-lspconfig": { "branch": "master", "commit": "6c53bf7fb02a2de7e7c84be7a2bd7a502f66a802" }, 45 | "nvim-navic": { "branch": "master", "commit": "e6da6f74d89de65258ea7e98e22103ff5de6dcf5" }, 46 | "nvim-neoclip.lua": { "branch": "main", "commit": "4e406ae0f759262518731538f2585abb9d269bac" }, 47 | "nvim-notify": { "branch": "master", "commit": "ea9c8ce7a37f2238f934e087c255758659948e0f" }, 48 | "nvim-texlabconfig": { "branch": "master", "commit": "b817297fd07bd6c127df56d01f439f2f838c49ed" }, 49 | "nvim-transparent": { "branch": "main", "commit": "f6a0f8387fbea5fbc2b78137444a9de4fdd02459" }, 50 | "nvim-treesitter": { "branch": "master", "commit": "4115fad9fded72571bdc3e0f7351e64b31799a3d" }, 51 | "nvim-treesitter-textobjects": { "branch": "master", "commit": "52f1f3280d9092bfaee5c45be5962fabee3d9654" }, 52 | "nvim-ts-context-commentstring": { "branch": "main", "commit": "7f625207f225eea97ef7a6abe7611e556c396d2f" }, 53 | "nvim-web-devicons": { "branch": "master", "commit": "efbfed0567ef4bfac3ce630524a0f6c8451c5534" }, 54 | "oxocarbon.nvim": { "branch": "main", "commit": "12a7507f1cd5ac6edb890d12268e4444a35956f2" }, 55 | "peek.nvim": { "branch": "master", "commit": "67752e7581f88da6899838985a05705b008e4185" }, 56 | "persistence.nvim": { "branch": "main", "commit": "4b8051c01f696d8849a5cb8afa9767be8db16e40" }, 57 | "playground": { "branch": "master", "commit": "2b81a018a49f8e476341dfcb228b7b808baba68b" }, 58 | "plenary.nvim": { "branch": "master", "commit": "267282a9ce242bbb0c5dc31445b6d353bed978bb" }, 59 | "rose-pine": { "branch": "main", "commit": "76cae45b4e6716ee93afc78bd3860134935ea9d7" }, 60 | "tabout.nvim": { "branch": "master", "commit": "0d275c8d25f32457e67b5c66d6ae43f26a61bce5" }, 61 | "telescope.nvim": { "branch": "master", "commit": "47c755d737702df7a39b640c8d9c473a728be1df" }, 62 | "todo-comments.nvim": { "branch": "main", "commit": "09b0b17d824d2d56f02ff15967e8a2499a89c731" }, 63 | "tokyonight.nvim": { "branch": "main", "commit": "1ee11019f8a81dac989ae1db1a013e3d582e2033" }, 64 | "trouble.nvim": { "branch": "main", "commit": "20d1b30d6925213abece21d35858a16e11d1e9fc" }, 65 | "twilight.nvim": { "branch": "main", "commit": "a4843e6e67092a1e6fa9666f02bf0ab59174c1df" }, 66 | "venv-selector.nvim": { "branch": "main", "commit": "dd94c45e63de316ded50ac809cda07b6c04fef7d" }, 67 | "vim-illuminate": { "branch": "master", "commit": "a2907275a6899c570d16e95b9db5fd921c167502" }, 68 | "vim-jukit": { "branch": "master", "commit": "ae1629464f84f32a589467f9d1e3c9bc4b3bc90c" }, 69 | "vim-kitty": { "branch": "main", "commit": "20a2625b600f26ef8ce664c098c78ca5256695a0" }, 70 | "vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" }, 71 | "which-key.nvim": { "branch": "main", "commit": "38b990f6eabf62014018b4aae70a97d7a6c2eb88" }, 72 | "zen-mode.nvim": { "branch": "main", "commit": "68f554702de63f4b7b6b6d4bcb10178f41a0acc7" } 73 | } -------------------------------------------------------------------------------- /lua/config/autocmds.lua: -------------------------------------------------------------------------------- 1 | -- Autocmds are automatically loaded on the VeryLazy event 2 | -- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua 3 | -- Add any additional autocmds here 4 | 5 | -- Returning focus to Neovim after inverse search 6 | -- vim.cmd([[ 7 | -- function! s:TexFocusVim() abort 8 | -- " Replace `TERMINAL` with the name of your terminal application 9 | -- " Example: execute "!open -a iTerm" 10 | -- " Example: execute "!open -a Alacritty" 11 | -- silent execute "!open -a Alacritty" 12 | -- redraw! 13 | -- endfunction 14 | -- augroup vimtex_event_focus 15 | -- au! 16 | -- au User VimtexEventViewReverse call s:TexFocusVim() 17 | -- augroup END 18 | -- ]]) 19 | -- vim.cmd([[ 20 | -- function! s:TexFocusVim() abort 21 | -- " Replace `TERMINAL` with the name of your terminal application 22 | -- " Example: execute "!open -a iTerm" 23 | -- " Example: execute "!open -a Alacritty" 24 | -- silent execute "!open -a kitty" 25 | -- redraw! 26 | -- endfunction 27 | -- augroup vimtex_event_focus 28 | -- au! 29 | -- au User VimtexEventViewReverse call s:TexFocusVim() 30 | -- augroup END 31 | -- ]]) 32 | 33 | local autocmd = vim.api.nvim_create_autocmd 34 | 35 | -- Don't auto commenting new lines 36 | autocmd("BufEnter", { 37 | pattern = "", 38 | command = "set fo-=c fo-=r fo-=o", 39 | }) 40 | 41 | -- vim.api.nvim_create_autocmd({ "FileType", "InsertLeave" }, { 42 | -- pattern = "tex", 43 | -- callback = require("util.latex").format, 44 | -- }) 45 | 46 | -- vim.api.nvim_create_autocmd("BufEnter", { 47 | -- pattern = "*", 48 | -- command = "normal! zz", 49 | -- }) 50 | -------------------------------------------------------------------------------- /lua/config/keymaps.lua: -------------------------------------------------------------------------------- 1 | -- Keymaps are automatically loaded on the VeryLazy event 2 | -- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua 3 | -- Add any additional keymaps here 4 | 5 | local Util = require("lazyvim.util") 6 | 7 | local function map(mode, lhs, rhs, opts) 8 | local keys = require("lazy.core.handler").handlers.keys 9 | ---@cast keys LazyKeysHandler 10 | -- do not create the keymap if a lazy keys handler exists 11 | if not keys.active[keys.parse({ lhs, mode = mode }).id] then 12 | opts = opts or {} 13 | opts.silent = opts.silent ~= false 14 | vim.keymap.set(mode, lhs, rhs, opts) 15 | end 16 | end 17 | 18 | -- movement 19 | map({ "n", "v", "o" }, "H", "^", { desc = "Use 'H' as '^'" }) 20 | map({ "n", "v", "o" }, "L", "$", { desc = "Use 'L' as '$'" }) 21 | 22 | -- indent for normal mode 23 | map("n", "<", "v", "v>g") 25 | 26 | -- buffers 27 | map({ "n", "i" }, "", "BufferLineCyclePrev", { desc = "Prev buffer" }) 28 | map("n", "k", "BufferLineCyclePrev", { desc = "Prev buffer" }) 29 | map({ "n", "i" }, "", "BufferLineCycleNext", { desc = "Next buffer" }) 30 | map("n", "j", "BufferLineCycleNext", { desc = "Next buffer" }) 31 | map("n", "D", "c", { desc = "Delete window" }) 32 | 33 | -- windows resize 34 | map("n", "", "resize +2", { desc = "Increase window height" }) 35 | map("n", "", "resize -2", { desc = "Decrease window height" }) 36 | map("n", "", "vertical resize -2", { desc = "Decrease window width" }) 37 | map("n", "", "vertical resize +2", { desc = "Increase window width" }) 38 | 39 | -- go to files 40 | map("n", "go", "e ~/.config/nvim/lua/config/options.lua", { desc = "Go to options config" }) 41 | map("n", "gk", "e ~/.config/nvim/lua/config/keymaps.lua", { desc = "Go to keymaps config" }) 42 | map("n", "ga", "e ~/.config/nvim/lua/config/autocmds.lua", { desc = "Go to autocmds config" }) 43 | map("n", "gu", "e ~/.config/nvim/lua/util/latex.lua", { desc = "Go to util config" }) 44 | map("n", "gl", "e ~/.config/nvim/lua/plugins/write/latex.lua", { desc = "Go to latex.nvim config" }) 45 | map("n", "gt", "e ~/Documents/Latex/Package_elegantbook.tex", { desc = "Go to latex template" }) 46 | map("n", "gi", "e ~/Documents/Latex/latexindent.yaml", { desc = "Go to latexindent" }) 47 | map("n", "gs", function() 48 | require("luasnip.loaders").edit_snippet_files({}) 49 | end, { desc = "Go to luasnip config" }) 50 | map("n", "gp", function() 51 | require("neo-tree.command").execute({ toggle = true, dir = "/Users/hanyu_yan/.config/nvim/lua/plugins" }) 52 | end, { desc = "Go to plugins config" }) 53 | map("n", "gF", function() 54 | require("neo-tree.command").execute({ toggle = true, dir = "/Users/hanyu_yan/.config/nvim/ftplugin" }) 55 | end, { desc = "Go to plugins config" }) 56 | map("n", "gf", function() 57 | require("neo-tree.command").execute({ toggle = true, dir = "/Users/hanyu_yan/.config/fvim/lua" }) 58 | end, { desc = "Go to fvim config" }) 59 | map("n", "gL", function() 60 | require("neo-tree.command").execute({ 61 | toggle = true, 62 | dir = "/Users/hanyu_yan/.local/share/nvim/lazy/LazyVim/lua/lazyvim/", 63 | }) 64 | end, { desc = "Go to lazyvim config" }) 65 | 66 | -- Spell check 67 | map("i", "", "u[s1z=`]au", { desc = "Check spell" }) 68 | map("n", "h", "au[s1z=`]au", { desc = "Check spell" }) 69 | map("n", "H", "au[szg`]au", { desc = "Add word to dictionary" }) 70 | 71 | map("n", "L", ":Lazy", { desc = "Lazy" }) 72 | map("n", "w", ":w", { desc = "Save" }) 73 | map({ "n", "v", "t" }, ";", "ToggleTerm", { desc = "Toggle terminal" }) 74 | map("n", "ut", "TransparentToggle", { desc = "Toggle transparent" }) 75 | map("n", "uc", Util.telescope("colorscheme", { enable_preview = true }), { desc = "Colorscheme with preview" }) 76 | map("n", "uu", "b~ea", { desc = "Colorscheme with preview" }) 77 | 78 | map({ "n", "v" }, "a", "keepjumps normal! ggVG", { desc = "Select all" }) 79 | map("n", "+", "", { desc = "Increase number" }) 80 | map("n", "-", "", { desc = "Decrease number" }) 81 | map("n", "z", "ZenMode", { desc = "Toggle zen mode" }) 82 | map("n", "fp", function() 83 | require("telescope").extensions.neoclip.default() 84 | end, { desc = "Find clips" }) 85 | 86 | -- ============= -- 87 | -- Vimtex Keymaps -- 88 | -- ============= -- 89 | -- map({ "o", "x" }, "am", "(vimtex-a$)", { desc = "Use `am` for the inline math text object" }) 90 | -- map({ "o", "x" }, "im", "(vimtex-i$)", { desc = "Use `im` for the inline math text object" }) 91 | -- map({ "o", "x" }, "ai", "(vimtex-am)", { desc = "Use `ai` for the item text text object" }) 92 | -- map({ "o", "x" }, "ii", "(vimtex-im)", { desc = "Use `ii` for the item text text object" }) 93 | 94 | -- map({ "i", "n", "v" }, "", function() 95 | -- require("knap").toggle_autopreviewing() 96 | -- end) 97 | -- map({ "i", "n", "v" }, "", function() 98 | -- require("knap").forward_jump() 99 | -- end) 100 | -- map({ "n", "v" }, "K", function() 101 | -- require("knap").process_once() 102 | -- end) 103 | 104 | -- Disable default keymaps 105 | local del = vim.keymap.del 106 | del("n", "bb") 107 | del("n", "ww") 108 | del("n", "wd") 109 | del("n", "w-") 110 | del("n", "w|") 111 | del("n", "l") 112 | del("n", "ft") 113 | del("n", "fT") 114 | del("n", "gg") 115 | del("n", "gG") 116 | -------------------------------------------------------------------------------- /lua/config/lazy.lua: -------------------------------------------------------------------------------- 1 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 2 | if not vim.loop.fs_stat(lazypath) then 3 | -- bootstrap lazy.nvim 4 | -- stylua: ignore 5 | vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) 6 | end 7 | vim.opt.rtp:prepend(vim.env.LAZY or lazypath) 8 | 9 | require("lazy").setup({ 10 | spec = { 11 | -- add LazyVim and import its plugins 12 | { "LazyVim/LazyVim", import = "lazyvim.plugins" }, 13 | -- import any extras modules here 14 | { import = "lazyvim.plugins.extras.lang.python" }, 15 | -- { import = "lazyvim.plugins.extras.lang.json" }, 16 | -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, 17 | -- import/override with your plugins 18 | { import = "lazyvim.plugins.extras.coding.copilot" }, 19 | { import = "plugins.default" }, 20 | { import = "plugins.ui" }, 21 | { import = "plugins.write" }, 22 | { import = "plugins" }, 23 | }, 24 | defaults = { 25 | -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. 26 | -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. 27 | lazy = false, 28 | -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, 29 | -- have outdated releases, which may break your Neovim install. 30 | version = false, -- always use the latest git commit 31 | -- version = "*", -- try installing the latest stable version for plugins that support semver 32 | }, 33 | checker = { enabled = true }, -- automatically check for plugin updates 34 | performance = { 35 | rtp = { 36 | -- disable some rtp plugins 37 | disabled_plugins = { 38 | "gzip", 39 | "tarPlugin", 40 | "tohtml", 41 | "tutor", 42 | "zipPlugin", 43 | }, 44 | }, 45 | }, 46 | }) 47 | -------------------------------------------------------------------------------- /lua/config/options.lua: -------------------------------------------------------------------------------- 1 | vim.opt.timeoutlen = 150 2 | vim.opt.spell = true 3 | vim.opt.spelllang = { "en", "cjk" } 4 | vim.opt.spelloptions = "camel" 5 | vim.opt.backup = false 6 | vim.g.tex_flavor = "latex" 7 | 8 | local indent = 2 9 | -- vim.opt.expandtab = true -- Use spaces instead of tabs 10 | vim.opt.softtabstop = indent -- Number of spaces that a counts for while performing editing operations 11 | vim.opt.tabstop = indent -- Number of spaces tabs count for 12 | vim.opt.shiftwidth = indent -- Size of an indent 13 | 14 | -- Knap Config 15 | 16 | vim.g.knap_settings = { 17 | delay = 500, 18 | } 19 | 20 | -- jukit Config 21 | 22 | vim.g.jukit_mappings = 0 23 | 24 | -- ============= -- 25 | -- Vimtex Config -- 26 | -- ============= -- 27 | -- vim.g.vimtex_view_method = "skim" 28 | -- vim.g.vimtex_quickfix_mode = 0 29 | -- vim.g.vimtex_quickfix_open_on_warning = 0 30 | -- vim.g.vimtex_compiler_silent = 1 31 | -- vim.g.vimtex_view_general_options = "-r @line @pdf @tex" 32 | -- vim.g.vimtex_indent_enabled = 1 33 | -- vim.g.vimtex_imaps_enabled = 0 34 | -- -- Custom conceasl 35 | -- -- vim.g.vimtex_syntax_conceal_disable = 0 36 | -- vim.cmd([[ 37 | -- let g:vimtex_syntax_custom_cmds = [ 38 | -- \ {'name': 'limits', 'mathmode': 1, 'concealchar': ' '}, 39 | -- \ {'name': 'dd', 'mathmode': 1, 'concealchar': 'd'}, 40 | -- \ {'name': 'cp', 'mathmode': 1, 'concealchar': 'x'}, 41 | -- \ {'name': 'order', 'mathmode': 1, 'concealchar': 'O'}, 42 | -- \ {'name': 'unlhd', 'mathmode': 1, 'concealchar': '⊴'}, 43 | -- \ {'name': 'rank', 'mathmode': 1, 'concealchar': 'r'}, 44 | -- \ {'name': 'vb', 'mathmode': 1, 'conceal': 1, 'argstyle': 'boldunder'}, 45 | -- \] 46 | -- ]]) 47 | -- vim.cmd([[ 48 | -- let g:vimtex_syntax_custom_cmds_with_concealed_delims = [ 49 | -- \ {'name': 'ket', 'mathmode': 1, 'cchar_open': '|', 'cchar_close': '>'}, 50 | -- \ {'name': 'bra', 'mathmode': 1, 'cchar_open': '<', 'cchar_close': '|'}, 51 | -- \ {'name': 'abs', 'mathmode': 1, 'cchar_open': '|', 'cchar_close': '|'}, 52 | -- \ {'name': 'norm', 'mathmode': 1, 'cchar_open': '⫼', 'cchar_close': '⫼'}, 53 | -- \ {'name': 'ceil', 'mathmode': 1, 'cchar_open': '⌈', 'cchar_close': '⌉'}, 54 | -- \ {'name': 'floor', 'mathmode': 1, 'cchar_open': '⌊', 'cchar_close': '⌋'}, 55 | -- \] 56 | -- ]]) 57 | -- 58 | -------------------------------------------------------------------------------- /lua/plugins/code-runner.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "CRAG666/code_runner.nvim", 4 | dependencies = { "nvim-lua/plenary.nvim" }, 5 | keys = { 6 | { "rr", "RunCode", desc = "Run Code" }, 7 | { "rf", "RunFile", desc = "Run File" }, 8 | { "rp", "RunProject", desc = "Run Project" }, 9 | { "rd", "RunClose", desc = "Run Close" }, 10 | }, 11 | config = { 12 | -- choose default mode (valid term, tab, float, toggle, buf) 13 | mode = "term", 14 | -- Focus on runner window(only works on toggle, term and tab mode) 15 | focus = true, 16 | -- startinsert (see ':h inserting-ex') 17 | startinsert = false, 18 | term = { 19 | -- Position to open the terminal, this option is ignored if mode is tab 20 | position = "bot", 21 | -- window size, this option is ignored if tab is true 22 | size = 8, 23 | }, 24 | float = { 25 | -- Key that close the code_runner floating window 26 | close_key = "", 27 | -- Window border (see ':h nvim_open_win') 28 | border = "none", 29 | 30 | -- Num from `0 - 1` for measurements 31 | height = 0.8, 32 | width = 0.8, 33 | x = 0.5, 34 | y = 0.5, 35 | 36 | -- Highlight group for floating window/border (see ':h winhl') 37 | border_hl = "FloatBorder", 38 | float_hl = "Normal", 39 | 40 | -- Transparency (see ':h winblend') 41 | blend = 0, 42 | }, 43 | filetype_path = "", -- No default path defined 44 | filetype = { 45 | javascript = "node", 46 | java = "cd $dir && javac $fileName && java $fileNameWithoutExt", 47 | c = "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir/$fileNameWithoutExt", 48 | cpp = "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir/$fileNameWithoutExt", 49 | python = "python3 -u", 50 | sh = "bash", 51 | rust = "cd $dir && rustc $fileName && $dir$fileNameWithoutExt", 52 | }, 53 | project_path = "", -- No default path defined 54 | project = {}, 55 | }, 56 | ft = { "lua", "python", "c", "cpp" }, 57 | -- config = { 58 | -- filetype = { 59 | -- python = "python3 -u", 60 | -- }, 61 | -- mode = "term", 62 | -- float = { 63 | -- close_key = "q", 64 | -- }, 65 | -- }, 66 | }, 67 | } 68 | -------------------------------------------------------------------------------- /lua/plugins/default/alpha.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "goolord/alpha-nvim", 4 | opts = function() 5 | local dashboard = require("alpha.themes.dashboard") 6 | local logo = [[ 7 | ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ 8 | ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ 9 | ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ 10 | ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ 11 | ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ 12 | ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ 13 | ⟦ 𝔽𝕚𝕣𝕖𝕠𝕟𝕕 ⟧ 14 | ]] 15 | 16 | dashboard.section.header.val = vim.split(logo, "\n", {}) 17 | dashboard.section.buttons.val = { 18 | dashboard.button("f", " " .. " Find file", ":Telescope find_files "), 19 | dashboard.button("n", " " .. " New file", ":ene startinsert "), 20 | dashboard.button("r", " " .. " Recent files", ":Telescope oldfiles "), 21 | dashboard.button("g", " " .. " Find text", ":Telescope live_grep "), 22 | dashboard.button("s", "勒" .. " Restore Session", [[:lua require("persistence").load() ]]), 23 | dashboard.button("l", "鈴" .. " Lazy", ":Lazy"), 24 | dashboard.button("q", " " .. " Quit", ":qa"), 25 | } 26 | for _, button in ipairs(dashboard.section.buttons.val) do 27 | button.opts.hl = "AlphaButtons" 28 | button.opts.hl_shortcut = "AlphaShortcut" 29 | end 30 | dashboard.section.footer.opts.hl = "Type" 31 | dashboard.section.header.opts.hl = "AlphaHeader" 32 | dashboard.section.buttons.opts.hl = "AlphaButtons" 33 | dashboard.opts.layout[1].val = 8 34 | return dashboard 35 | end, 36 | }, 37 | } 38 | -------------------------------------------------------------------------------- /lua/plugins/default/cmp.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "hrsh7th/nvim-cmp", 4 | dependencies = { 5 | "hrsh7th/cmp-emoji", 6 | }, 7 | ---@param opts cmp.ConfigSchema 8 | opts = function(_, opts) 9 | local has_words_before = function() 10 | unpack = unpack or table.unpack 11 | local line, col = unpack(vim.api.nvim_win_get_cursor(0)) 12 | return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil 13 | end 14 | 15 | local luasnip = require("luasnip") 16 | local cmp = require("cmp") 17 | 18 | opts.mapping = vim.tbl_extend("force", opts.mapping, { 19 | [""] = cmp.mapping(function(fallback) 20 | if cmp.visible() then 21 | -- You could replace select_next_item() with confirm({ select = true }) to get VS Code autocompletion behavior 22 | cmp.select_next_item() 23 | -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() 24 | -- this way you will only jump inside the snippet region 25 | elseif luasnip.expand_or_jumpable() then 26 | luasnip.expand_or_jump() 27 | elseif has_words_before() then 28 | cmp.complete() 29 | else 30 | fallback() 31 | end 32 | end, { "i", "s" }), 33 | [""] = cmp.mapping(function(fallback) 34 | if cmp.visible() then 35 | cmp.select_prev_item() 36 | elseif luasnip.jumpable(-1) then 37 | luasnip.jump(-1) 38 | else 39 | fallback() 40 | end 41 | end, { "i", "s" }), 42 | }) 43 | end, 44 | }, 45 | } 46 | -------------------------------------------------------------------------------- /lua/plugins/default/default.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "neovim/nvim-lspconfig", 4 | init = function() 5 | local keys = require("lazyvim.plugins.lsp.keymaps").get() 6 | -- keys[#keys + 1] = { "K", "ak$" } 7 | end, 8 | opts = { 9 | setup = { 10 | clangd = function(_, opts) 11 | opts.capabilities.offsetEncoding = { "utf-16" } 12 | end, 13 | }, 14 | }, 15 | }, 16 | { 17 | "echasnovski/mini.bufremove", 18 | -- stylua: ignore 19 | keys = function () 20 | return { 21 | { "d", function() require("mini.bufremove").delete(0, false) end, desc = "Delete Buffer" }, 22 | } 23 | end , 24 | }, 25 | { 26 | "akinsho/bufferline.nvim", 27 | keys = function() 28 | return {} 29 | end, 30 | }, 31 | { 32 | "nvim-telescope/telescope.nvim", 33 | keys = { 34 | { "gc", false }, 35 | { "gs", false }, 36 | { "uC", false }, 37 | }, 38 | }, 39 | { 40 | "lewis6991/gitsigns.nvim", 41 | opts = { 42 | on_attach = function() 43 | return {} 44 | end, 45 | }, 46 | }, 47 | { 48 | "echasnovski/mini.surround", 49 | opts = { 50 | mappings = { 51 | add = "ma", -- Add surrounding in Normal and Visual modes 52 | delete = "md", -- Delete surrounding 53 | find = "mf", -- Find surrounding (to the right) 54 | find_left = "mF", -- Find surrounding (to the left) 55 | highlight = "mh", -- Highlight surrounding 56 | replace = "mr", -- Replace surrounding 57 | update_n_lines = "mn", -- Update `n_lines` 58 | }, 59 | }, 60 | config = function(_, opts) 61 | require("mini.surround").setup(opts) 62 | end, 63 | }, 64 | } 65 | -------------------------------------------------------------------------------- /lua/plugins/default/lspconfig.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "neovim/nvim-lspconfig", 4 | opts = { 5 | ---@type lspconfig.options 6 | servers = { 7 | texlab = { 8 | mason = false, 9 | settings = { 10 | texlab = { 11 | build = { 12 | executable = "pdflatex", 13 | -- args = {}, 14 | onSave = true, 15 | }, 16 | -- rootDirectory = "..", 17 | forwardSearch = { 18 | executable = "sioyek", 19 | args = { 20 | "--reuse-window", 21 | "--inverse-search", 22 | [[nvim-texlabconfig -file %1 -line %2 -server ]] .. vim.v.servername, 23 | "--forward-search-file", 24 | "%f", 25 | "--forward-search-line", 26 | "%l", 27 | "%p", 28 | }, 29 | }, 30 | diagnostics = { ignoredPatterns = { "^Overfull", "^Underfull" } }, 31 | -- latexFormatter = "none", 32 | -- bibFormatter = "latexindent", 33 | -- latexindent = { 34 | -- ["local"] = "latexindent.yaml", 35 | -- }, 36 | }, 37 | }, 38 | }, 39 | }, 40 | }, 41 | }, 42 | } 43 | -------------------------------------------------------------------------------- /lua/plugins/default/luasnip.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "L3MON4D3/LuaSnip", 4 | config = function() 5 | require("luasnip").config.set_config({ 6 | enable_autosnippets = true, 7 | store_selection_keys = "`", 8 | }) 9 | require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/LuaSnip" }) 10 | local auto_expand = require("luasnip").expand_auto 11 | require("luasnip").expand_auto = function(...) 12 | vim.o.undolevels = vim.o.undolevels 13 | auto_expand(...) 14 | end 15 | -- local types = require("luasnip.util.types") 16 | -- require("luasnip").config.setup({ 17 | -- ext_opts = { 18 | -- [types.choiceNode] = { 19 | -- active = { 20 | -- virt_text = { { "●", "GruvboxOrange" } }, 21 | -- }, 22 | -- }, 23 | -- [types.insertNode] = { 24 | -- active = { 25 | -- virt_text = { { "●", "GruvboxBlue" } }, 26 | -- }, 27 | -- }, 28 | -- }, 29 | -- }) 30 | end, 31 | keys = function() 32 | return { 33 | { 34 | "fj", 35 | function() 36 | return require("luasnip").expand_or_locally_jumpable() and "luasnip-jump-next" 37 | or ":call searchpair('[([{<|]', '', '[)\\]}>|]', 'W')a" 38 | end, 39 | expr = true, 40 | silent = true, 41 | mode = "i", 42 | }, 43 | { 44 | "fj", 45 | function() 46 | return require("luasnip").jump(1) 47 | end, 48 | mode = "s", 49 | }, 50 | { 51 | "fk", 52 | function() 53 | require("luasnip").jump(-1) 54 | end, 55 | mode = { "i", "s" }, 56 | }, 57 | { 58 | "", 59 | "luasnip-next-choice", 60 | mode = { "i", "s" }, 61 | }, 62 | { 63 | "", 64 | "luasnip-prev-choice", 65 | mode = { "i", "s" }, 66 | }, 67 | -- { 68 | -- "", 69 | -- function() 70 | -- if require("luasnip").expand_or_jumpable() then 71 | -- require("luasnip").expand_or_jump() 72 | -- else 73 | -- return "" 74 | -- end 75 | -- end, 76 | -- mode = { "i", "s" }, 77 | -- }, 78 | } 79 | end, 80 | }, 81 | } 82 | -------------------------------------------------------------------------------- /lua/plugins/default/neo-tree.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-neo-tree/neo-tree.nvim", 4 | lazy = true, 5 | opts = { 6 | filesystem = { 7 | window = { 8 | mappings = { 9 | ["o"] = "system_open", 10 | }, 11 | }, 12 | commands = { 13 | system_open = function(state) 14 | local node = state.tree:get_node() 15 | local path = node:get_id() 16 | vim.api.nvim_command("silent !open -g " .. path) 17 | end, 18 | }, 19 | }, 20 | }, 21 | }, 22 | } 23 | -------------------------------------------------------------------------------- /lua/plugins/default/tree-sitter.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-treesitter/nvim-treesitter", 4 | opts = function() 5 | return { 6 | highlight = { enable = true }, 7 | indent = { enable = true, disable = { "python" } }, 8 | context_commentstring = { enable = true, enable_autocmd = false }, 9 | ensure_installed = { 10 | "bash", 11 | "c", 12 | "cpp", 13 | "html", 14 | "json", 15 | "lua", 16 | "luap", 17 | "markdown", 18 | "make", 19 | "markdown_inline", 20 | "scala", 21 | "python", 22 | "query", 23 | "toml", 24 | "regex", 25 | "vim", 26 | "yaml", 27 | "latex", 28 | }, 29 | incremental_selection = { 30 | enable = true, 31 | keymaps = { 32 | init_selection = "", 33 | node_incremental = "", 34 | scope_incremental = "\\", 35 | node_decremental = "", 36 | }, 37 | }, 38 | } 39 | end, 40 | rainbow = { 41 | enable = true, 42 | -- list of languages you want to disable the plugin for 43 | disable = { "jsx", "cpp" }, 44 | -- Which query to use for finding delimiters 45 | query = "rainbow-parens", 46 | -- Highlight the entire buffer all at once 47 | }, 48 | 49 | keys = function() 50 | return { 51 | { "", desc = "Increment selection" }, 52 | { "", desc = "Decrement selection", mode = "x" }, 53 | } 54 | end, 55 | }, 56 | } 57 | -------------------------------------------------------------------------------- /lua/plugins/default/which-key.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "folke/which-key.nvim", 4 | config = function(_, opts) 5 | local wk = require("which-key") 6 | wk.setup(opts) 7 | local keymaps = { 8 | mode = { "n", "v" }, 9 | ["m"] = { name = "+surround" }, 10 | ["]"] = { name = "+next" }, 11 | ["["] = { name = "+prev" }, 12 | [""] = { name = "+tabs" }, 13 | ["c"] = { name = "+code" }, 14 | ["f"] = { name = "+file/find" }, 15 | ["q"] = { name = "+quit/session" }, 16 | ["g"] = { name = "+go to" }, 17 | ["s"] = { name = "+search" }, 18 | ["u"] = { name = "+ui" }, 19 | ["x"] = { name = "+diagnostics/quickfix" }, 20 | ["l"] = { name = "+jupyter" }, 21 | ["sn"] = { name = "+noice" }, 22 | ["p"] = { name = "+preview" }, 23 | } 24 | wk.register(keymaps) 25 | end, 26 | opts = { 27 | triggers_blacklist = { 28 | -- list of mode / prefixes that should never be hooked by WhichKey 29 | -- this is mostly relevant for key maps that start with a native binding 30 | -- most people should not need to change this 31 | i = { "f", "j", "k" }, 32 | v = { "f", "j", "k" }, 33 | }, 34 | }, 35 | }, 36 | } 37 | -------------------------------------------------------------------------------- /lua/plugins/dial.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "monaqa/dial.nvim", 4 | keys = { 5 | { "", mode = { "n", "v" } }, 6 | { "", mode = { "n", "v" } }, 7 | { "g", mode = "v" }, 8 | { "g", mode = "v" }, 9 | }, 10 | init = function() 11 | vim.api.nvim_set_keymap("n", "", require("dial.map").inc_normal(), { desc = "Increment", noremap = true }) 12 | vim.api.nvim_set_keymap("n", "", require("dial.map").dec_normal(), { desc = "Decrement", noremap = true }) 13 | vim.api.nvim_set_keymap("v", "", require("dial.map").inc_visual(), { desc = "Increment", noremap = true }) 14 | vim.api.nvim_set_keymap("v", "", require("dial.map").dec_visual(), { desc = "Decrement", noremap = true }) 15 | vim.api.nvim_set_keymap("v", "g", require("dial.map").inc_gvisual(), { desc = "Increment", noremap = true }) 16 | vim.api.nvim_set_keymap("v", "g", require("dial.map").dec_gvisual(), { desc = "Decrement", noremap = true }) 17 | end, 18 | lazy = true, 19 | }, 20 | } 21 | -------------------------------------------------------------------------------- /lua/plugins/disabled.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "rafamadriz/friendly-snippets", 4 | enabled = false, 5 | }, 6 | { 7 | "windwp/nvim-spectre", 8 | enabled = false, 9 | }, 10 | } 11 | -------------------------------------------------------------------------------- /lua/plugins/jukit.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "luk400/vim-jukit", 4 | keys = { 5 | { "ln", "call jukit#splits#output()", desc = "Open output window" }, 6 | { "lN", "call jukit#splits#close_output_split()", desc = "Close output window" }, 7 | { "ls", "call jukit#send#section(0)", desc = "Send current code" }, 8 | { "ll", "call jukit#send#line()", desc = "Send current line" }, 9 | { "ls", "call jukit#send#selection()", desc = "Send selected code", mode = "v" }, 10 | { "lr", "call jukit#send#until_current_section()", desc = "Execute until current" }, 11 | { "la", "call jukit#send#all()", desc = "Execute all" }, 12 | { "lo", "call jukit#cells#create_below(0)", desc = "New code cell below" }, 13 | { "lO", "call jukit#cells#create_above(0)", desc = "New code cell above" }, 14 | { "lt", "call jukit#cells#create_below(1)", desc = "New text cell below" }, 15 | { "lT", "call jukit#cells#create_above(1)", desc = "New text cell above" }, 16 | { "ld", "call jukit#cells#delete()", desc = "Delete current cell" }, 17 | { "lk", "call jukit#cells#move_up()", desc = "Move current cell up" }, 18 | { "lj", "call jukit#cells#move_down()", desc = "Move current cell down" }, 19 | { "lK", "call jukit#cells#jump_to_next_cell()", desc = "Jump to next cell" }, 20 | { "lJ", "call jukit#cells#jump_to_previous_cell()", desc = "Jump to previous cell" }, 21 | { 22 | "lp", 23 | 'call jukit#convert#notebook_convert("jupyter-notebook")', 24 | desc = "Toggle ipynb and py", 25 | }, 26 | { 27 | "lh", 28 | "call jukit#convert#save_nb_to_file(0,1,'html')", 29 | desc = "Convert to html", 30 | }, 31 | }, 32 | ft = "json", 33 | }, 34 | } 35 | -------------------------------------------------------------------------------- /lua/plugins/kitty.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { "fladson/vim-kitty", ft = "kitty" }, 3 | } 4 | -------------------------------------------------------------------------------- /lua/plugins/neoclip.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { "AckslD/nvim-neoclip.lua", dependencies = { 3 | "nvim-telescope/telescope.nvim", 4 | }, config = true }, 5 | } 6 | -------------------------------------------------------------------------------- /lua/plugins/playground.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-treesitter/playground", 4 | keys = { 5 | { "up", "TSPlaygroundToggle", desc = "Toggle ts-playground" }, 6 | }, 7 | ft = "tex", 8 | }, 9 | } 10 | -------------------------------------------------------------------------------- /lua/plugins/tabout.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "abecodes/tabout.nvim", 4 | dependencies = "nvim-treesitter", 5 | config = { 6 | tabkey = "", -- key to trigger tabout, set to an empty string to disable 7 | backwards_tabkey = "", -- key to trigger backwards tabout, set to an empty string to disable 8 | act_as_tab = true, -- shift content if tab out is not possible 9 | act_as_shift_tab = false, -- reverse shift content if tab out is not possible (if your keyboard/terminal supports ) 10 | default_tab = "", -- shift default action (only at the beginning of a line, otherwise is used) 11 | default_shift_tab = "", -- reverse shift default action, 12 | enable_backwards = true, -- well ... 13 | tabouts = { 14 | { open = "'", close = "'" }, 15 | { open = '"', close = '"' }, 16 | { open = "`", close = "`" }, 17 | { open = "(", close = ")" }, 18 | { open = "[", close = "]" }, 19 | { open = "{", close = "}" }, 20 | { open = "$", close = "$" }, 21 | }, 22 | ignore_beginning = true, --[[ if the cursor is at the beginning of a filled element it will rather tab out than shift the content ]] 23 | exclude = {}, -- tabout will ignore these filetypes 24 | }, 25 | }, 26 | } 27 | -------------------------------------------------------------------------------- /lua/plugins/twilight.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { "folke/twilight.nvim", config = { 3 | context = 20, 4 | } }, 5 | } 6 | -------------------------------------------------------------------------------- /lua/plugins/ui/colorscheme.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nyoom-engineering/oxocarbon.nvim", 4 | }, 5 | { 6 | "ellisonleao/gruvbox.nvim", 7 | name = "gruvbox", 8 | }, 9 | { "catppuccin/nvim", name = "catppuccin", config = { flavour = "macchiato" } }, 10 | { "rose-pine/neovim", name = "rose-pine" }, 11 | { "luisiacc/gruvbox-baby", name = "gruvbox-baby" }, 12 | } 13 | -------------------------------------------------------------------------------- /lua/plugins/ui/transparent.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "xiyaowong/nvim-transparent", 4 | config = { 5 | extra_groups = { 6 | "BufferLineTabClose", 7 | "BufferlineBufferSelected", 8 | "BufferLineFill", 9 | "BufferLineBackground", 10 | "BufferLineSeparator", 11 | "BufferLineIndicatorSelected", 12 | }, 13 | }, 14 | }, 15 | { 16 | "rcarriga/nvim-notify", 17 | config = { 18 | background_colour = "#000000", 19 | }, 20 | }, 21 | } 22 | -------------------------------------------------------------------------------- /lua/plugins/write/clipboard-image.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "ekickx/clipboard-image.nvim", 4 | opts = { -- Default configuration for all filetype 5 | default = { 6 | img_dir = { "%:p:h", "img" }, 7 | img_name = function() 8 | local name = os.date("%y-%m-%d-%H-%M-%S") 9 | 10 | vim.ui.input({ prompt = "Name: ", default = name }, function(input) 11 | name = input 12 | end) 13 | return name 14 | end, 15 | affix = "<\n %s\n>", -- Multi lines affix 16 | }, 17 | -- You can create configuration for ceartain filetype by creating another field (markdown, in this case) 18 | -- If you're uncertain what to name your field to, you can run `lua print(vim.bo.filetype)` 19 | -- Missing options from `markdown` field will be replaced by options from `default` field 20 | markdown = { 21 | img_dir = { "src", "assets", "img" }, -- Use table for nested dir (New feature form PR #20) 22 | img_dir_txt = "/assets/img", 23 | img_handler = function(img) -- New feature from PR #22 24 | local script = string.format('./image_compressor.sh "%s"', img.path) 25 | os.execute(script) 26 | end, 27 | }, 28 | }, 29 | ft = { "tex", "markdown" }, 30 | keys = { 31 | { "i", "PasteImg", desc = "Paste image" }, 32 | }, 33 | }, 34 | } 35 | -------------------------------------------------------------------------------- /lua/plugins/write/femaco.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "AckslD/nvim-FeMaco.lua", 4 | config = true, 5 | enabled = false, 6 | ft = "markdown", 7 | keys = { 8 | { "pe", "FeMaco", desc = "FeMaco preview" }, 9 | }, 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /lua/plugins/write/knap.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "frabjous/knap", 4 | enabled = false, 5 | keys = { 6 | { 7 | "pk", 8 | function() 9 | require("knap").toggle_autopreviewing() 10 | end, 11 | desc = "Knap toggle auto previewing", 12 | }, 13 | { 14 | "ps", 15 | function() 16 | require("knap").forward_jump() 17 | end, 18 | desc = "Knap forward jump", 19 | }, 20 | }, 21 | ft = { "tex", "markdown" }, 22 | }, 23 | } 24 | -------------------------------------------------------------------------------- /lua/plugins/write/latex-conceal.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- { 3 | -- "bamonroe/rnoweb-nvim", 4 | -- dependencies = { "nvim-lua/plenary.nvim", "nvim-treesitter/nvim-treesitter" }, 5 | -- ft = "tex", 6 | -- -- config = true, 7 | -- config = function() 8 | -- local rnw = require("rnoweb-nvim") 9 | -- rnw.setup() 10 | -- rnw.symbols.set_sym("latex", "\\Pr", { "Pr" }) 11 | -- end, 12 | -- }, 13 | } 14 | -------------------------------------------------------------------------------- /lua/plugins/write/latex.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "ryleelyman/latex.nvim", 4 | opts = { 5 | conceals = { 6 | add = { 7 | ["colon"] = ":", 8 | ["coloneqq"] = "≔", 9 | ["pdv"] = "∂", 10 | ["odv"] = "d", 11 | ["sqrt"] = "√", 12 | ["|"] = "⫴", 13 | ["{"] = "{", 14 | ["}"] = "}", 15 | ["nmid"] = "∤", 16 | ["implies"] = "⇨", 17 | 18 | -- hide 19 | [","] = "", 20 | [" "] = "", 21 | ["vb"] = "", 22 | ["va"] = "", 23 | ["qq"] = "", 24 | ["mathrm"] = "", 25 | ["displaystyle"] = "", 26 | ["limits"] = "", 27 | ["ab"] = "", 28 | ["ab*"] = "", 29 | ["bra"] = "", 30 | ["ket"] = "", 31 | ["braket"] = "", 32 | ["ketbra"] = "", 33 | }, 34 | }, 35 | imaps = { 36 | enabled = false, 37 | -- add = { ["\\emptyset"] = "1", ["\\Alpha"] = "A" }, 38 | -- default_leader = ";", 39 | }, 40 | surrounds = { enabled = false }, 41 | }, 42 | ft = "tex", 43 | }, 44 | 45 | -- inverse serach for LaTeX 46 | { 47 | "f3fora/nvim-texlabconfig", 48 | config = true, 49 | build = "go build", 50 | ft = "tex", 51 | }, 52 | } 53 | -------------------------------------------------------------------------------- /lua/plugins/write/leetcode.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- { 3 | -- "ianding1/leetcode.vim", 4 | -- config = function() 5 | -- -- vim.g.leetcode_china = 1 6 | -- vim.g.leetcode_solution_filetype = "python3" 7 | -- vim.g.leetcode_browser = "chrome" 8 | -- end, 9 | -- }, 10 | } 11 | -------------------------------------------------------------------------------- /lua/plugins/write/peek.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "toppair/peek.nvim", 4 | build = "deno task --quiet build:fast", 5 | ft = "markdown", 6 | keys = { 7 | { "pm", "lua require'peek'.open()", desc = "Open peek preview" }, 8 | }, 9 | }, 10 | } 11 | -------------------------------------------------------------------------------- /lua/plugins/write/texlabconfig.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- { 3 | -- "f3fora/nvim-texlabconfig", 4 | -- config = true, 5 | -- build = "go build", 6 | -- ft = "tex", 7 | -- keys = { 8 | -- { "pb", "TexlabBuild", desc = "Texlab build" }, 9 | -- { "pt", "TexlabForward", desc = "Texlab forward" }, 10 | -- }, 11 | -- }, 12 | } 13 | -------------------------------------------------------------------------------- /lua/plugins/zen-mode.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "folke/zen-mode.nvim", 4 | config = { 5 | window = { 6 | options = { 7 | signcolumn = "no", 8 | }, 9 | }, 10 | plugins = { 11 | kitty = { 12 | enabled = true, 13 | }, 14 | }, 15 | }, 16 | }, 17 | } 18 | -------------------------------------------------------------------------------- /lua/util/init.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | return M 4 | -------------------------------------------------------------------------------- /lua/util/latex.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | local MATH_NODES = { 4 | displayed_equation = true, 5 | inline_formula = true, 6 | math_environment = true, 7 | } 8 | 9 | local ts_utils = require("nvim-treesitter.ts_utils") 10 | 11 | M.in_env = function(env) 12 | local node = ts_utils.get_node_at_cursor() 13 | local bufnr = vim.api.nvim_get_current_buf() 14 | while node do 15 | if node:type() == "generic_environment" then 16 | local begin = node:child(0) 17 | local name = begin:field("name") 18 | if name[1] and vim.treesitter.get_node_text(name[1], bufnr, nil) == "{" .. env .. "}" then 19 | return true 20 | end 21 | end 22 | node = node:parent() 23 | end 24 | return false 25 | end 26 | 27 | M.in_text = function() 28 | local node = ts_utils.get_node_at_cursor() 29 | while node do 30 | if node:type() == "text_mode" then 31 | return true 32 | elseif MATH_NODES[node:type()] then 33 | return false 34 | end 35 | node = node:parent() 36 | end 37 | return true 38 | end 39 | 40 | M.in_mathzone = function() 41 | return not M.in_text() 42 | end 43 | 44 | M.in_item = function() 45 | return M.in_env("itemize") or M.in_env("enumerate") 46 | end 47 | M.in_tikz = function() 48 | return M.in_env("tikzpicture") 49 | end 50 | M.in_quantikz = function() 51 | return M.in_env("quantikz") 52 | end 53 | 54 | -- For markdown 55 | M.in_latex = function() 56 | local node = ts_utils.get_node_at_cursor() 57 | while node do 58 | if node:type() == "latex_block" then 59 | print(true) 60 | return true 61 | end 62 | node = node:parent() 63 | end 64 | print(false) 65 | return false 66 | end 67 | 68 | M.clean = function() 69 | local current_dir = vim.fn.expand("%:p:h") 70 | local file_types = { "aux", "log", "out", "fls", "fdb_latexmk", "bcf", "run.xml", "toc", "DS_Store", "bak*", "dvi" } 71 | for _, file_type in ipairs(file_types) do 72 | local command = "rm " .. current_dir .. "/*." .. file_type 73 | vim.api.nvim_call_function("system", { command }) 74 | end 75 | end 76 | 77 | M.format = function() 78 | local current_file = vim.fn.expand("%:p") 79 | local latexindent = "latexindent -g /dev/null " .. current_file .. " -wd -l ~/Documents/Latex/latexindent.yaml" 80 | local build = "pdflatex " .. current_file 81 | vim.api.nvim_call_function("system", { build }) 82 | vim.cmd("w") 83 | M.clean() 84 | vim.api.nvim_call_function("system", { latexindent }) 85 | vim.cmd("e") 86 | vim.cmd("normal! zz") 87 | -- vim.cmd("TexlabForward") 88 | end 89 | 90 | M.sympy_calc = function() 91 | local selected_text = vim.fn.getreg("v") 92 | print(selected_text) 93 | vim.api.nvim_out_write(selected_text) 94 | end 95 | 96 | return M 97 | -------------------------------------------------------------------------------- /queries/latex/highlights.scm: -------------------------------------------------------------------------------- 1 | ;; extends 2 | ((generic_command 3 | command: (command_name) @_name 4 | arg: (curly_group (_) @text.strong)) 5 | (#match? @_name "^(\\\\vb)$")) 6 | -------------------------------------------------------------------------------- /spell/en.utf-8.add: -------------------------------------------------------------------------------- 1 | nvim 2 | luasnip 3 | exponationally 4 | abelian 5 | nonidentity 6 | iff 7 | Eigenspectrum 8 | xshift 9 | Superoprator 10 | POVM 11 | Neovim 12 | dotfiles 13 | cosets 14 | BHK 15 | Lindenstrauss 16 | Minkowski 17 | Brunn 18 | Hoeffding's 19 | mixedness 20 | Subadditivity 21 | subadditivity 22 | superoperators 23 | Hermiticity 24 | LRU 25 | struct 26 | Sylow 27 | EPR 28 | Kraus 29 | Markovian 30 | dephasing 31 | move 32 | LOCC 33 | decoherence 34 | nonnegative 35 | PPT 36 | NPPT 37 | Superscalar 38 | PID 39 | syscall 40 | Ctrl 41 | Syscalls 42 | func 43 | SVD 44 | JL 45 | adaptic 46 | Rabi 47 | mutex 48 | FCFS 49 | renormalization 50 | DMRG 51 | TNS 52 | RBM 53 | qudits 54 | CHSH 55 | subring 56 | datapoints 57 | subrings 58 | Dicke 59 | Frobenius 60 | Preprocess 61 | qudit 62 | Untar 63 | comaximal 64 | adic 65 | Pokemons 66 | MCMC 67 | by 68 | by 69 | by 70 | by 71 | by 72 | since 73 | braket 74 | Toffoli 75 | CNOT 76 | nontrivially 77 | squarefree 78 | sympy 79 | monic 80 | irreducibles 81 | QCircuit 82 | MCMT 83 | infimum 84 | between 85 | stationarity 86 | Jozsa 87 | QFT 88 | FFT 89 | Vazirani 90 | DIT 91 | QIT 92 | DFT 93 | cheeger 94 | PTE 95 | ns 96 | inode 97 | coset 98 | subgraph 99 | Hölder 100 | -------------------------------------------------------------------------------- /spell/en.utf-8.add.spl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fireond/Neovim-config/9b0feb33269e59b401213dfa28ba08bf73dfa8f2/spell/en.utf-8.add.spl -------------------------------------------------------------------------------- /spell/nl.utf-8.add: -------------------------------------------------------------------------------- 1 | nvim 2 | -------------------------------------------------------------------------------- /spell/nl.utf-8.add.spl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fireond/Neovim-config/9b0feb33269e59b401213dfa28ba08bf73dfa8f2/spell/nl.utf-8.add.spl -------------------------------------------------------------------------------- /stylua.toml: -------------------------------------------------------------------------------- 1 | indent_type = "Spaces" 2 | indent_width = 2 3 | column_width = 120 --------------------------------------------------------------------------------