├── .gitignore ├── .neoconf.json ├── LICENSE ├── README.md ├── init.lua ├── lazy-lock.json ├── lazyvim.json ├── lua ├── config │ ├── autocmds.lua │ ├── keymaps.lua │ ├── lazy.lua │ └── options.lua └── plugins │ ├── autotag.lua │ ├── blink.lua │ ├── bufferline.lua │ ├── colorscheme.lua │ ├── conform.lua │ ├── context.lua │ ├── diffview.lua │ ├── fzf-lua.lua │ ├── gist.lua │ ├── gitlinker.lua │ ├── headlines.lua │ ├── lualine.lua │ ├── neogit.lua │ ├── neotest_vitest.lua │ ├── octo.lua │ ├── oil.lua │ ├── other.lua │ ├── pairs.lua │ ├── snacks.lua │ ├── tardis.lua │ ├── treesitter.lua │ ├── tsc.lua │ └── typescript.lua └── stylua.toml /.gitignore: -------------------------------------------------------------------------------- 1 | tt.* 2 | .tests 3 | doc/tags 4 | debug 5 | .repro 6 | foo.* 7 | *.log 8 | data 9 | -------------------------------------------------------------------------------- /.neoconf.json: -------------------------------------------------------------------------------- 1 | { 2 | "neodev": { 3 | "library": { 4 | "enabled": true, 5 | "plugins": true 6 | } 7 | }, 8 | "neoconf": { 9 | "plugins": { 10 | "lua_ls": { 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 💤 LazyVim 2 | 3 | A starter template for [LazyVim](https://github.com/LazyVim/LazyVim). 4 | Refer to the [documentation](https://lazyvim.github.io/installation) to get started. 5 | -------------------------------------------------------------------------------- /init.lua: -------------------------------------------------------------------------------- 1 | -- bootstrap lazy.nvim, LazyVim and your plugins 2 | require("config.lazy") 3 | -------------------------------------------------------------------------------- /lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "LazyVim": { "branch": "main", "commit": "3f034d0a7f58031123300309f2efd3bb0356ee21" }, 3 | "SchemaStore.nvim": { "branch": "main", "commit": "776d60cc8fd7e2f450c1756c9491e353c12b16fa" }, 4 | "auto-dark-mode.nvim": { "branch": "master", "commit": "02ef9553e2a1d6e861bc6955d58ce5883d28a6ad" }, 5 | "bamboo.nvim": { "branch": "master", "commit": "d100fc78184ba9365fc6a4988518652e792cf6ec" }, 6 | "blink.cmp": { "branch": "main", "commit": "18b352d12b35bca148427b607098df14b75a218f" }, 7 | "catppuccin": { "branch": "main", "commit": "4bb938bbba41d306db18bf0eb0633a5f28fd7ba0" }, 8 | "conform.nvim": { "branch": "master", "commit": "a6f5bdb78caa305496357d17e962bbc4c0b392e2" }, 9 | "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, 10 | "flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" }, 11 | "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, 12 | "fzf-lua": { "branch": "main", "commit": "394ddb2b80c58731c09b5775ca5d05d578b1de3d" }, 13 | "gitlinker.nvim": { "branch": "master", "commit": "cc59f732f3d043b626c8702cb725c82e54d35c25" }, 14 | "gitsigns.nvim": { "branch": "main", "commit": "4c40357994f386e72be92a46f41fc1664c84c87d" }, 15 | "grug-far.nvim": { "branch": "main", "commit": "0e391cc375702299b8dac101ff5a7d418fb193b9" }, 16 | "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, 17 | "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, 18 | "lualine.nvim": { "branch": "master", "commit": "f4f791f67e70d378a754d02da068231d2352e5bc" }, 19 | "lush.nvim": { "branch": "main", "commit": "45a79ec4acb5af783a6a29673a999ce37f00497e" }, 20 | "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, 21 | "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, 22 | "mini.ai": { "branch": "main", "commit": "6e01c0e5a15554852546fac9853960780ac52ed4" }, 23 | "mini.hipatterns": { "branch": "main", "commit": "fbf1e2195fdd65cf1bc970316c28098257728868" }, 24 | "mini.icons": { "branch": "main", "commit": "ec61af6e606fc89ee3b1d8f2f20166a3ca917a36" }, 25 | "mini.surround": { "branch": "main", "commit": "f90069c7441a5fb04c3de42eacf93e16b64dd3eb" }, 26 | "modus-themes.nvim": { "branch": "master", "commit": "1f9ba82c732a49cdafc80f904286dd70f02c4310" }, 27 | "neo-tree.nvim": { "branch": "main", "commit": "e6f5b5e044ba9f380e82fc942212e0679d83b6f6" }, 28 | "neotest": { "branch": "master", "commit": "d66cf4e05a116957f0d3a7755a24291c7d1e1f72" }, 29 | "neotest-vitest": { "branch": "main", "commit": "9f8f05bee6e5b980a4d1e84adab119a8f9756a77" }, 30 | "neovim-ayu": { "branch": "master", "commit": "283badaa983234c90e857c12c1f1c18e1544360a" }, 31 | "noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" }, 32 | "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" }, 33 | "nvim-lint": { "branch": "master", "commit": "6e9dd545a1af204c4022a8fcd99727ea41ffdcc8" }, 34 | "nvim-lspconfig": { "branch": "master", "commit": "9e932edb0af4e20880685ddb96a231669fbe8091" }, 35 | "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, 36 | "nvim-treesitter": { "branch": "master", "commit": "93ce9feb4fabbb37b3e7f47d80f27be778f4d956" }, 37 | "nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" }, 38 | "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, 39 | "oil.nvim": { "branch": "master", "commit": "975a77cce3c8cb742bc1b3629f4328f5ca977dad" }, 40 | "other.nvim": { "branch": "main", "commit": "933aa489ad02f8f973269a565bfea16cc784cbbf" }, 41 | "oxocarbon.nvim": { "branch": "main", "commit": "004777819ba294423b638a35a75c9f0c7be758ed" }, 42 | "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" }, 43 | "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, 44 | "snacks.nvim": { "branch": "main", "commit": "b0f983ef9aa9b9855ff0b72350cd3dc80de70675" }, 45 | "tardis.nvim": { "branch": "main", "commit": "a6ee00a217529490e79d349b1f1a9cf5831180d3" }, 46 | "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, 47 | "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, 48 | "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, 49 | "ts-comments.nvim": { "branch": "main", "commit": "872dcfa0418f4a33b7437fb4d9f4e89f2f000d74" }, 50 | "tsc.nvim": { "branch": "main", "commit": "d38264b5712ce9dc2f39dff43121bbd164814528" }, 51 | "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }, 52 | "yanky.nvim": { "branch": "main", "commit": "9543d4c6c537720419bccb3338c4ddd5bb6fbd44" }, 53 | "zenbones.nvim": { "branch": "main", "commit": "bc74669c7f1b35984efdfa0d531dd802b968cf2e" } 54 | } 55 | -------------------------------------------------------------------------------- /lazyvim.json: -------------------------------------------------------------------------------- 1 | { 2 | "extras": [ 3 | "lazyvim.plugins.extras.coding.mini-surround", 4 | "lazyvim.plugins.extras.coding.yanky", 5 | "lazyvim.plugins.extras.lang.json", 6 | "lazyvim.plugins.extras.util.mini-hipatterns" 7 | ], 8 | "install_version": 7, 9 | "news": { 10 | "NEWS.md": "10960" 11 | }, 12 | "version": 8 13 | } -------------------------------------------------------------------------------- /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 | vim.api.nvim_create_user_command("FormatDisable", function(args) 6 | if args.bang then 7 | -- FormatDisable! will disable formatting just for this buffer 8 | vim.b.disable_autoformat = true 9 | else 10 | vim.g.disable_autoformat = true 11 | end 12 | end, { 13 | desc = "Disable autoformat-on-save", 14 | bang = true, 15 | }) 16 | 17 | vim.api.nvim_create_user_command("FormatEnable", function() 18 | vim.b.disable_autoformat = false 19 | vim.g.disable_autoformat = false 20 | end, { 21 | desc = "Re-enable autoformat-on-save", 22 | }) 23 | 24 | -- Disable inlays by default 25 | vim.lsp.inlay_hint.enable(false) 26 | 27 | -- A way to open diffview that shows the same kind of diff 28 | -- that GitHub would show. 29 | vim.api.nvim_create_user_command("PRDiff", function() 30 | require("diffview").open({ "origin/main...", "--imply-local" }) 31 | end, { 32 | desc = "Diff this branch against main like a PR", 33 | }) 34 | 35 | vim.api.nvim_create_autocmd("FileType", { 36 | pattern = "qf", 37 | callback = function() 38 | vim.keymap.set("n", "", "T", { buffer = true, silent = true }) 39 | end, 40 | }) 41 | -------------------------------------------------------------------------------- /lua/config/keymaps.lua: -------------------------------------------------------------------------------- 1 | -- local wk = require("which-key") 2 | -- Keymaps are automatically loaded on the VeryLazy event 3 | -- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua 4 | -- Add any additional keymaps here 5 | -- 6 | vim.keymap.del("n", "") 7 | vim.keymap.del("n", "") 8 | 9 | vim.keymap.set("n", "", "tabnext", { desc = "Next Tab quick", remap = true }) 10 | vim.keymap.set("n", "", "tabprev", { desc = "Previous Tab quick", remap = true }) 11 | 12 | vim.keymap.set("n", "", function() 13 | require("snacks").picker.files() 14 | end, { desc = "Find files" }) 15 | 16 | vim.keymap.set("n", "", function() 17 | require("snacks").picker.grep() 18 | end, { desc = "Grep files" }) 19 | 20 | -- vim.keymap.set("n", "-", "Neotree toggle", { desc = "Neotree", remap = true }) 21 | vim.keymap.set("n", "-", "Oil", { desc = "Open parent directory" }) 22 | 23 | -- vim.keymap.set( 24 | -- "n", 25 | -- "gb", 26 | -- 'lua require"gitlinker".get_buf_range_url("n", {action_callback = require"gitlinker.actions".open_in_browser})', 27 | -- { silent = true } 28 | -- ) 29 | 30 | vim.keymap.set("n", "ghm", function() 31 | local gs = package.loaded.gitsigns 32 | gs.diffthis("main") 33 | end, { desc = "Diff this against main" }) 34 | 35 | vim.keymap.set("n", "ua", function() 36 | if vim.o.background == "dark" then 37 | print("Switching to light mode") 38 | vim.cmd("set background=light") 39 | vim.cmd("colorscheme PaperColor") 40 | else 41 | print("Switching to dark mode") 42 | vim.cmd("set background=dark") 43 | vim.cmd("colorscheme oxocarbon") 44 | end 45 | end, { desc = "Toggle light dark mode" }) 46 | 47 | local biome_cmd = function() 48 | local binary_name = "biome" 49 | local local_binary = vim.fn.fnamemodify("./node_modules/.bin/" .. binary_name, ":p") 50 | return vim.loop.fs_stat(local_binary) and local_binary or binary_name 51 | end 52 | 53 | local biome_lint = function() 54 | local obj = vim.system({ biome_cmd(), "lint" }):wait() 55 | local output = obj.stderr 56 | if output == nil then 57 | return 58 | end 59 | local fetch_message = false 60 | local errors = {} 61 | local filename, lnum, col, code, message 62 | for _, line in ipairs(vim.fn.split(output, "\n")) do 63 | -- if fetch_message then 64 | -- _, _, message = string.find(line, "%s×(.+)") 65 | 66 | -- if message then 67 | -- message = (message):gsub("^%s+×%s*", "") 68 | 69 | -- print("Inserting into table") 70 | 71 | -- table.insert({ 72 | -- source = "biomejs", 73 | -- filename = filename, 74 | -- type = "E", 75 | -- lnum = tonumber(lnum) - 1, 76 | -- col = tonumber(col), 77 | -- message = message, 78 | -- code = code, 79 | -- }) 80 | 81 | -- fetch_message = false 82 | -- end 83 | -- else 84 | -- 85 | _, _, filename, lnum, col, code = string.find(line, "([^:]+):(%d+):(%d+)%s(.+)") 86 | print(filename, lnum, col, code) 87 | if lnum then 88 | -- fetch_message = true 89 | print(filename) 90 | table.insert(errors, { 91 | source = "biomejs", 92 | filename = filename, 93 | type = "E", 94 | lnum = tonumber(lnum), 95 | col = tonumber(col), 96 | text = code, 97 | }) 98 | end 99 | -- end 100 | end 101 | 102 | -- https://neovim.io/doc/user/builtin.html#setqflist() 103 | vim.fn.setqflist(errors) 104 | vim.cmd("copen") 105 | end 106 | 107 | vim.keymap.set("n", "cb", function() 108 | biome_lint() 109 | end, { desc = "Biome fixes" }) 110 | 111 | local function preview_location_callback(_, method, result) 112 | if result == nil or vim.tbl_isempty(result) then 113 | vim.lsp.log.info(method, "No location found") 114 | return nil 115 | end 116 | if vim.tbl_islist(result) then 117 | vim.lsp.util.preview_location(result[1]) 118 | else 119 | vim.lsp.util.preview_location(result) 120 | end 121 | end 122 | 123 | function peek_definition() 124 | local win = vim.api.nvim_get_current_win() 125 | local params = vim.lsp.util.make_position_params(win, vim.lsp.client.offset_encoding) 126 | return vim.lsp.buf_request(0, "textDocument/definition", params, preview_location_callback) 127 | end 128 | -------------------------------------------------------------------------------- /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", 6 | lazypath }) 7 | end 8 | vim.opt.rtp:prepend(vim.env.LAZY or lazypath) 9 | 10 | require("lazy").setup({ 11 | spec = { 12 | -- add LazyVim and import its plugins 13 | { "LazyVim/LazyVim", import = "lazyvim.plugins" }, 14 | -- import any extras modules here 15 | -- { import = "lazyvim.plugins.extras.lang.typescript" }, 16 | -- { import = "lazyvim.plugins.extras.coding.blink" }, 17 | -- { import = "lazyvim.plugins.formatting" }, 18 | -- { import = "lazyvim.plugins.extras.lang.markdown" }, 19 | -- { import = "lazyvim.plugins.extras.lang.json" }, 20 | -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, 21 | -- import/override with your plugins 22 | -- prettierd seems borked. 23 | { import = "lazyvim.plugins.extras.test.core" }, 24 | { import = "plugins" }, 25 | }, 26 | defaults = { 27 | -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. 28 | -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. 29 | lazy = false, 30 | -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, 31 | -- have outdated releases, which may break your Neovim install. 32 | version = false, -- always use the latest git commit 33 | -- version = "*", -- try installing the latest stable version for plugins that support semver 34 | }, 35 | install = { colorscheme = { "tokyonight", "habamax" } }, 36 | checker = { enabled = false }, -- automatically check for plugin updates 37 | performance = { 38 | rtp = { 39 | -- disable some rtp plugins 40 | disabled_plugins = { 41 | "gzip", 42 | -- "matchit", 43 | -- "matchparen", 44 | -- "netrwPlugin", 45 | "tarPlugin", 46 | "tohtml", 47 | "tutor", 48 | "zipPlugin", 49 | }, 50 | }, 51 | }, 52 | }) 53 | -------------------------------------------------------------------------------- /lua/config/options.lua: -------------------------------------------------------------------------------- 1 | -- Options are automatically loaded before lazy.nvim startup 2 | -- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua 3 | -- Add any additional options here 4 | local opt = vim.opt 5 | 6 | opt.relativenumber = false 7 | opt.conceallevel = 0 8 | opt.swapfile = false 9 | opt.exrc = true 10 | vim.g.lazyvim_prettier_needs_config = true 11 | vim.g.lazyvim_picker = "snacks" 12 | 13 | opt.background = vim.fn.getenv("ITERM_PROFILE") == "Light" and "light" or "dark" 14 | -------------------------------------------------------------------------------- /lua/plugins/autotag.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "windwp/nvim-ts-autotag", 4 | config = function() 5 | require("nvim-ts-autotag").setup({ 6 | enable_close_on_slash = false, 7 | }) 8 | end, 9 | }, 10 | } 11 | -------------------------------------------------------------------------------- /lua/plugins/blink.lua: -------------------------------------------------------------------------------- 1 | -- Trying blink.cmp as an alternative to nvim.cmp. So far: 2 | -- 3 | -- - It's a little faster. 4 | -- - Had to turn off snippets immediately. 5 | -- - Turned off ghost text. 6 | -- - It's autocompleting a little too eagerly - writing a JSDoc 7 | -- comment like /** triggers autocompletion on the last * 8 | return { 9 | "saghen/blink.cmp", 10 | version = not vim.g.lazyvim_blink_main and "*", 11 | build = vim.g.lazyvim_blink_main and "cargo build --release", 12 | 13 | opts_extend = { 14 | "sources.completion.enabled_providers", 15 | "sources.compat", 16 | "sources.default", 17 | }, 18 | dependencies = { 19 | "rafamadriz/friendly-snippets", 20 | "Kaiser-Yang/blink-cmp-git", 21 | -- add blink.compat to dependencies 22 | { 23 | "saghen/blink.compat", 24 | optional = true, -- make optional so it's only enabled if any extras need it 25 | opts = {}, 26 | version = not vim.g.lazyvim_blink_main and "*", 27 | }, 28 | }, 29 | event = "InsertEnter", 30 | 31 | ---@module 'blink.cmp' 32 | ---@type blink.cmp.Config 33 | opts = { 34 | enabled = function() 35 | -- Disable on Markdown files 36 | return not vim.tbl_contains({ "markdown" }, vim.bo.filetype) 37 | and vim.bo.buftype ~= "prompt" 38 | and vim.b.completion ~= false 39 | end, 40 | snippets = nil, 41 | -- snippets = { 42 | -- expand = function(snippet, _) 43 | -- return LazyVim.cmp.expand(snippet) 44 | -- end, 45 | -- }, 46 | appearance = { 47 | -- sets the fallback highlight groups to nvim-cmp's highlight groups 48 | -- useful for when your theme doesn't support blink.cmp 49 | -- will be removed in a future release, assuming themes add support 50 | use_nvim_cmp_as_default = false, 51 | -- set to 'mono' for 'Nerd Font Mono' or 'normal' for 'Nerd Font' 52 | -- adjusts spacing to ensure icons are aligned 53 | nerd_font_variant = "mono", 54 | }, 55 | completion = { 56 | accept = { 57 | -- experimental auto-brackets support 58 | auto_brackets = { 59 | enabled = true, 60 | }, 61 | }, 62 | menu = { 63 | draw = { 64 | treesitter = { "lsp" }, 65 | }, 66 | }, 67 | documentation = { 68 | auto_show = true, 69 | auto_show_delay_ms = 200, 70 | }, 71 | ghost_text = { 72 | enabled = false, -- vim.g.ai_cmp, 73 | }, 74 | }, 75 | 76 | -- experimental signature help support 77 | -- signature = { enabled = true }, 78 | 79 | sources = { 80 | -- adding any nvim-cmp sources here will enable them 81 | -- with blink.compat 82 | compat = {}, 83 | default = { 84 | "git", 85 | "lsp", 86 | "path", 87 | -- "snippets", 88 | "buffer", 89 | }, 90 | providers = { 91 | git = { 92 | module = "blink-cmp-git", 93 | name = "Git", 94 | opts = { 95 | -- options for the blink-cmp-git 96 | }, 97 | }, 98 | }, 99 | }, 100 | cmdline = { enabled = false }, 101 | 102 | keymap = { 103 | preset = "super-tab", 104 | [""] = { "select_and_accept" }, 105 | }, 106 | }, 107 | ---@param opts blink.cmp.Config | { sources: { compat: string[] } } 108 | config = function(_, opts) 109 | -- setup compat sources 110 | local enabled = opts.sources.default 111 | for _, source in ipairs(opts.sources.compat or {}) do 112 | opts.sources.providers[source] = vim.tbl_deep_extend( 113 | "force", 114 | { name = source, module = "blink.compat.source" }, 115 | opts.sources.providers[source] or {} 116 | ) 117 | if type(enabled) == "table" and not vim.tbl_contains(enabled, source) then 118 | table.insert(enabled, source) 119 | end 120 | end 121 | 122 | -- add ai_accept to key 123 | -- if not opts.keymap[""] then 124 | -- if opts.keymap.preset == "super-tab" then -- super-tab 125 | -- opts.keymap[""] = { 126 | -- require("blink.cmp.keymap.presets")["super-tab"][""][1], 127 | -- LazyVim.cmp.map({ "snippet_forward", "ai_accept" }), 128 | -- "fallback", 129 | -- } 130 | -- else -- other presets 131 | -- opts.keymap[""] = { 132 | -- LazyVim.cmp.map({ "snippet_forward", "ai_accept" }), 133 | -- "fallback", 134 | -- } 135 | -- end 136 | -- end 137 | 138 | -- Unset custom prop to pass blink.cmp validation 139 | opts.sources.compat = nil 140 | 141 | -- check if we need to override symbol kinds 142 | for _, provider in pairs(opts.sources.providers or {}) do 143 | ---@cast provider blink.cmp.SourceProviderConfig|{kind?:string} 144 | if provider.kind then 145 | local CompletionItemKind = require("blink.cmp.types").CompletionItemKind 146 | local kind_idx = #CompletionItemKind + 1 147 | 148 | CompletionItemKind[kind_idx] = provider.kind 149 | ---@diagnostic disable-next-line: no-unknown 150 | CompletionItemKind[provider.kind] = kind_idx 151 | 152 | ---@type fun(ctx: blink.cmp.Context, items: blink.cmp.CompletionItem[]): blink.cmp.CompletionItem[] 153 | local transform_items = provider.transform_items 154 | ---@param ctx blink.cmp.Context 155 | ---@param items blink.cmp.CompletionItem[] 156 | provider.transform_items = function(ctx, items) 157 | items = transform_items and transform_items(ctx, items) or items 158 | for _, item in ipairs(items) do 159 | item.kind = kind_idx or item.kind 160 | end 161 | return items 162 | end 163 | 164 | -- Unset custom prop to pass blink.cmp validation 165 | provider.kind = nil 166 | end 167 | end 168 | 169 | require("blink.cmp").setup(opts) 170 | end, 171 | } 172 | -------------------------------------------------------------------------------- /lua/plugins/bufferline.lua: -------------------------------------------------------------------------------- 1 | -- Disable "bufferline" which replaces tabs. 2 | -- I use tabs as-is, with neovim defaults for now. 3 | return { 4 | { "akinsho/bufferline.nvim", enabled = false }, 5 | } 6 | -------------------------------------------------------------------------------- /lua/plugins/colorscheme.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- { 3 | -- "catppuccin/nvim", 4 | -- }, 5 | -- { "bluz71/vim-moonfly-colors", name = "moonfly", lazy = false, priority = 1000 }, 6 | -- { 7 | -- "folke/tokyonight.nvim", 8 | -- }, 9 | -- { 10 | -- "jacoborus/tender.vim", 11 | -- }, 12 | -- { 13 | -- "nyoom-engineering/oxocarbon.nvim", 14 | -- }, 15 | -- { 16 | -- "zortax/three-firewatch", 17 | -- }, 18 | -- { 19 | -- "rakr/vim-two-firewatch", 20 | -- }, 21 | -- 22 | -- { 23 | -- "savq/melange-nvim", 24 | -- }, 25 | -- { 26 | -- "ray-x/aurora", 27 | -- }, 28 | -- { 29 | -- "kepano/flexoki-neovim", 30 | -- name = "flexoki", 31 | -- }, 32 | -- { 33 | -- "NLKNguyen/papercolor-theme", 34 | -- }, 35 | -- { 36 | -- "atelierbram/Base2Tone-nvim", 37 | -- priority = 1000, 38 | -- }, 39 | --{ 40 | -- "Shatur/neovim-ayu", 41 | -- }, 42 | { "miikanissi/modus-themes.nvim", priority = 1000 }, 43 | { 44 | "vim-paper", 45 | name = "vim-paper", 46 | dir = "~/projects/vim-paper", 47 | }, 48 | { 49 | "ribru17/bamboo.nvim", 50 | priority = 1000, 51 | }, 52 | { 53 | "nyoom-engineering/oxocarbon.nvim", 54 | priority = 1000, 55 | }, 56 | { 57 | "EdenEast/nightfox.nvim", 58 | priority = 1000, 59 | }, 60 | { 61 | "mvllow/modes.nvim", 62 | config = function() 63 | require("modes").setup() 64 | end, 65 | }, 66 | -- { 67 | -- "zenbones-theme/zenbones.nvim", 68 | -- -- Optionally install Lush. Allows for more configuration or extending the colorscheme 69 | -- -- If you don't want to install lush, make sure to set g:zenbones_compat = 1 70 | -- -- In Vim, compat mode is turned on as Lush only works in Neovim. 71 | -- dependencies = "rktjmp/lush.nvim", 72 | -- lazy = false, 73 | -- priority = 1000, 74 | -- -- you can set set configuration options here 75 | -- -- config = function() 76 | -- -- vim.g.zenbones_darken_comments = 45 77 | -- -- vim.cmd.colorscheme("zenbones") 78 | -- -- end, 79 | -- }, 80 | { 81 | "f-person/auto-dark-mode.nvim", 82 | opts = { 83 | update_interval = 5000, 84 | set_dark_mode = function() 85 | vim.cmd("colorscheme nightfox") 86 | vim.api.nvim_set_option_value("background", "dark", {}) 87 | end, 88 | set_light_mode = function() 89 | vim.cmd("colorscheme dayfox") 90 | vim.api.nvim_set_option_value("background", "light", {}) 91 | end, 92 | }, 93 | }, 94 | } 95 | -------------------------------------------------------------------------------- /lua/plugins/conform.lua: -------------------------------------------------------------------------------- 1 | -- Using conform.nvim and trying to get LSP formatters _not_ to 2 | -- run because they always clobber my extmarks 3 | return { 4 | "stevearc/conform.nvim", 5 | enabled = true, 6 | dependencies = { "mason.nvim" }, 7 | opts = { 8 | formatters_by_ft = { 9 | python = { "ruff_format" }, 10 | json = { "biome" }, 11 | javascript = { "biome", stop_after_first = true }, 12 | typescriptreact = { "biome", stop_after_first = true }, 13 | typescript = { "biome", stop_after_first = true }, 14 | }, 15 | }, 16 | } 17 | -------------------------------------------------------------------------------- /lua/plugins/context.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-treesitter/nvim-treesitter-context", 4 | enabled = false, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /lua/plugins/diffview.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "sindrets/diffview.nvim", 3 | } 4 | -------------------------------------------------------------------------------- /lua/plugins/fzf-lua.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "ibhagwan/fzf-lua", 4 | enabled = false, 5 | -- cmd = "FzfLua", 6 | -- opts = function(_, opts) 7 | -- local fzf = require("fzf-lua") 8 | -- local config = fzf.config 9 | -- local actions = fzf.actions 10 | 11 | -- -- Quickfix 12 | -- config.defaults.keymap.fzf["ctrl-q"] = "select-all+accept" 13 | -- config.defaults.keymap.fzf["ctrl-u"] = "half-page-up" 14 | -- config.defaults.keymap.fzf["ctrl-d"] = "half-page-down" 15 | -- config.defaults.keymap.fzf["ctrl-x"] = "jump" 16 | -- config.defaults.keymap.fzf["ctrl-f"] = "preview-page-down" 17 | -- config.defaults.keymap.fzf["ctrl-b"] = "preview-page-up" 18 | -- config.defaults.keymap.builtin[""] = "preview-page-down" 19 | -- config.defaults.keymap.builtin[""] = "preview-page-up" 20 | 21 | -- -- Trouble 22 | -- if LazyVim.has("trouble.nvim") then 23 | -- -- the stock lazyvim config does ctrl-t = open in trouble, 24 | -- -- my muscle memory is ctrl-t = open in tab, 25 | -- -- so swapping here. 26 | -- config.defaults.actions.files["ctrl-q"] = actions.quickfix 27 | -- config.defaults.actions.files["ctrl-t"] = actions.file_tabedit 28 | -- end 29 | 30 | -- -- Toggle root dir / cwd 31 | -- config.defaults.actions.files["ctrl-r"] = function(_, ctx) 32 | -- local o = vim.deepcopy(ctx.__call_opts) 33 | -- o.root = o.root == false 34 | -- o.cwd = nil 35 | -- o.buf = ctx.__CTX.bufnr 36 | -- LazyVim.pick.open(ctx.__INFO.cmd, o) 37 | -- end 38 | -- config.defaults.actions.files["alt-c"] = config.defaults.actions.files["ctrl-r"] 39 | -- config.set_action_helpstr(config.defaults.actions.files["ctrl-r"], "toggle-root-dir") 40 | 41 | -- local img_previewer ---@type string[]? 42 | -- for _, v in ipairs({ 43 | -- -- Just use viu 44 | -- -- { cmd = "ueberzug", args = {} }, 45 | -- -- { cmd = "chafa", args = { "{file}", "--format=symbols" } }, 46 | -- { cmd = "viu", args = { "-b" } }, 47 | -- }) do 48 | -- if vim.fn.executable(v.cmd) == 1 then 49 | -- img_previewer = vim.list_extend({ v.cmd }, v.args) 50 | -- break 51 | -- end 52 | -- end 53 | 54 | -- return { 55 | -- "default-title", 56 | -- fzf_colors = true, 57 | -- fzf_opts = { 58 | -- ["--no-scrollbar"] = true, 59 | -- }, 60 | -- defaults = { 61 | -- -- formatter = "path.filename_first", 62 | -- formatter = "path.dirname_first", 63 | -- }, 64 | -- previewers = { 65 | -- builtin = { 66 | -- extensions = { 67 | -- ["png"] = img_previewer, 68 | -- ["jpg"] = img_previewer, 69 | -- ["jpeg"] = img_previewer, 70 | -- ["gif"] = img_previewer, 71 | -- ["webp"] = img_previewer, 72 | -- }, 73 | -- ueberzug_scaler = "fit_contain", 74 | -- }, 75 | -- }, 76 | -- -- Custom LazyVim option to configure vim.ui.select 77 | -- ui_select = function(fzf_opts, items) 78 | -- return vim.tbl_deep_extend("force", fzf_opts, { 79 | -- prompt = " ", 80 | -- winopts = { 81 | -- title = " " .. vim.trim((fzf_opts.prompt or "Select"):gsub("%s*:%s*$", "")) .. " ", 82 | -- title_pos = "center", 83 | -- }, 84 | -- }, fzf_opts.kind == "codeaction" and { 85 | -- winopts = { 86 | -- layout = "vertical", 87 | -- -- height is number of items minus 15 lines for the preview, with a max of 80% screen height 88 | -- height = math.floor(math.min(vim.o.lines * 0.8 - 16, #items + 2) + 0.5) + 16, 89 | -- width = 0.5, 90 | -- preview = not vim.tbl_isempty(LazyVim.lsp.get_clients({ bufnr = 0, name = "vtsls" })) and { 91 | -- layout = "vertical", 92 | -- vertical = "down:15,border-top", 93 | -- hidden = "hidden", 94 | -- } or { 95 | -- layout = "vertical", 96 | -- vertical = "down:15,border-top", 97 | -- }, 98 | -- }, 99 | -- } or { 100 | -- winopts = { 101 | -- width = 0.5, 102 | -- -- height is number of items, with a max of 80% screen height 103 | -- height = math.floor(math.min(vim.o.lines * 0.8, #items + 2) + 0.5), 104 | -- }, 105 | -- }) 106 | -- end, 107 | -- winopts = { 108 | -- width = 0.9, 109 | -- height = 0.9, 110 | -- row = 0.5, 111 | -- col = 0.5, 112 | -- backdrop = 90, 113 | -- border = "none", 114 | -- preview = { 115 | -- border = "border-top", 116 | -- vertical = "down:20%", 117 | -- scrollchars = { "┃", "" }, 118 | -- }, 119 | -- }, 120 | -- files = { 121 | -- cwd_prompt = false, 122 | -- file_icons = false, 123 | -- git_icons = false, 124 | -- color_icons = false, 125 | -- actions = { 126 | -- -- ["alt-i"] = { actions.toggle_ignore }, 127 | -- -- ["alt-h"] = { actions.toggle_hidden }, 128 | -- }, 129 | -- }, 130 | -- grep = {}, 131 | -- lsp = { 132 | -- symbols = { 133 | -- symbol_hl = function(s) 134 | -- return "TroubleIcon" .. s 135 | -- end, 136 | -- symbol_fmt = function(s) 137 | -- return s:lower() .. "\t" 138 | -- end, 139 | -- child_prefix = false, 140 | -- }, 141 | -- code_actions = { 142 | -- previewer = vim.fn.executable("delta") == 1 and "codeaction_native" or nil, 143 | -- }, 144 | -- }, 145 | -- } 146 | -- end, 147 | -- config = function(_, opts) 148 | -- if opts[1] == "default-title" then 149 | -- -- use the same prompt for all pickers for profile `default-title` and 150 | -- -- profiles that use `default-title` as base profile 151 | -- local function fix(t) 152 | -- t.prompt = t.prompt ~= nil and " " or nil 153 | -- for _, v in pairs(t) do 154 | -- if type(v) == "table" then 155 | -- fix(v) 156 | -- end 157 | -- end 158 | -- return t 159 | -- end 160 | -- opts = vim.tbl_deep_extend("force", fix(require("fzf-lua.profiles.default-title")), opts) 161 | -- opts[1] = nil 162 | -- end 163 | -- require("fzf-lua").setup(opts) 164 | -- end, 165 | -- init = function() 166 | -- LazyVim.on_very_lazy(function() 167 | -- vim.ui.select = function(...) 168 | -- require("lazy").load({ plugins = { "fzf-lua" } }) 169 | -- local opts = LazyVim.opts("fzf-lua") or {} 170 | -- require("fzf-lua").register_ui_select(opts.ui_select or nil) 171 | -- return vim.ui.select(...) 172 | -- end 173 | -- end) 174 | -- end, 175 | -- keys = { 176 | -- { "", "", ft = "fzf", mode = "t", nowait = true }, 177 | -- { "", "", ft = "fzf", mode = "t", nowait = true }, 178 | -- { 179 | -- ",", 180 | -- "FzfLua buffers sort_mru=true sort_lastused=true", 181 | -- desc = "Switch Buffer", 182 | -- }, 183 | -- { "/", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" }, 184 | -- { ":", "FzfLua command_history", desc = "Command History" }, 185 | -- { "", LazyVim.pick("files"), desc = "Find Files (Root Dir)" }, 186 | -- -- find 187 | -- { "fb", "FzfLua buffers sort_mru=true sort_lastused=true", desc = "Buffers" }, 188 | -- { "fc", LazyVim.pick.config_files(), desc = "Find Config File" }, 189 | -- { "ff", LazyVim.pick("files"), desc = "Find Files (Root Dir)" }, 190 | -- { "fF", LazyVim.pick("files", { root = false }), desc = "Find Files (cwd)" }, 191 | -- { "fg", "FzfLua git_files", desc = "Find Files (git-files)" }, 192 | -- { "fr", "FzfLua oldfiles", desc = "Recent" }, 193 | -- { "fR", LazyVim.pick("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" }, 194 | -- -- git 195 | -- { "gc", "FzfLua git_commits", desc = "Commits" }, 196 | -- { "gs", "FzfLua git_status", desc = "Status" }, 197 | -- -- search 198 | -- { 's"', "FzfLua registers", desc = "Registers" }, 199 | -- { "sa", "FzfLua autocmds", desc = "Auto Commands" }, 200 | -- { "sb", "FzfLua grep_curbuf", desc = "Buffer" }, 201 | -- { "sc", "FzfLua command_history", desc = "Command History" }, 202 | -- { "sC", "FzfLua commands", desc = "Commands" }, 203 | -- { "sd", "FzfLua diagnostics_document", desc = "Document Diagnostics" }, 204 | -- { "sD", "FzfLua diagnostics_workspace", desc = "Workspace Diagnostics" }, 205 | -- { "sg", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" }, 206 | -- { "sG", LazyVim.pick("live_grep", { root = false }), desc = "Grep (cwd)" }, 207 | -- { "sh", "FzfLua help_tags", desc = "Help Pages" }, 208 | -- { "sH", "FzfLua highlights", desc = "Search Highlight Groups" }, 209 | -- { "sj", "FzfLua jumps", desc = "Jumplist" }, 210 | -- { "sk", "FzfLua keymaps", desc = "Key Maps" }, 211 | -- { "sl", "FzfLua loclist", desc = "Location List" }, 212 | -- { "sM", "FzfLua man_pages", desc = "Man Pages" }, 213 | -- { "sm", "FzfLua marks", desc = "Jump to Mark" }, 214 | -- { "sR", "FzfLua resume", desc = "Resume" }, 215 | -- { "sq", "FzfLua quickfix", desc = "Quickfix List" }, 216 | -- { "sw", LazyVim.pick("grep_cword"), desc = "Word (Root Dir)" }, 217 | -- { "sW", LazyVim.pick("grep_cword", { root = false }), desc = "Word (cwd)" }, 218 | -- { "sw", LazyVim.pick("grep_visual"), mode = "v", desc = "Selection (Root Dir)" }, 219 | -- { "sW", LazyVim.pick("grep_visual", { root = false }), mode = "v", desc = "Selection (cwd)" }, 220 | -- { "uC", LazyVim.pick("colorschemes"), desc = "Colorscheme with Preview" }, 221 | -- { 222 | -- "ss", 223 | -- function() 224 | -- require("fzf-lua").lsp_document_symbols({ 225 | -- regex_filter = symbols_filter, 226 | -- }) 227 | -- end, 228 | -- desc = "Goto Symbol", 229 | -- }, 230 | -- { 231 | -- "sS", 232 | -- function() 233 | -- require("fzf-lua").lsp_live_workspace_symbols({ 234 | -- regex_filter = symbols_filter, 235 | -- }) 236 | -- end, 237 | -- desc = "Goto Symbol (Workspace)", 238 | -- }, 239 | -- }, 240 | }, 241 | } 242 | -------------------------------------------------------------------------------- /lua/plugins/gist.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "Rawnly/gist.nvim", 4 | cmd = { "GistCreate", "GistCreateFromFile", "GistsList" }, 5 | opts = { 6 | private = true, -- set new gists private by default 7 | clipboard = "+", -- yank URL to the system clipboard 8 | }, 9 | }, 10 | -- Optional: opens edited gists in a real buffer instead of a terminal 11 | { 12 | "samjwill/nvim-unception", 13 | lazy = false, 14 | init = function() 15 | vim.g.unception_block_while_host_edits = true 16 | end, 17 | }, 18 | } 19 | -------------------------------------------------------------------------------- /lua/plugins/gitlinker.lua: -------------------------------------------------------------------------------- 1 | -- I miss :GBrowse from vim-fugitive: this 2 | -- brings it back with a gy shortcut 3 | -- to copy a GitHub permalink 4 | return { 5 | { 6 | "ruifm/gitlinker.nvim", 7 | lazy = true, 8 | init = function() 9 | require("gitlinker").setup() 10 | end, 11 | }, 12 | } 13 | -------------------------------------------------------------------------------- /lua/plugins/headlines.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- This is broken: init.lua:160 3 | -- attempt to concatenate a local 'name' 4 | -- (a nil value) 5 | "lukas-reineke/headlines.nvim", 6 | enabled = false, 7 | } 8 | -------------------------------------------------------------------------------- /lua/plugins/lualine.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-lualine/lualine.nvim", 3 | event = "VeryLazy", 4 | init = function() 5 | vim.g.lualine_laststatus = vim.o.laststatus 6 | if vim.fn.argc(-1) > 0 then 7 | -- set an empty statusline till lualine loads 8 | vim.o.statusline = " " 9 | else 10 | -- hide the statusline on the starter page 11 | vim.o.laststatus = 0 12 | end 13 | end, 14 | opts = function() 15 | -- PERF: we don't need this lualine require madness 🤷 16 | local lualine_require = require("lualine_require") 17 | lualine_require.require = require 18 | 19 | vim.o.laststatus = vim.g.lualine_laststatus 20 | 21 | local opts = { 22 | options = { 23 | theme = "auto", 24 | globalstatus = vim.o.laststatus == 3, 25 | disabled_filetypes = { statusline = { "dashboard", "alpha", "ministarter", "snacks_dashboard" } }, 26 | section_separators = "", 27 | component_separators = "", 28 | }, 29 | sections = { 30 | lualine_a = { 31 | { 32 | "mode", 33 | fmt = function(str) 34 | return str:sub(1, 1) 35 | end, 36 | }, 37 | }, 38 | lualine_b = { -- "branch", "diff", "diagnostics" 39 | }, 40 | lualine_c = { LazyVim.lualine.pretty_path() }, 41 | lualine_x = {}, 42 | lualine_y = {}, 43 | lualine_z = { "location" }, 44 | }, 45 | extensions = { 46 | -- "neo-tree", 47 | -- "lazy", 48 | -- "fzf", 49 | }, 50 | } 51 | 52 | return opts 53 | end, 54 | } 55 | -------------------------------------------------------------------------------- /lua/plugins/neogit.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "kdheepak/lazygit.nvim", 4 | enabled = false, 5 | }, 6 | { 7 | "NeogitOrg/neogit", 8 | dependencies = { 9 | "nvim-lua/plenary.nvim", -- required 10 | "sindrets/diffview.nvim", -- optional - Diff integration 11 | }, 12 | opts = { 13 | process_spinner = true, 14 | graph_style = "kitty", 15 | signs = { 16 | -- { CLOSED, OPENED } 17 | hunk = { "", "" }, 18 | item = { "+", "-" }, 19 | section = { "+", "-" }, 20 | }, 21 | }, 22 | keys = { 23 | { 24 | "gg", 25 | function() 26 | local neogit = require("neogit") 27 | neogit.open({ kind = "tab" }) 28 | end, 29 | desc = "neogit open", 30 | }, 31 | }, 32 | }, 33 | } 34 | -------------------------------------------------------------------------------- /lua/plugins/neotest_vitest.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "marilari88/neotest-vitest", 4 | }, 5 | { 6 | "nvim-neotest/neotest", 7 | opts = { adapters = { "neotest-vitest" } }, 8 | }, 9 | } 10 | -------------------------------------------------------------------------------- /lua/plugins/octo.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- TODO: this is available as an extra, maybe use that? 3 | "pwntester/octo.nvim", 4 | cmd = "Octo", 5 | enabled = false, 6 | event = { { event = "BufReadCmd", pattern = "octo://*" } }, 7 | opts = { 8 | enable_builtin = true, 9 | default_to_projects_v2 = true, 10 | default_merge_method = "squash", 11 | picker = "snacks", 12 | }, 13 | keys = { 14 | { "gi", "Octo issue list", desc = "List Issues (Octo)" }, 15 | { "gI", "Octo issue search", desc = "Search Issues (Octo)" }, 16 | { "gp", "Octo pr list", desc = "List PRs (Octo)" }, 17 | { "gP", "Octo pr search", desc = "Search PRs (Octo)" }, 18 | { "gr", "Octo repo list", desc = "List Repos (Octo)" }, 19 | { "gS", "Octo search", desc = "Search (Octo)" }, 20 | 21 | { "a", "", desc = "+assignee (Octo)", ft = "octo" }, 22 | { "c", "", desc = "+comment/code (Octo)", ft = "octo" }, 23 | { "l", "", desc = "+label (Octo)", ft = "octo" }, 24 | { "i", "", desc = "+issue (Octo)", ft = "octo" }, 25 | { "r", "", desc = "+react (Octo)", ft = "octo" }, 26 | { "p", "", desc = "+pr (Octo)", ft = "octo" }, 27 | { "pr", "", desc = "+rebase (Octo)", ft = "octo" }, 28 | { "ps", "", desc = "+squash (Octo)", ft = "octo" }, 29 | { "v", "", desc = "+review (Octo)", ft = "octo" }, 30 | { "g", "", desc = "+goto_issue (Octo)", ft = "octo" }, 31 | { "@", "@", mode = "i", ft = "octo", silent = true }, 32 | { "#", "#", mode = "i", ft = "octo", silent = true }, 33 | }, 34 | } 35 | -------------------------------------------------------------------------------- /lua/plugins/oil.lua: -------------------------------------------------------------------------------- 1 | -- vim-vinegar-like file 2 | -- browser 3 | return { 4 | { 5 | "stevearc/oil.nvim", 6 | opts = { 7 | view_options = { 8 | show_hidden = true, 9 | }, 10 | -- Hide icon column 11 | columns = {}, 12 | }, 13 | -- Optional dependencies 14 | -- dependencies = { "nvim-tree/nvim-web-devicons" }, 15 | }, 16 | } 17 | -------------------------------------------------------------------------------- /lua/plugins/other.lua: -------------------------------------------------------------------------------- 1 | -- Lets me quickly open test or impl files 2 | return { 3 | { 4 | "rgroli/other.nvim", 5 | config = function() 6 | require("other-nvim").setup({ 7 | mappings = { 8 | -- Mapping for vitest-style tests 9 | { 10 | context = "test", 11 | pattern = "(.*).ts$", 12 | target = "%1.test.ts", 13 | }, 14 | { 15 | context = "implementation", 16 | pattern = "(.*).test.ts$", 17 | target = "%1.ts", 18 | }, 19 | }, 20 | }) 21 | end, 22 | keys = { 23 | { 24 | "oo", 25 | function() 26 | require("other-nvim").open() 27 | end, 28 | desc = "Open test/spec file", 29 | }, 30 | { 31 | "ot", 32 | function() 33 | require("other-nvim").openTabNew() 34 | end, 35 | desc = "Tabopen test/spec file", 36 | }, 37 | }, 38 | }, 39 | } 40 | -------------------------------------------------------------------------------- /lua/plugins/pairs.lua: -------------------------------------------------------------------------------- 1 | -- I generally don't want [] and "" matching. 2 | return { 3 | { "echasnovski/mini.pairs", enabled = false }, 4 | } 5 | -------------------------------------------------------------------------------- /lua/plugins/snacks.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "folke/snacks.nvim", 3 | ---@module 'snacks.nvim' 4 | ---@class snacks.Config 5 | opts = { 6 | -- dashboard (slows down my startup) 7 | dashboard = { 8 | enabled = false, 9 | }, 10 | -- animated scroll (distracting) 11 | scroll = { 12 | enabled = false, 13 | }, 14 | ---@class snacks.indent.Config 15 | indent = { 16 | indent = { 17 | enabled = false, 18 | }, 19 | }, 20 | ---@class snacks.picker.Config 21 | picker = { 22 | icons = { 23 | files = { 24 | enabled = false, 25 | }, 26 | }, 27 | ---@class snacks.picker.formatters.Config 28 | formatters = { 29 | file = { 30 | -- filename_first = true, 31 | }, 32 | }, 33 | win = { 34 | input = { 35 | keys = { 36 | [""] = { 37 | "edit_tab", 38 | mode = { "n", "i" }, 39 | }, 40 | }, 41 | }, 42 | }, 43 | }, 44 | }, 45 | } 46 | -------------------------------------------------------------------------------- /lua/plugins/tardis.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "fredeeb/tardis.nvim", 3 | dependencies = { "nvim-lua/plenary.nvim" }, 4 | config = function() 5 | require("tardis-nvim").setup({ 6 | keymap = { 7 | ["next"] = "", -- next entry in log (older) 8 | ["prev"] = "", -- previous entry in log (newer) 9 | ["quit"] = "q", -- quit all 10 | ["revision_message"] = "", -- show revision message for current revision 11 | }, 12 | initial_revisions = 10, -- initial revisions to create buffers for 13 | max_revisions = 256, -- max number of revisions to load 14 | }) 15 | end, 16 | } 17 | -------------------------------------------------------------------------------- /lua/plugins/treesitter.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-treesitter/nvim-treesitter", 3 | opts = function(_, opts) 4 | opts.indent.enable = false 5 | if type(opts.ensure_installed) == "table" then 6 | vim.list_extend(opts.ensure_installed, { "typescript", "tsx" }) 7 | end 8 | end, 9 | } 10 | -------------------------------------------------------------------------------- /lua/plugins/tsc.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "dmmulroy/tsc.nvim", 3 | config = function() 4 | require("tsc").setup({ 5 | enable_progress_notifications = false, 6 | use_trouble_qflist = true, 7 | flags = { 8 | watch = true, 9 | }, 10 | }) 11 | end, 12 | } 13 | -------------------------------------------------------------------------------- /lua/plugins/typescript.lua: -------------------------------------------------------------------------------- 1 | return { 2 | recommended = function() 3 | return LazyVim.extras.wants({ 4 | ft = { 5 | "javascript", 6 | "javascriptreact", 7 | "javascript.jsx", 8 | "typescript", 9 | "typescriptreact", 10 | "typescript.tsx", 11 | }, 12 | root = { "tsconfig.json", "package.json", "jsconfig.json" }, 13 | }) 14 | end, 15 | 16 | -- correctly setup lspconfig 17 | { 18 | "neovim/nvim-lspconfig", 19 | opts = { 20 | -- make sure mason installs the server 21 | servers = { 22 | --- @deprecated -- tsserver renamed to ts_ls but not yet released, so keep this for now 23 | --- the proper approach is to check the nvim-lspconfig release version when it's released to determine the server name dynamically 24 | tsserver = { 25 | enabled = false, 26 | }, 27 | ts_ls = { 28 | enabled = false, 29 | }, 30 | vtsls = { 31 | -- explicitly add default filetypes, so that we can extend 32 | -- them in related extras 33 | filetypes = { 34 | "javascript", 35 | "javascriptreact", 36 | "javascript.jsx", 37 | "typescript", 38 | "typescriptreact", 39 | "typescript.tsx", 40 | }, 41 | settings = { 42 | complete_function_calls = true, 43 | vtsls = { 44 | enableMoveToFileCodeAction = true, 45 | autoUseWorkspaceTsdk = true, 46 | experimental = { 47 | maxInlayHintLength = 30, 48 | completion = { 49 | enableServerSideFuzzyMatch = true, 50 | }, 51 | }, 52 | }, 53 | typescript = { 54 | updateImportsOnFileMove = { enabled = "always" }, 55 | suggest = { 56 | completeFunctionCalls = true, 57 | }, 58 | inlayHints = { 59 | enumMemberValues = { enabled = true }, 60 | functionLikeReturnTypes = { enabled = false }, 61 | parameterNames = { enabled = false }, 62 | parameterTypes = { enabled = false }, 63 | propertyDeclarationTypes = { enabled = false }, 64 | variableTypes = { enabled = false }, 65 | }, 66 | }, 67 | }, 68 | keys = { 69 | { 70 | "gD", 71 | function() 72 | local params = vim.lsp.util.make_position_params() 73 | LazyVim.lsp.execute({ 74 | command = "typescript.goToSourceDefinition", 75 | arguments = { params.textDocument.uri, params.position }, 76 | open = true, 77 | }) 78 | end, 79 | desc = "Goto Source Definition", 80 | }, 81 | { 82 | "gR", 83 | function() 84 | LazyVim.lsp.execute({ 85 | command = "typescript.findAllFileReferences", 86 | arguments = { vim.uri_from_bufnr(0) }, 87 | open = true, 88 | }) 89 | end, 90 | desc = "File References", 91 | }, 92 | { 93 | "co", 94 | LazyVim.lsp.action["source.organizeImports"], 95 | desc = "Organize Imports", 96 | }, 97 | { 98 | "cM", 99 | LazyVim.lsp.action["source.addMissingImports.ts"], 100 | desc = "Add missing imports", 101 | }, 102 | { 103 | "cu", 104 | LazyVim.lsp.action["source.removeUnused.ts"], 105 | desc = "Remove unused imports", 106 | }, 107 | { 108 | "cD", 109 | LazyVim.lsp.action["source.fixAll.ts"], 110 | desc = "Fix all diagnostics", 111 | }, 112 | { 113 | "cV", 114 | function() 115 | LazyVim.lsp.execute({ command = "typescript.selectTypeScriptVersion" }) 116 | end, 117 | desc = "Select TS workspace version", 118 | }, 119 | }, 120 | }, 121 | }, 122 | setup = { 123 | --- @deprecated -- tsserver renamed to ts_ls but not yet released, so keep this for now 124 | --- the proper approach is to check the nvim-lspconfig release version when it's released to determine the server name dynamically 125 | tsserver = function() 126 | -- disable tsserver 127 | return true 128 | end, 129 | ts_ls = function() 130 | -- disable tsserver 131 | return true 132 | end, 133 | vtsls = function(_, opts) 134 | LazyVim.lsp.on_attach(function(client, buffer) 135 | client.commands["_typescript.moveToFileRefactoring"] = function(command, ctx) 136 | ---@type string, string, lsp.Range 137 | local action, uri, range = unpack(command.arguments) 138 | 139 | local function move(newf) 140 | client.request("workspace/executeCommand", { 141 | command = command.command, 142 | arguments = { action, uri, range, newf }, 143 | }) 144 | end 145 | 146 | local fname = vim.uri_to_fname(uri) 147 | client.request("workspace/executeCommand", { 148 | command = "typescript.tsserverRequest", 149 | arguments = { 150 | "getMoveToRefactoringFileSuggestions", 151 | { 152 | file = fname, 153 | startLine = range.start.line + 1, 154 | startOffset = range.start.character + 1, 155 | endLine = range["end"].line + 1, 156 | endOffset = range["end"].character + 1, 157 | }, 158 | }, 159 | }, function(_, result) 160 | ---@type string[] 161 | local files = result.body.files 162 | table.insert(files, 1, "Enter new path...") 163 | vim.ui.select(files, { 164 | prompt = "Select move destination:", 165 | format_item = function(f) 166 | return vim.fn.fnamemodify(f, ":~:.") 167 | end, 168 | }, function(f) 169 | if f and f:find("^Enter new path") then 170 | vim.ui.input({ 171 | prompt = "Enter move destination:", 172 | default = vim.fn.fnamemodify(fname, ":h") .. "/", 173 | completion = "file", 174 | }, function(newf) 175 | return newf and move(newf) 176 | end) 177 | elseif f then 178 | move(f) 179 | end 180 | end) 181 | end) 182 | end 183 | end, "vtsls") 184 | -- copy typescript settings to javascript 185 | opts.settings.javascript = 186 | vim.tbl_deep_extend("force", {}, opts.settings.typescript, opts.settings.javascript or {}) 187 | end, 188 | }, 189 | }, 190 | }, 191 | 192 | { 193 | "mfussenegger/nvim-dap", 194 | optional = true, 195 | dependencies = { 196 | { 197 | "williamboman/mason.nvim", 198 | opts = function(_, opts) 199 | opts.ensure_installed = opts.ensure_installed or {} 200 | table.insert(opts.ensure_installed, "js-debug-adapter") 201 | end, 202 | }, 203 | }, 204 | opts = function() 205 | local dap = require("dap") 206 | if not dap.adapters["pwa-node"] then 207 | require("dap").adapters["pwa-node"] = { 208 | type = "server", 209 | host = "localhost", 210 | port = "${port}", 211 | executable = { 212 | command = "node", 213 | -- 💀 Make sure to update this path to point to your installation 214 | args = { 215 | LazyVim.get_pkg_path("js-debug-adapter", "/js-debug/src/dapDebugServer.js"), 216 | "${port}", 217 | }, 218 | }, 219 | } 220 | end 221 | if not dap.adapters["node"] then 222 | dap.adapters["node"] = function(cb, config) 223 | if config.type == "node" then 224 | config.type = "pwa-node" 225 | end 226 | local nativeAdapter = dap.adapters["pwa-node"] 227 | if type(nativeAdapter) == "function" then 228 | nativeAdapter(cb, config) 229 | else 230 | cb(nativeAdapter) 231 | end 232 | end 233 | end 234 | 235 | local js_filetypes = { "typescript", "javascript", "typescriptreact", "javascriptreact" } 236 | 237 | local vscode = require("dap.ext.vscode") 238 | vscode.type_to_filetypes["node"] = js_filetypes 239 | vscode.type_to_filetypes["pwa-node"] = js_filetypes 240 | 241 | for _, language in ipairs(js_filetypes) do 242 | if not dap.configurations[language] then 243 | dap.configurations[language] = { 244 | { 245 | type = "pwa-node", 246 | request = "launch", 247 | name = "Launch file", 248 | program = "${file}", 249 | cwd = "${workspaceFolder}", 250 | }, 251 | { 252 | type = "pwa-node", 253 | request = "attach", 254 | name = "Attach", 255 | processId = require("dap.utils").pick_process, 256 | cwd = "${workspaceFolder}", 257 | }, 258 | } 259 | end 260 | end 261 | end, 262 | }, 263 | 264 | -- Filetype icons 265 | { 266 | "echasnovski/mini.icons", 267 | opts = { 268 | file = { 269 | [".eslintrc.js"] = { glyph = "󰱺", hl = "MiniIconsYellow" }, 270 | [".node-version"] = { glyph = "", hl = "MiniIconsGreen" }, 271 | [".prettierrc"] = { glyph = "", hl = "MiniIconsPurple" }, 272 | [".yarnrc.yml"] = { glyph = "", hl = "MiniIconsBlue" }, 273 | ["eslint.config.js"] = { glyph = "󰱺", hl = "MiniIconsYellow" }, 274 | ["package.json"] = { glyph = "", hl = "MiniIconsGreen" }, 275 | ["tsconfig.json"] = { glyph = "", hl = "MiniIconsAzure" }, 276 | ["tsconfig.build.json"] = { glyph = "", hl = "MiniIconsAzure" }, 277 | ["yarn.lock"] = { glyph = "", hl = "MiniIconsBlue" }, 278 | }, 279 | }, 280 | }, 281 | } 282 | -------------------------------------------------------------------------------- /stylua.toml: -------------------------------------------------------------------------------- 1 | indent_type = "Spaces" 2 | indent_width = 2 3 | column_width = 120 --------------------------------------------------------------------------------