From 7b113e41969a10a68b041ff07351283b4868e005 Mon Sep 17 00:00:00 2001 From: histalek Date: Wed, 15 Jan 2025 13:02:34 +0100 Subject: [PATCH] feat(nvim): Move from LazyVim to a custom conf --- .config/nvim/.gitignore | 8 - .config/nvim/.neoconf.json | 15 -- .config/nvim/LICENSE | 201 ------------------ .config/nvim/README.md | 4 - .config/nvim/init.lua | 5 +- .config/nvim/lazy-lock.json | 44 +--- .config/nvim/lazyvim.json | 9 - .config/nvim/lua/config/autocmds.lua | 133 +++++++++++- .config/nvim/lua/config/core.lua | 106 +++++++++ .config/nvim/lua/config/keymaps.lua | 145 ++++++++++--- .config/nvim/lua/config/lazy.lua | 103 ++++----- .config/nvim/lua/config/options.lua | 44 ++-- .config/nvim/lua/config/plugins/blink-cmp.lua | 29 +++ .../nvim/lua/config/plugins/bufferline.lua | 47 ++++ .config/nvim/lua/config/plugins/crates.lua | 17 ++ .config/nvim/lua/config/plugins/flash.lua | 12 ++ .config/nvim/lua/config/plugins/ft.lua | 21 ++ .config/nvim/lua/config/plugins/fzf.lua | 112 ++++++++++ .../lua/{ => config}/plugins/gitsigns.lua | 0 .config/nvim/lua/config/plugins/grug-far.lua | 22 ++ .config/nvim/lua/config/plugins/lsp.lua | 71 +++++++ .config/nvim/lua/config/plugins/lualine.lua | 44 ++++ .config/nvim/lua/config/plugins/mini-ai.lua | 35 +++ .../nvim/lua/config/plugins/mini-icons.lua | 19 ++ .config/nvim/lua/config/plugins/noice.lua.bak | 52 +++++ .config/nvim/lua/{ => config}/plugins/oil.lua | 3 +- .config/nvim/lua/config/plugins/snacks.lua | 46 ++++ .../nvim/lua/config/plugins/todo-comments.lua | 24 +++ .../lua/config/plugins/treesitter-context.lua | 3 + .../{ => config}/plugins/treesitter-just.lua | 0 .../nvim/lua/config/plugins/treesitter.lua | 4 + .config/nvim/lua/config/plugins/whichkey.lua | 54 +++++ .config/nvim/lua/plugins/alloy.lua | 4 - .config/nvim/lua/plugins/blink-cmp.lua | 22 -- .config/nvim/lua/plugins/caddyfile.lua | 4 - .config/nvim/lua/plugins/disabled.lua | 13 -- .config/nvim/lua/plugins/gleam.lua | 4 - .config/nvim/lua/plugins/jinja.lua | 4 - .config/nvim/lua/plugins/lsp.lua | 20 -- .config/nvim/lua/plugins/neogit.lua | 9 - .config/nvim/lua/plugins/noice.lua | 53 ----- .config/nvim/lua/plugins/telescope.lua | 18 -- .config/nvim/lua/plugins/vim-just.lua | 5 - .config/nvim/stylua.toml | 3 - .config/nvim/syntax/hiswiki.lua | 13 -- 45 files changed, 1045 insertions(+), 559 deletions(-) delete mode 100644 .config/nvim/.gitignore delete mode 100644 .config/nvim/.neoconf.json delete mode 100644 .config/nvim/LICENSE delete mode 100644 .config/nvim/README.md delete mode 100644 .config/nvim/lazyvim.json create mode 100644 .config/nvim/lua/config/core.lua create mode 100644 .config/nvim/lua/config/plugins/blink-cmp.lua create mode 100644 .config/nvim/lua/config/plugins/bufferline.lua create mode 100644 .config/nvim/lua/config/plugins/crates.lua create mode 100644 .config/nvim/lua/config/plugins/flash.lua create mode 100644 .config/nvim/lua/config/plugins/ft.lua create mode 100644 .config/nvim/lua/config/plugins/fzf.lua rename .config/nvim/lua/{ => config}/plugins/gitsigns.lua (100%) create mode 100644 .config/nvim/lua/config/plugins/grug-far.lua create mode 100644 .config/nvim/lua/config/plugins/lsp.lua create mode 100644 .config/nvim/lua/config/plugins/lualine.lua create mode 100644 .config/nvim/lua/config/plugins/mini-ai.lua create mode 100644 .config/nvim/lua/config/plugins/mini-icons.lua create mode 100644 .config/nvim/lua/config/plugins/noice.lua.bak rename .config/nvim/lua/{ => config}/plugins/oil.lua (72%) create mode 100644 .config/nvim/lua/config/plugins/snacks.lua create mode 100644 .config/nvim/lua/config/plugins/todo-comments.lua create mode 100644 .config/nvim/lua/config/plugins/treesitter-context.lua rename .config/nvim/lua/{ => config}/plugins/treesitter-just.lua (100%) create mode 100644 .config/nvim/lua/config/plugins/treesitter.lua create mode 100644 .config/nvim/lua/config/plugins/whichkey.lua delete mode 100644 .config/nvim/lua/plugins/alloy.lua delete mode 100644 .config/nvim/lua/plugins/blink-cmp.lua delete mode 100644 .config/nvim/lua/plugins/caddyfile.lua delete mode 100644 .config/nvim/lua/plugins/disabled.lua delete mode 100644 .config/nvim/lua/plugins/gleam.lua delete mode 100644 .config/nvim/lua/plugins/jinja.lua delete mode 100644 .config/nvim/lua/plugins/lsp.lua delete mode 100644 .config/nvim/lua/plugins/neogit.lua delete mode 100644 .config/nvim/lua/plugins/noice.lua delete mode 100644 .config/nvim/lua/plugins/telescope.lua delete mode 100644 .config/nvim/lua/plugins/vim-just.lua delete mode 100644 .config/nvim/stylua.toml delete mode 100644 .config/nvim/syntax/hiswiki.lua diff --git a/.config/nvim/.gitignore b/.config/nvim/.gitignore deleted file mode 100644 index cc5457a..0000000 --- a/.config/nvim/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -tt.* -.tests -doc/tags -debug -.repro -foo.* -*.log -data diff --git a/.config/nvim/.neoconf.json b/.config/nvim/.neoconf.json deleted file mode 100644 index 7c48087..0000000 --- a/.config/nvim/.neoconf.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "neodev": { - "library": { - "enabled": true, - "plugins": true - } - }, - "neoconf": { - "plugins": { - "lua_ls": { - "enabled": true - } - } - } -} diff --git a/.config/nvim/LICENSE b/.config/nvim/LICENSE deleted file mode 100644 index 261eeb9..0000000 --- a/.config/nvim/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/.config/nvim/README.md b/.config/nvim/README.md deleted file mode 100644 index 185280b..0000000 --- a/.config/nvim/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# đŸ’€ LazyVim - -A starter template for [LazyVim](https://github.com/LazyVim/LazyVim). -Refer to the [documentation](https://lazyvim.github.io/installation) to get started. diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 2514f9e..efe50e2 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,2 +1,5 @@ --- bootstrap lazy.nvim, LazyVim and your plugins +require("config.options") +require("config.core") require("config.lazy") +require("config.autocmds") +require("config.keymaps") diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index efa7ef9..0c0af98 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,54 +1,30 @@ { - "LazyVim": { "branch": "main", "commit": "d0c366e4d861b848bdc710696d5311dca2c6d540" }, - "SchemaStore.nvim": { "branch": "main", "commit": "545d8814f624fb5239c4691fa0914549540e6f53" }, - "blink.cmp": { "branch": "main", "commit": "5f442681df24fe705d1ee7ce5b4d435aa4b4dee4" }, - "bufferline.nvim": { "branch": "main", "commit": "5726c4e291224181903e960119a11e20ac677a0a" }, - "catppuccin": { "branch": "main", "commit": "c9e205fe035d622b3c2d66ee42edf368c0c31fd5" }, - "conform.nvim": { "branch": "master", "commit": "339b3e4519ec49312d34fcfa275aa15bfaa67025" }, + "blink.cmp": { "branch": "main", "commit": "1cc3b1a908fbcfd15451c4772759549724f38524" }, + "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, "crates.nvim": { "branch": "main", "commit": "1c924d5a9ea3496c4e1a02d0d51388ba809f8468" }, - "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "flash.nvim": { "branch": "main", "commit": "ec0bf2842189f65f60fd40bf3557cac1029cc932" }, "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, - "fzf-lua": { "branch": "main", "commit": "76e25abc4bbaab243b52fad7f7d4262e76254fd3" }, + "fzf-lua": { "branch": "main", "commit": "e59fac8ac4188984a2b69d4a7d1375ccb866dbbb" }, "gitsigns.nvim": { "branch": "main", "commit": "0b04035bb7b3c83e999b9676e2fb46fd0aa9f910" }, "gleam.vim": { "branch": "master", "commit": "6739d8b656adb5d2807675b7652afb6e257b2b1c" }, - "grug-far.nvim": { "branch": "main", "commit": "c88435b825a35bfa468b47159709b3221976ecd1" }, - "harpoon": { "branch": "harpoon2", "commit": "a84ab829eaf3678b586609888ef52f7779102263" }, + "grug-far.nvim": { "branch": "main", "commit": "8e8f3429038d45a6d4144c0642d92f470e5480f3" }, "jinja.vim": { "branch": "master", "commit": "70c2d09857bc2ff75a91b017271ffaa004201df9" }, "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, "lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" }, "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, - "markdown-preview.nvim": { "branch": "master", "commit": "9becceee5740b7db6914da87358a183ad11b2049" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "8e46de9241d3997927af12196bd8faa0ed08c29a" }, - "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "mini.ai": { "branch": "main", "commit": "40e380a589d07ec2c856940c6422aafe5d949a0d" }, - "mini.hipatterns": { "branch": "main", "commit": "fdad87bf545aec5210ca9a2c49fddf6284d72d1e" }, "mini.icons": { "branch": "main", "commit": "a2742459f0ee32806c2438ca06b4d8b331f3f4d4" }, - "mini.pairs": { "branch": "main", "commit": "7e834c5937d95364cc1740e20d673afe2d034cdb" }, - "neogit": { "branch": "master", "commit": "43fa47fb61773b0d90a78ebc2521ea8faaeebd86" }, - "noice.nvim": { "branch": "main", "commit": "424053c6de606701e5b5129d1a851a87ef249f65" }, - "nui.nvim": { "branch": "main", "commit": "a0fd35fcbb4cb479366f1dc5f20145fd718a3733" }, - "nvim-ansible": { "branch": "main", "commit": "44dabdaa8a9193b7f564a8408ed6d7107705030a" }, - "nvim-lint": { "branch": "master", "commit": "1fea92f1d9908eaa5eb8bafe08b4293d7aadaa55" }, - "nvim-lspconfig": { "branch": "master", "commit": "040001d85e9190a904d0e35ef5774633e14d8475" }, - "nvim-treesitter": { "branch": "master", "commit": "eb3e850acff4d9f2f2dd8dacd75353043c899753" }, - "nvim-treesitter-context": { "branch": "master", "commit": "2bcf700b59bc92850ca83a1c02e86ba832e0fae0" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" }, - "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" }, + "nvim-lspconfig": { "branch": "master", "commit": "343ac34abc7ab53fae33357f915024aaacb76a3e" }, + "nvim-treesitter": { "branch": "master", "commit": "cfc6f2c117aaaa82f19bcce44deec2c194d900ab" }, + "nvim-treesitter-context": { "branch": "master", "commit": "d0dd7ce5a9d0be1f28086e818e52fdc5c78975df" }, "nvim-web-devicons": { "branch": "master", "commit": "5b9067899ee6a2538891573500e8fd6ff008440f" }, "oil.nvim": { "branch": "master", "commit": "ba858b662599eab8ef1cba9ab745afded99cb180" }, - "persistence.nvim": { "branch": "main", "commit": "c45ff862b53ce07a853a753fb0b33e148dbb99d2" }, "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, - "render-markdown.nvim": { "branch": "main", "commit": "3a08669e9641ba382bc428f1776bff524a2431a1" }, - "rustaceanvim": { "branch": "master", "commit": "6db1fe9e3f005b2e0921c7302d2c195eeb90a451" }, - "snacks.nvim": { "branch": "main", "commit": "6a837597b3570df88946c69cca7ab810ca7f05f5" }, - "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, + "schemastore.nvim": { "branch": "main", "commit": "b16e414615f4dd7514f9df13dc9fa93e86d05a37" }, + "snacks.nvim": { "branch": "main", "commit": "b5f4f27b28f7803509739bfde93dc0b8a953f3f4" }, "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, "tokyonight.nvim": { "branch": "main", "commit": "b262293ef481b0d1f7a14c708ea7ca649672e200" }, - "treesitter-just": { "branch": "main", "commit": "4f4e566fe47c30b14cfe388a28f70b79009609e5" }, - "trouble.nvim": { "branch": "main", "commit": "40c5317a6e90fe3393f07b0fee580d9e93a216b4" }, - "ts-comments.nvim": { "branch": "main", "commit": "79e4337e4231ff8ca33dab85162b5ee8e78f22ce" }, - "venv-selector.nvim": { "branch": "regexp", "commit": "e82594274bf7b54387f9a2abe65f74909ac66e97" }, + "treesitter-just": { "branch": "main", "commit": "bb0c898a80644de438e6efe5d88d30bf092935cd" }, "vim-alloy": { "branch": "main", "commit": "0273f88f7199189f9a0f32213a34ab778e226f86" }, "vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" }, "vim-just": { "branch": "main", "commit": "ed67f198e981f555c0f9e9ed5b69b4b06543a9e1" }, diff --git a/.config/nvim/lazyvim.json b/.config/nvim/lazyvim.json deleted file mode 100644 index 82e173e..0000000 --- a/.config/nvim/lazyvim.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extras": [ - - ], - "news": { - "NEWS.md": "10960" - }, - "version": 7 -} \ No newline at end of file diff --git a/.config/nvim/lua/config/autocmds.lua b/.config/nvim/lua/config/autocmds.lua index 8261668..c12295b 100644 --- a/.config/nvim/lua/config/autocmds.lua +++ b/.config/nvim/lua/config/autocmds.lua @@ -1,11 +1,126 @@ --- Autocmds are automatically loaded on the VeryLazy event --- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua --- Add any additional autocmds here +local function augroup(name) + return vim.api.nvim_create_augroup("histanvim_" .. name, { clear = true }) +end ---- test blinry's wiki setup -vim.api.nvim_create_autocmd({ "bufnewfile", "bufread" }, { - pattern = os.getenv("HOME") .. "/Documents/wiki/*", - callback = function() - vim.bo.filetype = "hiswiki" - end, +-- Check if we need to reload the file when it changed +vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, { + group = augroup("checktime"), + callback = function() + if vim.o.buftype ~= "nofile" then + vim.cmd("checktime") + end + end, +}) + +-- Highlight on yank +vim.api.nvim_create_autocmd("TextYankPost", { + group = augroup("highlight_yank"), + callback = function() + (vim.hl or vim.highlight).on_yank() + end, +}) + +-- resize splits if window got resized +vim.api.nvim_create_autocmd({ "VimResized" }, { + group = augroup("resize_splits"), + callback = function() + local current_tab = vim.fn.tabpagenr() + vim.cmd("tabdo wincmd =") + vim.cmd("tabnext " .. current_tab) + end, +}) + +-- go to last loc when opening a buffer +vim.api.nvim_create_autocmd("BufReadPost", { + group = augroup("last_loc"), + callback = function(event) + local exclude = { "gitcommit" } + local buf = event.buf + if vim.tbl_contains(exclude, vim.bo[buf].filetype) or vim.b[buf].lazyvim_last_loc then + return + end + vim.b[buf].lazyvim_last_loc = true + local mark = vim.api.nvim_buf_get_mark(buf, '"') + local lcount = vim.api.nvim_buf_line_count(buf) + if mark[1] > 0 and mark[1] <= lcount then + pcall(vim.api.nvim_win_set_cursor, 0, mark) + end + end, +}) + +-- close some filetypes with +vim.api.nvim_create_autocmd("FileType", { + group = augroup("close_with_q"), + pattern = { + "PlenaryTestPopup", + "checkhealth", + "dbout", + "gitsigns-blame", + "grug-far", + "help", + "lspinfo", + "neotest-output", + "neotest-output-panel", + "neotest-summary", + "notify", + "oil", + "qf", + "spectre_panel", + "startuptime", + "tsplayground", + }, + -- TODO: Fix error on trying to delete last buffer + callback = function(event) + vim.bo[event.buf].buflisted = false + vim.schedule(function() + vim.keymap.set("n", "q", function() + vim.cmd("close") + pcall(vim.api.nvim_buf_delete, event.buf, { force = true }) + end, { + buffer = event.buf, + silent = true, + desc = "Quit buffer", + }) + end) + end, +}) + +-- make it easier to close man-files when opened inline +vim.api.nvim_create_autocmd("FileType", { + group = augroup("man_unlisted"), + pattern = { "man" }, + callback = function(event) + vim.bo[event.buf].buflisted = false + end, +}) + +-- wrap and check for spell in text filetypes +vim.api.nvim_create_autocmd("FileType", { + group = augroup("wrap_spell"), + pattern = { "text", "plaintex", "typst", "gitcommit", "markdown" }, + callback = function() + vim.opt_local.wrap = true + vim.opt_local.spell = true + end, +}) + +-- Fix conceallevel for json files +vim.api.nvim_create_autocmd({ "FileType" }, { + group = augroup("json_conceal"), + pattern = { "json", "jsonc", "json5" }, + callback = function() + vim.opt_local.conceallevel = 0 + end, +}) + +-- Auto create dir when saving a file, in case some intermediate directory does not exist +vim.api.nvim_create_autocmd({ "BufWritePre" }, { + group = augroup("auto_create_dir"), + callback = function(event) + if event.match:match("^%w%w+:[\\/][\\/]") then + return + end + local file = vim.uv.fs_realpath(event.match) or event.match + vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p") + end, }) diff --git a/.config/nvim/lua/config/core.lua b/.config/nvim/lua/config/core.lua new file mode 100644 index 0000000..3bcadba --- /dev/null +++ b/.config/nvim/lua/config/core.lua @@ -0,0 +1,106 @@ +CORE = { + icons = { + misc = { + dots = "󰇘", + }, + ft = { + octo = "", + }, + dap = { + Stopped = { "󰁕 ", "DiagnosticWarn", "DapStoppedLine" }, + Breakpoint = " ", + BreakpointCondition = " ", + BreakpointRejected = { "ïȘ ", "DiagnosticError" }, + LogPoint = ".>", + }, + diagnostics = { + Error = " ", + Warn = " ", + Hint = " ", + Info = " ", + }, + git = { + added = " ", + modified = " ", + removed = " ", + }, + kinds = { + Array = "îȘŠ ", + Boolean = "󰹙 ", + Class = " ", + Codeium = "󰘊 ", + Color = " ", + Control = "î©š ", + Collapsed = " ", + Constant = "󰏿 ", + Constructor = "ïŁ ", + Copilot = "ï’ž ", + Enum = " ", + EnumMember = " ", + Event = "îȘ† ", + Field = " ", + File = "î©» ", + Folder = " ", + Function = "󰊕 ", + Interface = " ", + Key = "îȘ“ ", + Keyword = "î­ą ", + Method = "󰊕 ", + Module = " ", + Namespace = "ó°Šź ", + Null = " ", + Number = "󰎠 ", + Object = "îȘ‹ ", + Operator = "î­€ ", + Package = " ", + Property = " ", + Reference = " ", + Snippet = "󱄜 ", + String = "îȘ± ", + Struct = "󰆌 ", + Supermaven = " ", + TabNine = "󰏚 ", + Text = "îȘ“ ", + TypeParameter = "îȘ’ ", + Unit = "îȘ– ", + Value = "îȘ“ ", + Variable = "󰀫 ", + }, + }, + ---@type table? + kind_filter = { + default = { + "Class", + "Constructor", + "Enum", + "Field", + "Function", + "Interface", + "Method", + "Module", + "Namespace", + "Package", + "Property", + "Struct", + "Trait", + }, + markdown = false, + help = false, + -- you can specify a different filter for each filetype + lua = { + "Class", + "Constructor", + "Enum", + "Field", + "Function", + "Interface", + "Method", + "Module", + "Namespace", + -- "Package", -- remove package since luals uses it for control flow structures + "Property", + "Struct", + "Trait", + }, + }, +} diff --git a/.config/nvim/lua/config/keymaps.lua b/.config/nvim/lua/config/keymaps.lua index 413c38f..6512e14 100644 --- a/.config/nvim/lua/config/keymaps.lua +++ b/.config/nvim/lua/config/keymaps.lua @@ -1,32 +1,125 @@ --- Keymaps are automatically loaded on the VeryLazy event --- Default keymaps that are always set: --- https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua --- Add any additional keymaps here +local map = vim.keymap.set --- copied from LazyVim -local function map(mode, lhs, rhs, opts) - local keys = require("lazy.core.handler").handlers.keys - ---@cast keys LazyKeysHandler - -- do not create the keymap if a lazy keys handler exists - if not keys.active[keys.parse({ lhs, mode = mode }).id] then - opts = opts or {} - opts.silent = opts.silent ~= false - if opts.remap and not vim.g.vscode then - opts.remap = nil +-- -- better up/down +-- map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { desc = "Down", expr = true, silent = true }) +-- map({ "n", "x" }, "", "v:count == 0 ? 'gj' : 'j'", { desc = "Down", expr = true, silent = true }) +-- map({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { desc = "Up", expr = true, silent = true }) +-- map({ "n", "x" }, "", "v:count == 0 ? 'gk' : 'k'", { desc = "Up", expr = true, silent = true }) + +-- Move to window using the hjkl keys +map("n", "", "h", { desc = "Go to Left Window", remap = true }) +map("n", "", "j", { desc = "Go to Lower Window", remap = true }) +map("n", "", "k", { desc = "Go to Upper Window", remap = true }) +map("n", "", "l", { desc = "Go to Right Window", remap = true }) + +-- buffers +map("n", "bd", function() + Snacks.bufdelete() +end, { desc = "Delete Buffer" }) +map("n", "bD", ":bd", { desc = "Delete Buffer and Window" }) + +-- Clear search and stop snippet on escape +-- map({ "i", "n", "s" }, "", function() +-- vim.cmd("noh") +-- LazyVim.cmp.actions.snippet_stop() +-- return "" +-- end, { expr = true, desc = "Escape and Clear hlsearch" }) + +-- Clear search, diff update and redraw +-- taken from runtime/lua/_editor.lua +map( + "n", + "ur", + "nohlsearchdiffupdatenormal! ", + { desc = "Redraw / Clear hlsearch / Diff Update" } +) + +-- https://github.com/mhinz/vim-galore#saner-behavior-of-n-and-n +map("n", "n", "'Nn'[v:searchforward].'zv'", { expr = true, desc = "Next Search Result" }) +map("x", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next Search Result" }) +map("o", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next Search Result" }) +map("n", "N", "'nN'[v:searchforward].'zv'", { expr = true, desc = "Prev Search Result" }) +map("x", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev Search Result" }) +map("o", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev Search Result" }) + +-- Add undo break-points +map("i", ",", ",u") +map("i", ".", ".u") +map("i", ";", ";u") + +--keywordprg +map("n", "K", "norm! K", { desc = "Keywordprg" }) + +-- better indenting +map("v", "<", "", ">gv") + +-- commenting +map("n", "gco", "oVcxnormal gccfxa", { desc = "Add Comment Below" }) +map("n", "gcO", "OVcxnormal gccfxa", { desc = "Add Comment Above" }) + +-- lazy +map("n", "l", "Lazy", { desc = "Lazy" }) + +map("n", "xl", "lopen", { desc = "Location List" }) +map("n", "xq", "copen", { desc = "Quickfix List" }) + +map("n", "[q", vim.cmd.cprev, { desc = "Previous Quickfix" }) +map("n", "]q", vim.cmd.cnext, { desc = "Next Quickfix" }) + +-- diagnostic +local diagnostic_goto = function(next, severity) + local go = next and vim.diagnostic.goto_next or vim.diagnostic.goto_prev + severity = severity and vim.diagnostic.severity[severity] or nil + return function() + go({ severity = severity }) end - vim.keymap.set(mode, lhs, rhs, opts) - end +end +map("n", "cd", vim.diagnostic.open_float, { desc = "Line Diagnostics" }) +map("n", "]d", diagnostic_goto(true), { desc = "Next Diagnostic" }) +map("n", "[d", diagnostic_goto(false), { desc = "Prev Diagnostic" }) +map("n", "]e", diagnostic_goto(true, "ERROR"), { desc = "Next Error" }) +map("n", "[e", diagnostic_goto(false, "ERROR"), { desc = "Prev Error" }) +map("n", "]w", diagnostic_goto(true, "WARN"), { desc = "Next Warning" }) +map("n", "[w", diagnostic_goto(false, "WARN"), { desc = "Prev Warning" }) + +-- stylua: ignore start + +if vim.lsp.inlay_hint then + Snacks.toggle.inlay_hints():map("uh") end --- move when highlighted -map("v", "J", ":m '>+1gv=gv") -map("v", "K", ":m '<-2gv=gv") +map("n", "gb", function() Snacks.git.blame_line() end, { desc = "Git Blame Line" }) +map({ "n", "x" }, "gB", function() Snacks.gitbrowse() end, { desc = "Git Browse (open)" }) +-- map({ "n", "x" }, "gY", function() +-- Snacks.gitbrowse({ open = function(url) vim.fn.setreg("+", url) end, notify = false }) +-- end, { desc = "Git Browse (copy)" }) --- delete to void bindings -map("n", "d", '"_d', { desc = "delete to void" }) -map("v", "d", '"_d', { desc = "delete to void" }) +-- highlights under cursor +map("n", "ui", vim.show_pos, { desc = "Inspect Pos" }) +map("n", "uI", "InspectTree", { desc = "Inspect Tree" }) --- yank to system clipboard -map("n", "y", '"+y') -map("v", "y", '"+y') -map("n", "Y", '"+Y') +-- floating terminal +map("n", "fT", function() Snacks.terminal() end, { desc = "Terminal (cwd)" }) +-- map("n", "ft", function() Snacks.terminal(nil, { cwd = LazyVim.root() }) end, { desc = "Terminal (Root Dir)" }) +-- map("n", "", function() Snacks.terminal(nil, { cwd = LazyVim.root() }) end, { desc = "Terminal (Root Dir)" }) + +-- Terminal Mappings +map("t", "", "close", { desc = "Hide Terminal" }) +map("t", "", "close", { desc = "which_key_ignore" }) + +-- windows +map("n", "w", "", { desc = "Windows", remap = true }) +map("n", "-", "s", { desc = "Split Window Below", remap = true }) +map("n", "|", "v", { desc = "Split Window Right", remap = true }) +map("n", "wd", "c", { desc = "Delete Window", remap = true }) + +-- native snippets. only needed on < 0.11, as 0.11 creates these by default +if vim.fn.has("nvim-0.11") == 0 then + map("s", "", function() + return vim.snippet.active({ direction = 1 }) and "lua vim.snippet.jump(1)" or "" + end, { expr = true, desc = "Jump Next" }) + map({ "i", "s" }, "", function() + return vim.snippet.active({ direction = -1 }) and "lua vim.snippet.jump(-1)" or "" + end, { expr = true, desc = "Jump Previous" }) +end diff --git a/.config/nvim/lua/config/lazy.lua b/.config/nvim/lua/config/lazy.lua index b00649e..dd1548f 100644 --- a/.config/nvim/lua/config/lazy.lua +++ b/.config/nvim/lua/config/lazy.lua @@ -1,62 +1,51 @@ +-- Bootstrap lazy.nvim local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" - -if not vim.loop.fs_stat(lazypath) then - -- bootstrap lazy.nvim - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", - lazypath, - }) +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end end -vim.opt.rtp:prepend(vim.env.LAZY or lazypath) +vim.opt.rtp:prepend(lazypath) + +vim.g.mapleader = " " +vim.g.maplocalleader = "\\" require("lazy").setup({ - spec = { - -- add LazyVim and import its plugins - { "LazyVim/LazyVim", import = "lazyvim.plugins" }, - -- import any extras modules here - { import = "lazyvim.plugins.extras.editor.harpoon2" }, - { import = "lazyvim.plugins.extras.lang.ansible" }, - { import = "lazyvim.plugins.extras.lang.git" }, - { import = "lazyvim.plugins.extras.lang.gleam" }, - { import = "lazyvim.plugins.extras.lang.json" }, - { import = "lazyvim.plugins.extras.lang.toml" }, - { import = "lazyvim.plugins.extras.lang.rust" }, - { import = "lazyvim.plugins.extras.lang.python" }, - { import = "lazyvim.plugins.extras.lang.markdown" }, - { import = "lazyvim.plugins.extras.lang.yaml" }, - { import = "lazyvim.plugins.extras.ui.treesitter-context" }, - { import = "lazyvim.plugins.extras.util.mini-hipatterns" }, - -- import/override with your plugins - { import = "plugins" }, - }, - defaults = { - -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. - -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. - lazy = false, - -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, - -- have outdated releases, which may break your Neovim install. - -- version = false, -- always use the latest git commit - version = "*", -- try installing the latest stable version for plugins that support semver - }, - install = { colorscheme = { "tokyonight" } }, - checker = { enabled = false }, - performance = { - rtp = { - -- disable some rtp plugins - disabled_plugins = { - "gzip", - -- "matchit", - -- "matchparen", - "netrwPlugin", - "tarPlugin", - "tohtml", - "tutor", - "zipPlugin", - }, - }, - }, + spec = { + { + "folke/tokyonight.nvim", + config = function() + vim.cmd.colorscheme("tokyonight") + end, + }, + { import = "config.plugins" }, + }, + install = { colorscheme = { "tokyonight" } }, + defaults = { + lazy = false, + version = "*", + }, + performance = { + rtp = { + -- disable some rtp plugins + disabled_plugins = { + "gzip", + -- "matchit", + -- "matchparen", + "netrwPlugin", + "tarPlugin", + "tohtml", + "tutor", + "zipPlugin", + }, + }, + }, }) diff --git a/.config/nvim/lua/config/options.lua b/.config/nvim/lua/config/options.lua index 240656d..ee74bc2 100644 --- a/.config/nvim/lua/config/options.lua +++ b/.config/nvim/lua/config/options.lua @@ -1,7 +1,3 @@ --- Options are automatically loaded before lazy.nvim startup --- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua --- Add any additional options here - local opt = vim.opt vim.g.loaded_perl_provider = 0 @@ -11,18 +7,28 @@ vim.g.loaded_ruby_provider = 0 vim.g.lazygit_config = false --- don't use system clipboard by default (this is set in LazyVim's defaults) -opt.clipboard = "" +vim.g.snacks_animate = true opt.hlsearch = false opt.incsearch = true +opt.clipboard = "" +opt.cursorline = true +opt.list = true +opt.number = true +opt.relativenumber = true opt.scrolloff = 8 - --- disable mouse support, because i'm using it more accidentally then intentionally --- TODO figure out how to disable mouse scrolling from terminal -opt.mouse = "" -opt.mousescroll = "ver:0,hor:0" +opt.showmode = false +opt.signcolumn = "yes" +opt.smartcase = true +opt.smartindent = true +opt.spelllang = { "en" } -- "de"?? +opt.splitbelow = true +opt.splitright = true +opt.statuscolumn = [[%!v:lua.require'snacks.statuscolumn'.get()]] +opt.termguicolors = true +opt.virtualedit = "block" +opt.wildmode = "longest:full,full" -- I like 4 space indents opt.tabstop = 4 @@ -34,6 +40,8 @@ opt.swapfile = false opt.backup = false opt.undodir = os.getenv("HOME") .. "/.local/state/nvim/undodir" opt.undofile = true +opt.undolevels = 10000 +opt.updatetime = 200 -- In my current setup 100 characters line length means that i can have 2 windows side-by-side with -- sway and still see all characters of that line. (110 would be the absolute maximum) @@ -49,19 +57,13 @@ opt.completeopt = { "menu", "menuone", "noselect" } vim.filetype.add({ extension = { - service = "systemd", - socket = "systemd", + alloy = "alloy", + caddy = "caddyfile", container = "systemd", image = "systemd", network = "systemd", - ["container.j2"] = "systemd.jinja", - ["service.j2"] = "systemd.jinja", - ["socket.j2"] = "systemd.jinja", - ["network.j2"] = "systemd.jinja", - ["image.j2"] = "systemd.jinja", - ["yml.j2"] = "yaml.jinja", - ["yaml.j2"] = "yaml.jinja", - ["alloy.j2"] = "alloy.jinja", + service = "systemd", + socket = "systemd", }, pattern = { [".*/sway/conf%.d/.*"] = "swayconfig", diff --git a/.config/nvim/lua/config/plugins/blink-cmp.lua b/.config/nvim/lua/config/plugins/blink-cmp.lua new file mode 100644 index 0000000..73be63f --- /dev/null +++ b/.config/nvim/lua/config/plugins/blink-cmp.lua @@ -0,0 +1,29 @@ +return { + { + "saghen/blink.cmp", + dependencies = "rafamadriz/friendly-snippets", + + opts = { + keymap = { + preset = "default", + + [''] = { 'accept', 'fallback' }, + }, + + appearance = { + nerd_font_variant = "mono", + }, + + completion = { + ghost_text = { + enabled = false + }, + menu = { + auto_show = true + }, + }, + + signature = { enabled = true }, + }, + }, +} diff --git a/.config/nvim/lua/config/plugins/bufferline.lua b/.config/nvim/lua/config/plugins/bufferline.lua new file mode 100644 index 0000000..9a76c56 --- /dev/null +++ b/.config/nvim/lua/config/plugins/bufferline.lua @@ -0,0 +1,47 @@ +return { + "akinsho/bufferline.nvim", + event = "VeryLazy", + keys = { + { "", "BufferLineCyclePrev", desc = "Prev Buffer" }, + { "", "BufferLineCycleNext", desc = "Next Buffer" }, + { "[b", "BufferLineCyclePrev", desc = "Prev Buffer" }, + { "]b", "BufferLineCycleNext", desc = "Next Buffer" }, + { "[B", "BufferLineMovePrev", desc = "Move buffer prev" }, + { "]B", "BufferLineMoveNext", desc = "Move buffer next" }, + }, + opts = { + options = { + close_command = function(n) Snacks.bufdelete(n) end, + right_mouse_command = function(n) Snacks.bufdelete(n) end, + diagnostics = "nvim_lsp", + always_show_bufferline = false, + diagnostics_indicator = function(_, _, diag) + local icons = CORE.icons.diagnostics + local ret = (diag.error and icons.Error .. diag.error .. " " or "") + .. (diag.warning and icons.Warn .. diag.warning or "") + return vim.trim(ret) + end, + offsets = { + { + highlight = "Directory", + text_align = "left", + }, + }, + ---@param opts bufferline.IconFetcherOpts + get_element_icon = function(opts) + return CORE.icons.ft[opts.filetype] + end, + }, + }, + config = function(_, opts) + require("bufferline").setup(opts) + -- Fix bufferline when restoring a session + vim.api.nvim_create_autocmd({ "BufAdd", "BufDelete" }, { + callback = function() + vim.schedule(function() + pcall(nvim_bufferline) + end) + end, + }) + end, +} diff --git a/.config/nvim/lua/config/plugins/crates.lua b/.config/nvim/lua/config/plugins/crates.lua new file mode 100644 index 0000000..c11595f --- /dev/null +++ b/.config/nvim/lua/config/plugins/crates.lua @@ -0,0 +1,17 @@ +return { + "Saecki/crates.nvim", + event = { "BufRead Cargo.toml" }, + opts = { + completion = { + crates = { + enabled = true, + }, + }, + lsp = { + enabled = true, + actions = true, + completion = true, + hover = true, + }, + }, +} diff --git a/.config/nvim/lua/config/plugins/flash.lua b/.config/nvim/lua/config/plugins/flash.lua new file mode 100644 index 0000000..a60e892 --- /dev/null +++ b/.config/nvim/lua/config/plugins/flash.lua @@ -0,0 +1,12 @@ +return { + "folke/flash.nvim", + event = "VeryLazy", + opts = {}, + keys = { + { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, + { "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, + { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" }, + { "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" }, + { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, + }, +} diff --git a/.config/nvim/lua/config/plugins/ft.lua b/.config/nvim/lua/config/plugins/ft.lua new file mode 100644 index 0000000..d7367ef --- /dev/null +++ b/.config/nvim/lua/config/plugins/ft.lua @@ -0,0 +1,21 @@ +return { + { + "grafana/vim-alloy", + ft = "alloy", + }, + { + "isobit/vim-caddyfile", + ft = "caddyfile", + }, + { + "gleam-lang/gleam.vim", + ft = "gleam", + }, + { + "HiPhish/jinja.vim", + }, + { + "NoahTheDuke/vim-just", + ft = "just", + }, +} diff --git a/.config/nvim/lua/config/plugins/fzf.lua b/.config/nvim/lua/config/plugins/fzf.lua new file mode 100644 index 0000000..862c89d --- /dev/null +++ b/.config/nvim/lua/config/plugins/fzf.lua @@ -0,0 +1,112 @@ +return { + "ibhagwan/fzf-lua", + dependencies = { "echasnovski/mini.icons" }, + cmd = "FzfLua", + opts = { + fzf_colors = true, + fzf_opts = { + ["--no-scrollbar"] = true, + }, + defaults = { + formatter = "path.dirname_first", + }, + winopts = { + width = 0.8, + height = 0.8, + row = 0.5, + col = 0.5, + preview = { + scrollchars = { "┃", "" }, + }, + }, + files = { + cwd_prompt = false, + -- actions = { + -- ["alt-i"] = { actions.toggle_ignore }, + -- ["alt-h"] = { actions.toggle_hidden }, + -- }, + }, + -- grep = { + -- actions = { + -- ["alt-i"] = { actions.toggle_ignore }, + -- ["alt-h"] = { actions.toggle_hidden }, + -- }, + -- }, + lsp = { + symbols = { + symbol_hl = function(s) + return "TroubleIcon" .. s + end, + symbol_fmt = function(s) + return s:lower() .. "\t" + end, + child_prefix = false, + }, + code_actions = { + previewer = vim.fn.executable("delta") == 1 and "codeaction_native" or nil, + }, + }, + }, + keys = { + { "", "", ft = "fzf", mode = "t", nowait = true }, + { "", "", ft = "fzf", mode = "t", nowait = true }, + -- goto + { "gd", "FzfLua lsp_definitions jump_to_single_result=true ignore_current_line=true", desc = "Goto Definition" }, + { "gr", "FzfLua lsp_references jump_to_single_result=true ignore_current_line=true", desc = "References", nowait = true }, + { "gI", "FzfLua lsp_implementations jump_to_single_result=true ignore_current_line=true", desc = "Goto Implementation" }, + { "gy", "FzfLua lsp_typedefs jump_to_single_result=true ignore_current_line=true", desc = "Goto T[y]pe Definition" }, + -- shortcuts + { + ",", + "FzfLua buffers sort_mru=true sort_lastused=true", + desc = "Switch Buffer", + }, + { ":", "FzfLua command_history", desc = "Command History" }, + { "", "FzfLua files", desc = "Find Files" }, + -- find files + { "fb", "FzfLua buffers sort_mru=true sort_lastused=true", desc = "Buffers" }, + -- { "fc", LazyVim.pick.config_files(), desc = "Find Config File" }, + { "ff", "FzfLua files", desc = "Find Files" }, + { "fg", "FzfLua git_files", desc = "Find Files (git-files)" }, + -- git + { "gc", "FzfLua git_commits", desc = "Commits" }, + { "gs", "FzfLua git_status", desc = "Status" }, + -- search + { 's"', "FzfLua registers", desc = "Registers" }, + { "sa", "FzfLua autocmds", desc = "Auto Commands" }, + { "sb", "FzfLua grep_curbuf", desc = "Buffer" }, + { "sc", "FzfLua command_history", desc = "Command History" }, + { "sC", "FzfLua commands", desc = "Commands" }, + { "sd", "FzfLua diagnostics_document", desc = "Document Diagnostics" }, + { "sD", "FzfLua diagnostics_workspace", desc = "Workspace Diagnostics" }, + { "sg", "FzfLua live_grep", desc = "Grep (Root Dir)" }, + { "sG", "FzfLua live_grep root=false", desc = "Grep (cwd)" }, + { "sh", "FzfLua help_tags", desc = "Help Pages" }, + { "sH", "FzfLua highlights", desc = "Search Highlight Groups" }, + { "sj", "FzfLua jumps", desc = "Jumplist" }, + { "sk", "FzfLua keymaps", desc = "Key Maps" }, + { "sl", "FzfLua loclist", desc = "Location List" }, + { "sM", "FzfLua man_pages", desc = "Man Pages" }, + { "sm", "FzfLua marks", desc = "Jump to Mark" }, + { "sR", "FzfLua resume", desc = "Resume" }, + { "sq", "FzfLua quickfix", desc = "Quickfix List" }, + -- { + -- "ss", + -- function() + -- require("fzf-lua").lsp_document_symbols({ + -- regex_filter = symbols_filter, + -- }) + -- end, + -- desc = "Goto Symbol", + -- }, + -- { + -- "sS", + -- function() + -- require("fzf-lua").lsp_live_workspace_symbols({ + -- regex_filter = symbols_filter, + -- }) + -- end, + -- desc = "Goto Symbol (Workspace)", + -- }, + }, +} diff --git a/.config/nvim/lua/plugins/gitsigns.lua b/.config/nvim/lua/config/plugins/gitsigns.lua similarity index 100% rename from .config/nvim/lua/plugins/gitsigns.lua rename to .config/nvim/lua/config/plugins/gitsigns.lua diff --git a/.config/nvim/lua/config/plugins/grug-far.lua b/.config/nvim/lua/config/plugins/grug-far.lua new file mode 100644 index 0000000..9187b15 --- /dev/null +++ b/.config/nvim/lua/config/plugins/grug-far.lua @@ -0,0 +1,22 @@ +return { + "MagicDuck/grug-far.nvim", + opts = { headerMaxWidth = 80 }, + cmd = "GrugFar", + keys = { + { + "sr", + function() + local grug = require("grug-far") + local ext = vim.bo.buftype == "" and vim.fn.expand("%:e") + grug.open({ + transient = true, + prefills = { + filesFilter = ext and ext ~= "" and "*." .. ext or nil, + }, + }) + end, + mode = { "n", "v" }, + desc = "Search and Replace", + }, + }, +} diff --git a/.config/nvim/lua/config/plugins/lsp.lua b/.config/nvim/lua/config/plugins/lsp.lua new file mode 100644 index 0000000..034fd1d --- /dev/null +++ b/.config/nvim/lua/config/plugins/lsp.lua @@ -0,0 +1,71 @@ +return { + "neovim/nvim-lspconfig", + dependencies = { + { "saghen/blink.cmp" }, + { "b0o/schemastore.nvim" }, + { + "folke/lazydev.nvim", + ft = "lua", + opts = { + library = { + { path = "${3rd}/luv/library", words = { "vim%.uv" } }, + }, + }, + }, + }, + opts = { + inlay_hints = { enabled = false }, + servers = { + ansiblels = {}, + dockerls = {}, + lua_ls = {}, + rust_analyzer = {}, + ruff = {}, + jsonls = { + settings = { + json = { + validate = { enable = true }, + }, + }, + }, + yamlls = { + settings = { + yaml = { + schemaStore = { + enable = false, + url = "", + }, + }, + }, + }, + }, + }, + config = function(_, opts) + local lspconfig = require("lspconfig") + for server, config in pairs(opts.servers) do + config.capabilities = require("blink.cmp").get_lsp_capabilities(config.capabilities) + if server == "yamlls" then + config.settings.yaml.schemas = require('schemastore').yaml.schemas() + end + if server == "jsonls" then + config.settings.json.schemas = require('schemastore').json.schemas() + end + lspconfig[server].setup(config) + end + + vim.api.nvim_create_autocmd('LspAttach', { + callback = function(args) + local client = vim.lsp.get_client_by_id(args.data.client_id) + if not client then return end + if client.supports_method('textDocument/formatting') then + vim.api.nvim_create_autocmd('BufWritePre', { + buffer = args.buf, + callback = function() + vim.lsp.buf.format({ bufnr = args.buf, id = client.id }) + end, + }) + end + end, + }) + end, +} diff --git a/.config/nvim/lua/config/plugins/lualine.lua b/.config/nvim/lua/config/plugins/lualine.lua new file mode 100644 index 0000000..a1dfcc7 --- /dev/null +++ b/.config/nvim/lua/config/plugins/lualine.lua @@ -0,0 +1,44 @@ +return { + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + init = function() + vim.g.lualine_laststatus = vim.o.laststatus + if vim.fn.argc(-1) > 0 then + -- set an empty statusline till lualine loads + vim.o.statusline = " " + else + -- hide the statusline on the starter page + vim.o.laststatus = 0 + end + end, + opts = function() + -- PERF: we don't need this lualine require madness đŸ€· + local lualine_require = require("lualine_require") + lualine_require.require = require + + vim.o.laststatus = vim.g.lualine_laststatus + + local opts = { + options = { + theme = "auto", + globalstatus = vim.o.laststatus == 3, + disabled_filetypes = { statusline = { "dashboard", "alpha", "ministarter", "snacks_dashboard" } }, + }, + sections = { + lualine_a = { "mode" }, + lualine_b = { "branch" }, + + { "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } }, + }, + lualine_y = { + { "progress", separator = " ", padding = { left = 1, right = 0 } }, + { "location", padding = { left = 0, right = 1 } }, + }, + lualine_z = { + function() + return "ïș " .. os.date("%R") + end, + }, + } + end, +} diff --git a/.config/nvim/lua/config/plugins/mini-ai.lua b/.config/nvim/lua/config/plugins/mini-ai.lua new file mode 100644 index 0000000..8c9c018 --- /dev/null +++ b/.config/nvim/lua/config/plugins/mini-ai.lua @@ -0,0 +1,35 @@ +return { + "echasnovski/mini.ai", + event = "VeryLazy", + opts = function() + local ai = require("mini.ai") + return { + n_lines = 500, + custom_textobjects = { + o = ai.gen_spec.treesitter({ -- code block + a = { "@block.outer", "@conditional.outer", "@loop.outer" }, + i = { "@block.inner", "@conditional.inner", "@loop.inner" }, + }), + f = ai.gen_spec.treesitter({ a = "@function.outer", i = "@function.inner" }), -- function + c = ai.gen_spec.treesitter({ a = "@class.outer", i = "@class.inner" }), -- class + t = { "<([%p%w]-)%f[^<%w][^<>]->.-", "^<.->().*()$" }, -- tags + d = { "%f[%d]%d+" }, -- digits + e = { -- Word with case + { "%u[%l%d]+%f[^%l%d]", "%f[%S][%l%d]+%f[^%l%d]", "%f[%P][%l%d]+%f[^%l%d]", "^[%l%d]+%f[^%l%d]" }, + "^().*()$", + }, + -- g = LazyVim.mini.ai_buffer, -- buffer + u = ai.gen_spec.function_call(), -- u for "Usage" + U = ai.gen_spec.function_call({ name_pattern = "[%w_]" }), -- without dot in function name + }, + } + end, + -- config = function(_, opts) + -- require("mini.ai").setup(opts) + -- LazyVim.on_load("which-key.nvim", function() + -- vim.schedule(function() + -- LazyVim.mini.ai_whichkey(opts) + -- end) + -- end) + -- end, +} diff --git a/.config/nvim/lua/config/plugins/mini-icons.lua b/.config/nvim/lua/config/plugins/mini-icons.lua new file mode 100644 index 0000000..c5562ff --- /dev/null +++ b/.config/nvim/lua/config/plugins/mini-icons.lua @@ -0,0 +1,19 @@ +return { + "echasnovski/mini.icons", + lazy = true, + opts = { + file = { + [".keep"] = { glyph = "󰊱", hl = "MiniIconsGrey" }, + ["devcontainer.json"] = { glyph = "", hl = "MiniIconsAzure" }, + }, + filetype = { + dotenv = { glyph = "", hl = "MiniIconsYellow" }, + }, + }, + init = function() + package.preload["nvim-web-devicons"] = function() + require("mini.icons").mock_nvim_web_devicons() + return package.loaded["nvim-web-devicons"] + end + end, +} diff --git a/.config/nvim/lua/config/plugins/noice.lua.bak b/.config/nvim/lua/config/plugins/noice.lua.bak new file mode 100644 index 0000000..3cd83c6 --- /dev/null +++ b/.config/nvim/lua/config/plugins/noice.lua.bak @@ -0,0 +1,52 @@ +return { + "folke/noice.nvim", + event = "VeryLazy", + opts = { + lsp = { + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, + }, + }, + routes = { + { + filter = { + event = "msg_show", + any = { + { find = "%d+L, %d+B" }, + { find = "; after #%d+" }, + { find = "; before #%d+" }, + }, + }, + view = "mini", + }, + }, + presets = { + bottom_search = false, + command_palette = true, + long_message_to_split = true, + }, + }, + -- stylua: ignore + keys = { + { "sn", "", desc = "+noice"}, + { "", function() require("noice").redirect(vim.fn.getcmdline()) end, mode = "c", desc = "Redirect Cmdline" }, + { "snl", function() require("noice").cmd("last") end, desc = "Noice Last Message" }, + { "snh", function() require("noice").cmd("history") end, desc = "Noice History" }, + { "sna", function() require("noice").cmd("all") end, desc = "Noice All" }, + { "snd", function() require("noice").cmd("dismiss") end, desc = "Dismiss All" }, + { "snt", function() require("noice").cmd("pick") end, desc = "Noice Picker (Telescope/FzfLua)" }, + { "", function() if not require("noice.lsp").scroll(4) then return "" end end, silent = true, expr = true, desc = "Scroll Forward", mode = {"i", "n", "s"} }, + { "", function() if not require("noice.lsp").scroll(-4) then return "" end end, silent = true, expr = true, desc = "Scroll Backward", mode = {"i", "n", "s"}}, + }, + config = function(_, opts) + -- HACK: noice shows messages from before it was enabled, + -- but this is not ideal when Lazy is installing plugins, + -- so clear the messages in this case. + if vim.o.filetype == "lazy" then + vim.cmd([[messages clear]]) + end + require("noice").setup(opts) + end, +} diff --git a/.config/nvim/lua/plugins/oil.lua b/.config/nvim/lua/config/plugins/oil.lua similarity index 72% rename from .config/nvim/lua/plugins/oil.lua rename to .config/nvim/lua/config/plugins/oil.lua index 8a781d1..df5886f 100644 --- a/.config/nvim/lua/plugins/oil.lua +++ b/.config/nvim/lua/config/plugins/oil.lua @@ -1,6 +1,6 @@ return { "stevearc/oil.nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, + dependencies = { "echasnovski/mini.icons" }, config = function() require("oil").setup({ columns = { "icon" }, @@ -8,7 +8,6 @@ return { show_hidden = true, }, }) - -- vim.keymap.set("n", "e", "Oil", { desc = "Open parent directory" }) vim.keymap.set( "n", "e", diff --git a/.config/nvim/lua/config/plugins/snacks.lua b/.config/nvim/lua/config/plugins/snacks.lua new file mode 100644 index 0000000..7d2594a --- /dev/null +++ b/.config/nvim/lua/config/plugins/snacks.lua @@ -0,0 +1,46 @@ +return { + "folke/snacks.nvim", + dependencies = { "echasnovski/mini.icons", "nvim-tree/nvim-web-devicons"}, + priority = 1000, + lazy = false, + ---@type snacks.Config + opts = { + indent = { enabled = true }, + input = { enabled = true }, + lazygit = { enabled = false }, + notifier = { enabled = true }, + scope = { enabled = true }, + scroll = { enabled = true }, + statuscolumn = { enabled = false }, + words = { enabled = true }, + dashboard = { + preset = { + header = [[ + ██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z + ██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██║ ██║██║████╗ ████║ Z + ██║ ███████║ ███╔╝ ╚████╔╝ ██║ ██║██║██╔████╔██║ z + ██║ ██╔══██║ ███╔╝ ╚██╔╝ ╚██╗ ██╔╝██║██║╚██╔╝██║ z + ███████╗██║ ██║███████╗ ██║ ╚████╔╝ ██║██║ ╚═╝ ██║ + ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ + ]], + -- stylua: ignore + ---@type snacks.dashboard.Item[] + keys = { + { icon = " ", key = "f", desc = "Find File", action = ":lua Snacks.dashboard.pick('files')" }, + { icon = " ", key = "n", desc = "New File", action = ":ene | startinsert" }, + { icon = "ï€ą ", key = "g", desc = "Find Text", action = ":lua Snacks.dashboard.pick('live_grep')" }, + { icon = " ", key = "r", desc = "Recent Files", action = ":lua Snacks.dashboard.pick('oldfiles')" }, + { icon = "ïŁ ", key = "c", desc = "Config", action = ":lua Snacks.dashboard.pick('files', {cwd = vim.fn.stdpath('config')})" }, + { icon = " ", key = "s", desc = "Restore Session", section = "session" }, + { icon = "ó°’Č ", key = "l", desc = "Lazy", action = ":Lazy" }, + { icon = " ", key = "q", desc = "Quit", action = ":qa" }, + }, + }, + }, + }, + -- stylua: ignore + keys = { + { "n", function() Snacks.notifier.show_history() end, desc = "Notification History" }, + { "un", function() Snacks.notifier.hide() end, desc = "Dismiss All Notifications" }, + }, +} diff --git a/.config/nvim/lua/config/plugins/todo-comments.lua b/.config/nvim/lua/config/plugins/todo-comments.lua new file mode 100644 index 0000000..8d27daf --- /dev/null +++ b/.config/nvim/lua/config/plugins/todo-comments.lua @@ -0,0 +1,24 @@ +return { + "folke/todo-comments.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + opts = {}, + keys = { + { "tf", "TodoTelescope", desc = "Find Todos" }, + { "tq", "TodoQuickFix", desc = "Quickfix Todos" }, + { "tl", "TodoLocList", desc = "Loclist Todos" }, + { + "]t", + function() + require("todo-comments").jump_next() + end, + desc = "Next todo comment" + }, + { + "[t", + function() + require("todo-comments").jump_prev() + end, + desc = "Prev todo comment" + }, + } +} diff --git a/.config/nvim/lua/config/plugins/treesitter-context.lua b/.config/nvim/lua/config/plugins/treesitter-context.lua new file mode 100644 index 0000000..461ea2c --- /dev/null +++ b/.config/nvim/lua/config/plugins/treesitter-context.lua @@ -0,0 +1,3 @@ +return { + "nvim-treesitter/nvim-treesitter-context", +} diff --git a/.config/nvim/lua/plugins/treesitter-just.lua b/.config/nvim/lua/config/plugins/treesitter-just.lua similarity index 100% rename from .config/nvim/lua/plugins/treesitter-just.lua rename to .config/nvim/lua/config/plugins/treesitter-just.lua diff --git a/.config/nvim/lua/config/plugins/treesitter.lua b/.config/nvim/lua/config/plugins/treesitter.lua new file mode 100644 index 0000000..f2522ad --- /dev/null +++ b/.config/nvim/lua/config/plugins/treesitter.lua @@ -0,0 +1,4 @@ +return { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate" +} diff --git a/.config/nvim/lua/config/plugins/whichkey.lua b/.config/nvim/lua/config/plugins/whichkey.lua new file mode 100644 index 0000000..4ff184f --- /dev/null +++ b/.config/nvim/lua/config/plugins/whichkey.lua @@ -0,0 +1,54 @@ +return { + "folke/which-key.nvim", + event = "VeryLazy", + opts_extend = { "spec" }, + opts = { + preset = "helix", + defaults = {}, + spec = { + { + mode = { "n", "v" }, + { "", group = "tabs" }, + { "c", group = "code" }, + { "d", group = "debug" }, + { "dp", group = "profiler" }, + { "f", group = "file/find" }, + { "g", group = "git" }, + { "gh", group = "hunks" }, + { "q", group = "quit/session" }, + { "s", group = "search" }, + { "u", group = "ui", icon = { icon = "ó°™” ", color = "cyan" } }, + { "x", group = "diagnostics/quickfix", icon = { icon = "󱖫 ", color = "green" } }, + { "[", group = "prev" }, + { "]", group = "next" }, + { "g", group = "goto" }, + { "gs", group = "surround" }, + { "z", group = "fold" }, + { + "b", + group = "buffer", + expand = function() + return require("which-key.extras").expand.buf() + end, + }, + { + "w", + group = "windows", + proxy = "", + expand = function() + return require("which-key.extras").expand.win() + end, + }, + { + "?", + function() + require("which-key").show({ global = false }) + end, + desc = "Buffer Local Keymaps (which-key)", + }, + -- better descriptions + { "gx", desc = "Open with system app" }, + }, + }, + }, +} diff --git a/.config/nvim/lua/plugins/alloy.lua b/.config/nvim/lua/plugins/alloy.lua deleted file mode 100644 index 8f7c085..0000000 --- a/.config/nvim/lua/plugins/alloy.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - "grafana/vim-alloy", - ft = "alloy", -} diff --git a/.config/nvim/lua/plugins/blink-cmp.lua b/.config/nvim/lua/plugins/blink-cmp.lua deleted file mode 100644 index d3dffcd..0000000 --- a/.config/nvim/lua/plugins/blink-cmp.lua +++ /dev/null @@ -1,22 +0,0 @@ -return { - { - "saghen/blink.cmp", - dependencies = "rafamadriz/friendly-snippets", - - version = "v0.*", - - opts = { - keymap = { preset = "default" }, - - appearance = { - -- Sets the fallback highlight groups to nvim-cmp's highlight groups - -- Useful for when your theme doesn't support blink.cmp - -- will be removed in a future release - use_nvim_cmp_as_default = true, - nerd_font_variant = "mono", - }, - - signature = { enabled = true }, - }, - }, -} diff --git a/.config/nvim/lua/plugins/caddyfile.lua b/.config/nvim/lua/plugins/caddyfile.lua deleted file mode 100644 index 514f036..0000000 --- a/.config/nvim/lua/plugins/caddyfile.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - "isobit/vim-caddyfile", - ft = "caddyfile", -} diff --git a/.config/nvim/lua/plugins/disabled.lua b/.config/nvim/lua/plugins/disabled.lua deleted file mode 100644 index 5e10c5d..0000000 --- a/.config/nvim/lua/plugins/disabled.lua +++ /dev/null @@ -1,13 +0,0 @@ -return { - --- Disable completely - { "nvim-neo-tree/neo-tree.nvim", enabled = false, keys = false }, - { "echasnovski/mini.pairs", enabled = false, keys = false }, - { "kdheepak/lazygit.nvim", enabled = false, keys = false }, - - --- Disable Mason as it is a pain in the ass to configure as i want it - { "williamboman/mason-lspconfig.nvim", enabled = false }, - { "williamboman/mason.nvim", enabled = false }, - - --- Disable keys only - { "mfussenegger/nvim-ansible", keys = false }, -} diff --git a/.config/nvim/lua/plugins/gleam.lua b/.config/nvim/lua/plugins/gleam.lua deleted file mode 100644 index d468706..0000000 --- a/.config/nvim/lua/plugins/gleam.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - "gleam-lang/gleam.vim", - ft = "gleam", -} diff --git a/.config/nvim/lua/plugins/jinja.lua b/.config/nvim/lua/plugins/jinja.lua deleted file mode 100644 index 73d2888..0000000 --- a/.config/nvim/lua/plugins/jinja.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - "HiPhish/jinja.vim", - ft = "jinja", -} diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua deleted file mode 100644 index e146062..0000000 --- a/.config/nvim/lua/plugins/lsp.lua +++ /dev/null @@ -1,20 +0,0 @@ -return { - "neovim/nvim-lspconfig", - dependencies = { "saghen/blink.cmp" }, - opts = { - inlay_hints = { enabled = false }, - servers = { - lua_ls = {}, - pyright = { - autostart = false, - }, - }, - }, - config = function(_, opts) - local lspconfig = require("lspconfig") - for server, config in pairs(opts.servers) do - config.capabilities = require("blink.cmp").get_lsp_capabilities(config.capabilities) - lspconfig[server].setup(config) - end - end, -} diff --git a/.config/nvim/lua/plugins/neogit.lua b/.config/nvim/lua/plugins/neogit.lua deleted file mode 100644 index c50a5f8..0000000 --- a/.config/nvim/lua/plugins/neogit.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - "NeogitOrg/neogit", - dependencies = { - "nvim-lua/plenary.nvim", - "sindrets/diffview.nvim", - "nvim-telescope/telescope.nvim", - }, - config = true, -} diff --git a/.config/nvim/lua/plugins/noice.lua b/.config/nvim/lua/plugins/noice.lua deleted file mode 100644 index be345ec..0000000 --- a/.config/nvim/lua/plugins/noice.lua +++ /dev/null @@ -1,53 +0,0 @@ -return { - "folke/noice.nvim", - event = "VeryLazy", - opts = { - lsp = { - override = { - ["vim.lsp.util.convert_input_to_markdown_lines"] = true, - ["vim.lsp.util.stylize_markdown"] = true, - ["cmp.entry.get_documentation"] = true, - }, - }, - routes = { - { - filter = { - event = "msg_show", - any = { - { find = "%d+L, %d+B" }, - { find = "; after #%d+" }, - { find = "; before #%d+" }, - }, - }, - view = "mini", - }, - }, - presets = { - -- changed from default - bottom_search = false, - command_palette = true, - long_message_to_split = false, - }, - }, - -- stylua: ignore - keys = { - { "sn", "", desc = "+noice"}, - { "", function() require("noice").redirect(vim.fn.getcmdline()) end, mode = "c", desc = "Redirect Cmdline" }, - { "snl", function() require("noice").cmd("last") end, desc = "Noice Last Message" }, - { "snh", function() require("noice").cmd("history") end, desc = "Noice History" }, - { "sna", function() require("noice").cmd("all") end, desc = "Noice All" }, - { "snd", function() require("noice").cmd("dismiss") end, desc = "Dismiss All" }, - { "snt", function() require("noice").cmd("pick") end, desc = "Noice Picker (Telescope/FzfLua)" }, - { "", function() if not require("noice.lsp").scroll(4) then return "" end end, silent = true, expr = true, desc = "Scroll Forward", mode = {"i", "n", "s"} }, - { "", function() if not require("noice.lsp").scroll(-4) then return "" end end, silent = true, expr = true, desc = "Scroll Backward", mode = {"i", "n", "s"}}, - }, - config = function(_, opts) - -- HACK: noice shows messages from before it was enabled, - -- but this is not ideal when Lazy is installing plugins, - -- so clear the messages in this case. - if vim.o.filetype == "lazy" then - vim.cmd([[messages clear]]) - end - require("noice").setup(opts) - end, -} diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua deleted file mode 100644 index 75b8090..0000000 --- a/.config/nvim/lua/plugins/telescope.lua +++ /dev/null @@ -1,18 +0,0 @@ -return { - "nvim-telescope/telescope.nvim", - keys = { - { "", "Telescope find_files", desc = "Find Files" }, - { "ff", "Telescope find_files", desc = "Find Files" }, - { "fg", "Telescope git_files", desc = "Find Git Files" }, - -- add a keymap to browse plugin files - { - "fp", - function() - require("telescope.builtin").find_files({ - cwd = require("lazy.core.config").options.root, - }) - end, - desc = "Find Plugin File", - }, - }, -} diff --git a/.config/nvim/lua/plugins/vim-just.lua b/.config/nvim/lua/plugins/vim-just.lua deleted file mode 100644 index 43a2776..0000000 --- a/.config/nvim/lua/plugins/vim-just.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - "NoahTheDuke/vim-just", - name = "vim-just", - ft = "just", -} diff --git a/.config/nvim/stylua.toml b/.config/nvim/stylua.toml deleted file mode 100644 index d4a4951..0000000 --- a/.config/nvim/stylua.toml +++ /dev/null @@ -1,3 +0,0 @@ -indent_type = "Spaces" -indent_width = 4 -column_width = 100 diff --git a/.config/nvim/syntax/hiswiki.lua b/.config/nvim/syntax/hiswiki.lua deleted file mode 100644 index 259a4bb..0000000 --- a/.config/nvim/syntax/hiswiki.lua +++ /dev/null @@ -1,13 +0,0 @@ --- Link the 'hiswikiLink' highlight group to the existing 'Underlined' group. -vim.api.nvim_set_hl(0, "hiswikiLink", { link = "Underlined" }) - --- Remove all existing hiswikiLink syntax matches. -vim.cmd("syntax clear hiswikiLink") - --- Find the directory of the current file. -local base_dir = vim.fn.expand("%:h") - --- Loop through all files in the directory, and add a syntax match for each one. -for _, file in ipairs(vim.fn.readdir(base_dir)) do - vim.cmd("syntax match hiswikiLink /\\c\\V\\<" .. vim.fn.escape(file, "/\\") .. "/") -end