From b29d44636acc8810225b28f55084569863be9525 Mon Sep 17 00:00:00 2001 From: fschuermeyer <25571323+fschuermeyer@users.noreply.github.com> Date: Wed, 18 Dec 2024 15:20:00 +0100 Subject: [PATCH 01/37] Work in Progress --- .neoconf.json | 15 --- LICENSE | 201 -------------------------------- README.md | 13 --- init.lua | 11 +- lazy-lock.json | 85 +------------- lazyvim.json | 31 ----- lua/config/autocmds.lua | 28 ----- lua/config/keymaps.lua | 51 -------- lua/config/lazy.lua | 52 --------- lua/config/options.lua | 12 -- lua/core/keymaps.lua | 20 ++++ lua/core/lazy.lua | 29 +++++ lua/core/options.lua | 16 +++ lua/core/provider.lua | 4 + lua/plugins/additional.lua | 20 ---- lua/plugins/colorschema.lua | 15 +++ lua/plugins/diffview.lua | 3 + lua/plugins/folke-which-key.lua | 5 + lua/plugins/gitsigns.lua | 3 + lua/plugins/go.lua | 15 --- lua/plugins/lualine.lua | 7 ++ lua/plugins/mason-lock.lua | 10 -- lua/plugins/neotree.lua | 14 --- lua/plugins/surround.lua | 33 ------ lua/plugins/test.lua | 59 ---------- lua/plugins/ui.lua | 57 --------- mason-lock.json | 51 -------- stylua.toml | 3 - 28 files changed, 111 insertions(+), 752 deletions(-) delete mode 100644 .neoconf.json delete mode 100644 LICENSE delete mode 100644 lazyvim.json delete mode 100644 lua/config/autocmds.lua delete mode 100644 lua/config/keymaps.lua delete mode 100644 lua/config/lazy.lua delete mode 100644 lua/config/options.lua create mode 100644 lua/core/keymaps.lua create mode 100644 lua/core/lazy.lua create mode 100644 lua/core/options.lua create mode 100644 lua/core/provider.lua delete mode 100644 lua/plugins/additional.lua create mode 100644 lua/plugins/colorschema.lua create mode 100644 lua/plugins/diffview.lua create mode 100644 lua/plugins/folke-which-key.lua create mode 100644 lua/plugins/gitsigns.lua delete mode 100644 lua/plugins/go.lua create mode 100644 lua/plugins/lualine.lua delete mode 100644 lua/plugins/mason-lock.lua delete mode 100644 lua/plugins/neotree.lua delete mode 100644 lua/plugins/surround.lua delete mode 100644 lua/plugins/test.lua delete mode 100644 lua/plugins/ui.lua delete mode 100644 mason-lock.json delete mode 100644 stylua.toml diff --git a/.neoconf.json b/.neoconf.json deleted file mode 100644 index 7c48087..0000000 --- a/.neoconf.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "neodev": { - "library": { - "enabled": true, - "plugins": true - } - }, - "neoconf": { - "plugins": { - "lua_ls": { - "enabled": true - } - } - } -} diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 261eeb9..0000000 --- a/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/README.md b/README.md index 3b56894..e69de29 100644 --- a/README.md +++ b/README.md @@ -1,13 +0,0 @@ -# πŸ’€ Personal Nvim Setup - -This is my personal Neovim Setup based on ([LazyVim](https://www.lazyvim.org/)). I use it for my daily work and I'm happy to share it with you. Feel free to use it as a base for your own setup. - -## Setup - -Setup Neovim on a new System - -```shell -git clone git@github.com:fschuermeyer/nvim-setup.git ~/.config/nvim -``` - -On the first Startup use `:MasonLockRestore` to restore the LSP Configuration. diff --git a/init.lua b/init.lua index 30d5aed..9728eb3 100644 --- a/init.lua +++ b/init.lua @@ -1,7 +1,4 @@ --- bootstrap lazy.nvim, LazyVim and your plugins -require("config.lazy") - --- provider setup -vim.g.python3_host_prog = os.getenv("HOME") .. "/.pyenv/versions/3.11.0/bin/python3" -vim.g.loaded_perl_provider = 0 -vim.g.loaded_ruby_provider = 0 +require("core.options") +require("core.keymaps") +require("core.provider") +require("core.lazy") diff --git a/lazy-lock.json b/lazy-lock.json index 4d4f919..9b58258 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,84 +1,9 @@ { - "CopilotChat.nvim": { "branch": "canary", "commit": "49edd2e21dfdc0f1bf4ed872099674cb8fe30280" }, - "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, - "LazyVim": { "branch": "main", "commit": "adcbfc72fd8d0808d78bdfe0940d98c6432c4ef0" }, - "LuaSnip": { "branch": "master", "commit": "0f7bbce41ea152a94d12aea286f2ce98e63c0f58" }, - "SchemaStore.nvim": { "branch": "main", "commit": "bbd005a56daab7a19ceea22360a836957ac2c42c" }, - "alternate-toggler": { "branch": "main", "commit": "819800304d3e8e575fd6aa461a8bcf2217e1cfb6" }, - "bigfile.nvim": { "branch": "main", "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" }, - "bufferline.nvim": { "branch": "main", "commit": "5cc447cb2b463cb499c82eaeabbed4f5fa6a0a44" }, - "catppuccin": { "branch": "main", "commit": "faf15ab0201b564b6368ffa47b56feefc92ce3f4" }, - "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-git": { "branch": "main", "commit": "ec049036e354ed8ed0215f2427112882e1ea7051" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, - "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "conform.nvim": { "branch": "master", "commit": "a203480a350b03092e473bf3001733d547160a73" }, - "copilot-cmp": { "branch": "master", "commit": "b6e5286b3d74b04256d0a7e3bd2908eabec34b44" }, - "copilot.lua": { "branch": "master", "commit": "f8d8d872bb319f640d5177dad5fbf01f7a16d7d0" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, - "dressing.nvim": { "branch": "master", "commit": "fc78a3ca96f4db9f8893bb7e2fd9823e0780451b" }, - "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, - "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" }, - "grug-far.nvim": { "branch": "main", "commit": "9a2f78219390b47d67795ab09390d7f092e23976" }, - "haskell-snippets.nvim": { "branch": "master", "commit": "bd893770dd7a0c1a473601c3c919e61670745b36" }, - "haskell-tools.nvim": { "branch": "master", "commit": "65d6993eba1a56bbd5211ef13a100d26ce3e644a" }, - "indent-blankline.nvim": { "branch": "master", "commit": "7871a88056f7144defca9c931e311a3134c5d509" }, - "kulala.nvim": { "branch": "main", "commit": "c7efcd01afafae0ab68c2a77cd050b9795edd8ad" }, - "lazy.nvim": { "branch": "main", "commit": "7967abe55752aa90532e6bb4bd4663fe27a264cb" }, - "lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" }, + "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, + "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, - "luvit-meta": { "branch": "main", "commit": "57d464c4acb5c2e66bd4145060f5dc9e96a7bbb7" }, - "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, - "mason-lock.nvim": { "branch": "main", "commit": "86614f76c3442fba1c5c8d79aa1efcb3ad69de1c" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "43894adcf10bb1190c2184bd7c1750e8ea2b3dce" }, - "mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" }, - "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, - "mini.ai": { "branch": "main", "commit": "31c149067d38b97720d2a179619f7745a0006ecc" }, - "mini.animate": { "branch": "main", "commit": "d33ddf0eefee6338bbd95805c4595c1b34e6bfe2" }, - "mini.diff": { "branch": "main", "commit": "65c59f9967fec965d8759a88c1baa43147699035" }, - "mini.icons": { "branch": "main", "commit": "54686be7d58807906cb2c8c2216e0bf9c044f19a" }, - "neo-tree.nvim": { "branch": "main", "commit": "42caaf5c3b7ca346ab278201151bb878006a6031" }, - "neotest": { "branch": "master", "commit": "6d3d22cdad49999ef774ebe1bc250a4994038964" }, - "neotest-go": { "branch": "main", "commit": "92950ad7be2ca02a41abca5c6600ff6ffaf5b5d6" }, - "neotest-jest": { "branch": "main", "commit": "514fd4eae7da15fd409133086bb8e029b65ac43f" }, - "neotest-python": { "branch": "master", "commit": "a2861ab3c9a0bf75a56b11835c2bfc8270f5be7e" }, - "neotest-vitest": { "branch": "main", "commit": "9e30dca989a2287cf3fde86b3e138ea7fa4de935" }, - "noice.nvim": { "branch": "main", "commit": "16ddc5650f14b3025b7ccabaf708e615042b8a84" }, - "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, - "nvim-cmp": { "branch": "main", "commit": "ed31156aa2cc14e3bc066c59357cc91536a2bc01" }, - "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-dap": { "branch": "master", "commit": "cc92b054720a96170eca6bd9bdedd43d2b0a7a8a" }, - "nvim-dap-go": { "branch": "main", "commit": "6aa88167ea1224bcef578e8c7160fe8afbb44848" }, - "nvim-dap-python": { "branch": "master", "commit": "3e3dd98d4d83715c9e0e429b4a5da7bd706e6ceb" }, - "nvim-dap-ui": { "branch": "master", "commit": "ffa89839f97bad360e78428d5c740fdad9a0ff02" }, - "nvim-dap-virtual-text": { "branch": "master", "commit": "76d80c3d171224315b61c006502a1e30c213a9ab" }, - "nvim-lint": { "branch": "master", "commit": "6b46370d02cd001509a765591a3ffc481b538794" }, - "nvim-lspconfig": { "branch": "master", "commit": "16008a64f6ab9309641f30b8a7c9a432f1649b9a" }, - "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, - "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, - "nvim-treesitter": { "branch": "master", "commit": "28591731d84c2fc18ddda60e1d53da24c31c4987" }, - "nvim-treesitter-context": { "branch": "master", "commit": "6b081ea63a3711243d11540ce28ccdb6f35ecd33" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" }, - "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, - "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" }, - "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, - "render-markdown.nvim": { "branch": "main", "commit": "6096cf3608b576a38fd1396227dbc0473091714d" }, - "snacks.nvim": { "branch": "main", "commit": "985be4a759f6fe83e569679da431eeb7d2db5286" }, - "tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "3d3cd95e4a4135c250faf83dd5ed61b8e5502b86" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, - "telescope.nvim": { "branch": "master", "commit": "85922dde3767e01d42a08e750a773effbffaea3e" }, - "telescope_hoogle": { "branch": "master", "commit": "5c2ae51bcf905a7101134a597e6f7be2dc05f975" }, - "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, - "tokyonight.nvim": { "branch": "main", "commit": "c2725eb6d086c8c9624456d734bd365194660017" }, - "trouble.nvim": { "branch": "main", "commit": "3dc00c0447c016cd43e03054c3d49436a1f2076d" }, - "ts-comments.nvim": { "branch": "main", "commit": "2002692ad1d3f6518d016550c20c2a890f0cbf0e" }, - "venv-selector.nvim": { "branch": "regexp", "commit": "e82594274bf7b54387f9a2abe65f74909ac66e97" }, - "vim-be-good": { "branch": "master", "commit": "4fa57b7957715c91326fcead58c1fa898b9b3625" }, - "vim-dadbod": { "branch": "master", "commit": "fe5a55e92b2dded7c404006147ef97fb073d8b1b" }, - "vim-dadbod-completion": { "branch": "master", "commit": "da0e75c09c27a82aad078d993bb1b2f4afd43427" }, - "vim-dadbod-ui": { "branch": "master", "commit": "28a16902cb2134c934b85da5250033ee43b0dee5" }, - "vim-go": { "branch": "master", "commit": "ec7a59ef10d417c0cc1cd571a165c7c9dec30d27" }, - "vim-tmux-navigator": { "branch": "master", "commit": "424b5caa154bff34dc258ee53cec5a8e36cf7ea8" }, - "which-key.nvim": { "branch": "main", "commit": "b9684c6ec54d8a8452bdcf0d613c7ad0223fc3fe" } + "nvim-web-devicons": { "branch": "master", "commit": "0eb18da56e2ba6ba24de7130a12bcc4e31ad11cb" }, + "tokyonight.nvim": { "branch": "main", "commit": "45d22cf0e1b93476d3b6d362d720412b3d34465c" }, + "which-key.nvim": { "branch": "main", "commit": "8ab96b38a2530eacba5be717f52e04601eb59326" } } diff --git a/lazyvim.json b/lazyvim.json deleted file mode 100644 index 3dcd8f8..0000000 --- a/lazyvim.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "extras": [ - "lazyvim.plugins.extras.ai.copilot", - "lazyvim.plugins.extras.ai.copilot-chat", - "lazyvim.plugins.extras.coding.luasnip", - "lazyvim.plugins.extras.editor.mini-diff", - "lazyvim.plugins.extras.lang.docker", - "lazyvim.plugins.extras.lang.git", - "lazyvim.plugins.extras.lang.go", - "lazyvim.plugins.extras.lang.haskell", - "lazyvim.plugins.extras.lang.json", - "lazyvim.plugins.extras.lang.markdown", - "lazyvim.plugins.extras.lang.php", - "lazyvim.plugins.extras.lang.python", - "lazyvim.plugins.extras.lang.sql", - "lazyvim.plugins.extras.lang.tailwind", - "lazyvim.plugins.extras.lang.toml", - "lazyvim.plugins.extras.lang.typescript", - "lazyvim.plugins.extras.lang.vue", - "lazyvim.plugins.extras.lang.yaml", - "lazyvim.plugins.extras.linting.eslint", - "lazyvim.plugins.extras.test.core", - "lazyvim.plugins.extras.ui.mini-animate", - "lazyvim.plugins.extras.ui.treesitter-context", - "lazyvim.plugins.extras.util.rest" - ], - "news": { - "NEWS.md": "7429" - }, - "version": 7 -} \ No newline at end of file diff --git a/lua/config/autocmds.lua b/lua/config/autocmds.lua deleted file mode 100644 index 9b8b069..0000000 --- a/lua/config/autocmds.lua +++ /dev/null @@ -1,28 +0,0 @@ --- 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 - -vim.cmd([[ - autocmd BufNewFile,BufRead *.tmpl set filetype=gohtmltmpl - autocmd BufNewFile,BufRead *.gohtml set filetype=gohtmltmpl - autocmd BufNewFile,BufRead *.gohtmltmpl set filetype=gohtmltmpl - autocmd BufNewFile,BufRead *.gotexttmpl set filetype=gotexttmpl - autocmd BufNewFile,BufRead *.twig set filetype=html -]]) - --- Disable Autoformat for Specific Filetypes -local disable_autoformat = function(pattern) - vim.api.nvim_create_autocmd({ "FileType" }, { - pattern = pattern, - callback = function() - vim.b.autoformat = false - end, - }) -end - --- disable Autoformatting for Stylesheets -disable_autoformat({ "css", "scss", "sass" }) - -disable_autoformat({ "kotlin" }) - -disable_autoformat({ "gohtml", "gohtmltmpl", "tmpl" }) diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua deleted file mode 100644 index 41f821f..0000000 --- a/lua/config/keymaps.lua +++ /dev/null @@ -1,51 +0,0 @@ --- 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 enableKey = vim.keymap.set - --- Move Lines --- Alternative Commands for MacOS "option/alt" Key not working -enableKey("n", "", "m .-2==", { desc = "Move Up" }) -enableKey("n", "", "m .+1==", { desc = "Move Down" }) -enableKey("i", "", "m .+1==gi", { desc = "Move Down" }) -enableKey("i", "", "m .-2==gi", { desc = "Move Up" }) -enableKey("v", "", ":m '>+1gv=gv", { desc = "Move Down" }) -enableKey("v", "", ":m '<-2gv=gv", { desc = "Move Up" }) - --- Go (vim-go) -enableKey( - "n", - "tg", - ":GoTestFunc", - { desc = "Testing Golang Function 🐰", silent = true, noremap = true } -) - --- Enable Copilot -enableKey("n", "ce", ":Copilot enable", { desc = "Enable Copilot" }) -enableKey("n", "cx", ":Copilot disable", { desc = "Disable Copilot" }) - --- Tmux Fix move CTRL+A to CTRL+Q -enableKey("n", "", "", { desc = "Increment Numbers", silent = true, noremap = true }) - --- Tmux Navigator -enableKey("n", "", ":TmuxNavigateLeft", { desc = "Tmux Navigate Left", silent = true, noremap = true }) -enableKey("n", "", ":TmuxNavigateDown", { desc = "Tmux Navigate Down", silent = true, noremap = true }) -enableKey("n", "", ":TmuxNavigateUp", { desc = "Tmux Navigate Up", silent = true, noremap = true }) -enableKey("n", "", ":TmuxNavigateRight", { desc = "Tmux Navigate Right", silent = true, noremap = true }) - --- Diffview Keymaps - -enableKey("n", "gf", "DiffviewFileHistory %", { desc = "Diffview Current File" }) -enableKey("n", "gh", "DiffviewFileHistory", { desc = "Diffview History" }) -enableKey("n", "gt", "DiffviewClose", { desc = "Diffview Close" }) -enableKey("n", "gd", "DiffviewOpen", { desc = "Diffview Open" }) -enableKey("n", "gp", "DiffviewOpen origin/HEAD...HEAD --imply-local", { desc = "Diffview Branch" }) - --- Alternate Toggler -enableKey( - "n", - "i", - "lua require('alternate-toggler').toggleAlternate()", - { desc = "Toggle Alternate" } -) diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua deleted file mode 100644 index 0e4645c..0000000 --- a/lua/config/lazy.lua +++ /dev/null @@ -1,52 +0,0 @@ -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -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(lazypath) - -require("lazy").setup({ - spec = { - -- add LazyVim and import its plugins - { "LazyVim/LazyVim", import = "lazyvim.plugins" }, - -- custom plugins - { import = "lazyvim.plugins.extras.dap.core" }, - -- 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", "habamax" } }, - checker = { enabled = true }, -- automatically check for plugin updates - performance = { - rtp = { - -- disable some rtp plugins - disabled_plugins = { - "gzip", - -- "matchit", - -- "matchparen", - -- "netrwPlugin", - "tarPlugin", - "tohtml", - "tutor", - "zipPlugin", - }, - }, - }, -}) diff --git a/lua/config/options.lua b/lua/config/options.lua deleted file mode 100644 index 78f507f..0000000 --- a/lua/config/options.lua +++ /dev/null @@ -1,12 +0,0 @@ --- 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 - -vim.opt.tabstop = 4 -vim.opt.shiftwidth = 4 -vim.opt.smarttab = true - -vim.opt.ignorecase = false - --- Disable mouse -vim.opt.mouse = "" diff --git a/lua/core/keymaps.lua b/lua/core/keymaps.lua new file mode 100644 index 0000000..7b3f80e --- /dev/null +++ b/lua/core/keymaps.lua @@ -0,0 +1,20 @@ +vim.g.mapleader = " " + +local setKey = vim.keymap.set + +setKey("n", "q", ":q", { desc = "Exit Nvim" }) + +-- Move Lines +setKey("n", "", "m .-2==", { desc = "Move Up" }) +setKey("n", "", "m .+1==", { desc = "Move Down" }) +setKey("i", "", "m .-2==gi", { desc = "Move Up" }) +setKey("i", "", "m .+1==gi", { desc = "Move Down" }) +setKey("v", "", ":m '>+1gv=gv", { desc = "Move Down" }) +setKey("v", "", ":m '<-2gv=gv", { desc = "Move Up" }) + +-- Diffview +setKey("n", "gf", "DiffviewFileHistory %", { desc = "Diffview Current File" }) +setKey("n", "gh", "DiffviewFileHistory", { desc = "Diffview History" }) +setKey("n", "gt", "DiffviewClose", { desc = "Diffview Close" }) +setKey("n", "gd", "DiffviewOpen", { desc = "Diffview Open" }) +setKey("n", "gp", "DiffviewOpen origin/HEAD...HEAD --imply-local", { desc = "Diffview Branch" }) diff --git a/lua/core/lazy.lua b/lua/core/lazy.lua new file mode 100644 index 0000000..0750c56 --- /dev/null +++ b/lua/core/lazy.lua @@ -0,0 +1,29 @@ +-- Bootstrap lazy.nvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +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(lazypath) + +-- Setup lazy.nvim +require("lazy").setup({ + spec = { + -- import your plugins + { import = "plugins" }, + }, + -- Configure any other settings here. See the documentation for more details. + -- colorscheme that will be used when installing plugins. + install = { colorscheme = { "habamax" } }, + -- automatically check for plugin updates + checker = { enabled = true }, +}) diff --git a/lua/core/options.lua b/lua/core/options.lua new file mode 100644 index 0000000..75173a2 --- /dev/null +++ b/lua/core/options.lua @@ -0,0 +1,16 @@ +local opt = vim.opt + +-- Nvim Options +-- Tab settings +opt.tabstop = 4 +opt.shiftwidth = 4 +opt.smarttab = true +opt.autoindent = true +opt.expandtab = true -- Use spaces instead of tabs + +-- Line Configs +opt.number = true +opt.relativenumber = true +opt.cursorline = true +opt.wrap = false + diff --git a/lua/core/provider.lua b/lua/core/provider.lua new file mode 100644 index 0000000..f39149b --- /dev/null +++ b/lua/core/provider.lua @@ -0,0 +1,4 @@ + +-- disable provider +vim.g.loaded_perl_provider = 0 +vim.g.loaded_ruby_provider = 0 diff --git a/lua/plugins/additional.lua b/lua/plugins/additional.lua deleted file mode 100644 index b94016e..0000000 --- a/lua/plugins/additional.lua +++ /dev/null @@ -1,20 +0,0 @@ -return { - "christoomey/vim-tmux-navigator", - "ThePrimeagen/vim-be-good", - "sindrets/diffview.nvim", - "rmagatti/alternate-toggler", - { - "echasnovski/mini.pairs", - enabled = false, - }, - { - "LunarVim/bigfile.nvim", - event = "BufReadPre", - opts = { - filesize = 3, - }, - config = function(_, opts) - require("bigfile").setup(opts) - end, - }, -} diff --git a/lua/plugins/colorschema.lua b/lua/plugins/colorschema.lua new file mode 100644 index 0000000..cb74dae --- /dev/null +++ b/lua/plugins/colorschema.lua @@ -0,0 +1,15 @@ +return { + "folke/tokyonight.nvim", + priority = 1000, + config = function() + require("tokyonight").setup({ + transparent = true, + style = "night", + styles = { + sidebars = "transparent", + floats = "transparent", + }, + }) + vim.cmd("colorscheme tokyonight") + end, +} diff --git a/lua/plugins/diffview.lua b/lua/plugins/diffview.lua new file mode 100644 index 0000000..e4a3402 --- /dev/null +++ b/lua/plugins/diffview.lua @@ -0,0 +1,3 @@ +return { + "sindrets/diffview.nvim", +} diff --git a/lua/plugins/folke-which-key.lua b/lua/plugins/folke-which-key.lua new file mode 100644 index 0000000..4d0102a --- /dev/null +++ b/lua/plugins/folke-which-key.lua @@ -0,0 +1,5 @@ +return { + "folke/which-key.nvim", + event = "VeryLazy", + opts = {}, +} diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..205f53f --- /dev/null +++ b/lua/plugins/gitsigns.lua @@ -0,0 +1,3 @@ +return { + "lewis6991/gitsigns.nvim", +} diff --git a/lua/plugins/go.lua b/lua/plugins/go.lua deleted file mode 100644 index 912f771..0000000 --- a/lua/plugins/go.lua +++ /dev/null @@ -1,15 +0,0 @@ --- Go Plugins - -return { - { - "fatih/vim-go", - run = ":GoUpdateBinaries", - config = function() - -- vim-go Einstellungen hier - vim.g.go_def_mode = "gopls" - vim.g.go_info_mode = "gopls" - vim.g.go_fmt_command = "goimports" - vim.g.go_auto_type_info = 1 - end, - }, -} diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua new file mode 100644 index 0000000..d4f56b4 --- /dev/null +++ b/lua/plugins/lualine.lua @@ -0,0 +1,7 @@ +return { + "nvim-lualine/lualine.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + require("lualine").setup({}) + end, +} diff --git a/lua/plugins/mason-lock.lua b/lua/plugins/mason-lock.lua deleted file mode 100644 index 0eaf393..0000000 --- a/lua/plugins/mason-lock.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - { - "zapling/mason-lock.nvim", - init = function() - require("mason-lock").setup({ - lockfile_path = vim.fn.stdpath("config") .. "/mason-lock.json", -- (default) - }) - end, - }, -} diff --git a/lua/plugins/neotree.lua b/lua/plugins/neotree.lua deleted file mode 100644 index 42f3f7b..0000000 --- a/lua/plugins/neotree.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - "nvim-neo-tree/neo-tree.nvim", - config = function() - local neo_tree = require("neo-tree") - - neo_tree.setup({ - filesystem = { - filtered_items = { - visible = true, - }, - }, - }) - end, -} diff --git a/lua/plugins/surround.lua b/lua/plugins/surround.lua deleted file mode 100644 index 38e1872..0000000 --- a/lua/plugins/surround.lua +++ /dev/null @@ -1,33 +0,0 @@ -return { - { - "folke/flash.nvim", - event = "VeryLazy", - keys = { - { "S", false, mode = { "v", "n", "x" } }, - { "s", false, mode = { "v", "n", "x" } }, - { - "ΓΌ", - mode = { "n", "x", "o" }, - function() - require("flash").jump() - end, - desc = "Flash", - }, - { - "Ü", - mode = { "n", "x", "o" }, - function() - require("flash").treesitter() - end, - desc = "Flash Treesitter", - }, - }, - }, - { - "kylechui/nvim-surround", - version = "*", -- Use for stability; omit to use `main` branch for the latest features - config = function() - require("nvim-surround").setup({}) - end, - }, -} diff --git a/lua/plugins/test.lua b/lua/plugins/test.lua deleted file mode 100644 index 71132c2..0000000 --- a/lua/plugins/test.lua +++ /dev/null @@ -1,59 +0,0 @@ -local function get_javascript_adapter_test() - if vim.fn.findfile("jest.config.js", ".;") ~= "" or vim.fn.findfile("jest.config.ts", ".;") ~= "" then - return require("neotest-jest")({ - jestConfigFile = "jest.config.js", - jestCommand = "yarn jest", - }) - end - - if vim.fn.findfile("vite.config.js", ".;") ~= "" or vim.fn.findfile("vite.config.ts", ".;") ~= "" then - return require("neotest-vitest")({ - is_test_file = function(file_path) - if string.match(file_path, "test.ts") then - return true - end - end, - }) - end - - return nil -end - -return { - { "fredrikaverpil/neotest-golang", enabled = false }, - { "mrcjkb/neotest-haskell", enabled = false }, - { - "nvim-neotest/neotest", - dependencies = { - "nvim-neotest/nvim-nio", - "nvim-lua/plenary.nvim", - "antoinemadec/FixCursorHold.nvim", - "nvim-treesitter/nvim-treesitter", - "nvim-neotest/neotest-go", - "nvim-neotest/neotest-python", - "nvim-neotest/neotest-jest", - "marilari88/neotest-vitest", - }, - config = function() - local goAdapter = require("neotest-go")({ - args = { "-v" }, - }) - - local pyAdapter = require("neotest-python")({ - args = { "-s", "-vv" }, - runner = "pytest", - }) - - local jsAdapter = get_javascript_adapter_test() - - ---@diagnostic disable-next-line: missing-fields - require("neotest").setup({ - adapters = { goAdapter, pyAdapter, jsAdapter }, - ---@diagnostic disable-next-line: missing-fields - diagnostic = { - enable = true, - }, - }) - end, - }, -} diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua deleted file mode 100644 index b5bdc7f..0000000 --- a/lua/plugins/ui.lua +++ /dev/null @@ -1,57 +0,0 @@ -local logo = [[ -`8.`888b ,8' 8 8888 ,8. ,8. - `8.`888b ,8' 8 8888 ,888. ,888. - `8.`888b ,8' 8 8888 .`8888. .`8888. - `8.`888b ,8' 8 8888 ,8.`8888. ,8.`8888. - `8.`888b ,8' 8 8888 ,8'8.`8888,8^8.`8888. - `8.`888b ,8' 8 8888 ,8' `8.`8888' `8.`8888. - `8.`888b8' 8 8888 ,8' `8.`88' `8.`8888. - `8.`888' 8 8888 ,8' `8.`' `8.`8888. - `8.`8' 8 8888 ,8' `8 `8.`8888. - `8.` 8 8888 ,8' ` `8.`8888. -]] - --- define the colorscheme for nvim -return { - { - "norcalli/nvim-colorizer.lua", - event = "BufEnter", - opts = { "*" }, - }, - { - "folke/tokyonight.nvim", - opts = { - transparent = true, - style = "night", - styles = { - sidebars = "transparent", - floats = "transparent", - }, - }, - }, - { - "nvim-lualine/lualine.nvim", - opts = { - sections = { - lualine_z = {}, - }, - }, - }, - { - "folke/snacks.nvim", - opts = { - dashboard = { - preset = { - header = logo, - }, - sections = { - { section = "header" }, - { section = "keys", gap = 1, padding = 1 }, - { icon = "ο…› ", title = "Recent Files", cwd = true, section = "recent_files", indent = 2, padding = 1 }, - { icon = " ", title = "Projects", section = "projects", indent = 2, padding = 2 }, - { section = "startup" }, - }, - }, - }, - }, -} diff --git a/mason-lock.json b/mason-lock.json deleted file mode 100644 index 429b8dd..0000000 --- a/mason-lock.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "autoflake": "2.3.1", - "bash-language-server": "5.4.0", - "css-lsp": "4.10.0", - "css-variables-language-server": "2.7.0", - "debugpy": "1.8.5", - "delve": "v1.23.1", - "docker-compose-language-service": "0.2.0", - "dockerfile-language-server": "0.13.0", - "emmet-ls": "0.4.2", - "eslint-lsp": "4.10.0", - "eslint_d": "14.0.4", - "gofumpt": "v0.7.0", - "goimports": "v0.25.0", - "golangci-lint-langserver": "v0.0.9", - "gopls": "v0.16.2", - "groovy-language-server": "0c40ec136525b592f1d798bb52ced9d8d2d7945c", - "hadolint": "v2.12.0", - "haskell-debug-adapter": "0.0.39.0", - "haskell-language-server": "2.8.0.0", - "html-lsp": "4.10.0", - "intelephense": "1.12.5", - "isort": "5.13.2", - "jedi-language-server": "0.41.4", - "js-debug-adapter": "v1.94.0", - "json-lsp": "4.10.0", - "kotlin-language-server": "1.3.12", - "lua-language-server": "3.10.6", - "markdown-toc": "1.2.0", - "markdownlint-cli2": "0.14.0", - "marksman": "2023-12-09", - "php-cs-fixer": "v3.64.0", - "php-debug-adapter": "v1.35.0", - "phpactor": "2024.06.30.0", - "phpcs": "3.10.3", - "prettier": "3.3.3", - "pyright": "1.1.373", - "ruff": "0.6.9", - "ruff-lsp": "0.0.56", - "shellcheck": "v0.10.0", - "shfmt": "v3.9.0", - "sqlfluff": "3.1.1", - "stimulus-language-server": "1.0.4", - "stylua": "v0.20.0", - "tailwindcss-language-server": "0.0.24", - "taplo": "0.9.2", - "typescript-language-server": "4.3.3", - "vtsls": "0.2.5", - "vue-language-server": "2.1.6", - "yaml-language-server": "1.15.0" -} \ No newline at end of file diff --git a/stylua.toml b/stylua.toml deleted file mode 100644 index 5d6c50d..0000000 --- a/stylua.toml +++ /dev/null @@ -1,3 +0,0 @@ -indent_type = "Spaces" -indent_width = 2 -column_width = 120 \ No newline at end of file From 9c08038ccf519a196d2e69e7e4eb156dcf3f12a9 Mon Sep 17 00:00:00 2001 From: fschuermeyer <25571323+fschuermeyer@users.noreply.github.com> Date: Wed, 18 Dec 2024 16:25:56 +0100 Subject: [PATCH 02/37] WIP: Add Configuration for GitSigns --- lua/plugins/gitsigns.lua | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua index 205f53f..75a3794 100644 --- a/lua/plugins/gitsigns.lua +++ b/lua/plugins/gitsigns.lua @@ -1,3 +1,37 @@ return { "lewis6991/gitsigns.nvim", + opts = { + signs = { + add = { text = "β–Ž" }, + change = { text = "β–Ž" }, + delete = { text = "οƒš" }, + topdelete = { text = "οƒš" }, + changedelete = { text = "β–Ž" }, + untracked = { text = "β–Ž" }, + }, + signs_staged = { + add = { text = "β–Ž" }, + change = { text = "β–Ž" }, + delete = { text = "οƒš" }, + topdelete = { text = "οƒš" }, + changedelete = { text = "β–Ž" }, + }, + current_line_blame = true, + current_line_blame_opts = { + delay = 400, + }, + on_attach = function(buffer) + local gs = package.loaded.gitsigns + + local function setMap(mode, key, action, desc) + vim.keymap.set(mode, key, action, { buffer = buffer, desc = desc }) + end + + setMap("n", "gb", function() + gs.blame_line({ full = true }) + end, "Git Blame") + + setMap("n", "ub", ":Gitsigns toggle_current_line_blame", "Toggle Current Line Git Blame") + end, + }, } From 3b7c10157865cf88cab80a34256cc104b2becda3 Mon Sep 17 00:00:00 2001 From: fschuermeyer <25571323+fschuermeyer@users.noreply.github.com> Date: Wed, 18 Dec 2024 16:37:10 +0100 Subject: [PATCH 03/37] WIP: Add Navigation between Vim and Tmux --- lazy-lock.json | 1 + lua/plugins/vim-tmux-navigator.lua | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 lua/plugins/vim-tmux-navigator.lua diff --git a/lazy-lock.json b/lazy-lock.json index 9b58258..cfd7759 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -5,5 +5,6 @@ "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, "nvim-web-devicons": { "branch": "master", "commit": "0eb18da56e2ba6ba24de7130a12bcc4e31ad11cb" }, "tokyonight.nvim": { "branch": "main", "commit": "45d22cf0e1b93476d3b6d362d720412b3d34465c" }, + "vim-tmux-navigator": { "branch": "master", "commit": "424b5caa154bff34dc258ee53cec5a8e36cf7ea8" }, "which-key.nvim": { "branch": "main", "commit": "8ab96b38a2530eacba5be717f52e04601eb59326" } } diff --git a/lua/plugins/vim-tmux-navigator.lua b/lua/plugins/vim-tmux-navigator.lua new file mode 100644 index 0000000..aee4317 --- /dev/null +++ b/lua/plugins/vim-tmux-navigator.lua @@ -0,0 +1,16 @@ +return { + "christoomey/vim-tmux-navigator", + cmd = { + "TmuxNavigateLeft", + "TmuxNavigateDown", + "TmuxNavigateUp", + "TmuxNavigateRight", + "TmuxNavigatePrevious", + }, + keys = { + { "", "TmuxNavigateLeft" }, + { "", "TmuxNavigateDown" }, + { "", "TmuxNavigateUp" }, + { "", "TmuxNavigateRight" }, + }, +} From fcc9cae479c526c0fa60e573cde73a9b1d5bb5f8 Mon Sep 17 00:00:00 2001 From: fschuermeyer <25571323+fschuermeyer@users.noreply.github.com> Date: Wed, 18 Dec 2024 16:52:27 +0100 Subject: [PATCH 04/37] WIP: Add Treesitter Highlights --- lazy-lock.json | 2 ++ lua/plugins/treesitter.lua | 72 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 lua/plugins/treesitter.lua diff --git a/lazy-lock.json b/lazy-lock.json index cfd7759..e8c7700 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -3,6 +3,8 @@ "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, + "nvim-treesitter": { "branch": "master", "commit": "102bc74e093ef54aab57a368db15befeb9ba9d58" }, + "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" }, "nvim-web-devicons": { "branch": "master", "commit": "0eb18da56e2ba6ba24de7130a12bcc4e31ad11cb" }, "tokyonight.nvim": { "branch": "main", "commit": "45d22cf0e1b93476d3b6d362d720412b3d34465c" }, "vim-tmux-navigator": { "branch": "master", "commit": "424b5caa154bff34dc258ee53cec5a8e36cf7ea8" }, diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua new file mode 100644 index 0000000..ca98068 --- /dev/null +++ b/lua/plugins/treesitter.lua @@ -0,0 +1,72 @@ +return { + "nvim-treesitter/nvim-treesitter", + event = { "BufReadPre", "BufNewFile" }, + build = ":TSUpdate", + dependencies = { + "windwp/nvim-ts-autotag", + }, + config = function() + -- import nvim-treesitter plugin + local treesitter = require("nvim-treesitter.configs") + + -- configure treesitter + treesitter.setup({ -- enable syntax highlighting + highlight = { + enable = true, + }, + -- enable indentation + indent = { enable = true }, + -- enable autotagging (w/ nvim-ts-autotag plugin) + autotag = { + enable = true, + }, + -- ensure these language parsers are installed + ensure_installed = { + "json", + "javascript", + "typescript", + "tsx", + "yaml", + "html", + "css", + "markdown", + "markdown_inline", + "graphql", + "bash", + "lua", + "vim", + "dockerfile", + "gitignore", + "query", + "vimdoc", + "go", + "php", + "csv", + "dart", + "diff", + "editorconfig", + "gomod", + "gosum", + "gotmpl", + "haskell", + "java", + "jq", + "kotlin", + "python", + "sql", + "tmux", + "vue", + "xml", + }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "", + node_incremental = "", + scope_incremental = false, + node_decremental = "", + }, + }, + }) + end, +} From 8d02abc6b95f40a1f15dd65c95a73bacd45a5fa7 Mon Sep 17 00:00:00 2001 From: fschuermeyer <25571323+fschuermeyer@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:10:06 +0100 Subject: [PATCH 05/37] WIP: Add Folke Snaks Dashboard --- lua/plugins/folke-snaks.lua | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 lua/plugins/folke-snaks.lua diff --git a/lua/plugins/folke-snaks.lua b/lua/plugins/folke-snaks.lua new file mode 100644 index 0000000..b6335bf --- /dev/null +++ b/lua/plugins/folke-snaks.lua @@ -0,0 +1,39 @@ +local logo = [[ +`8.`888b ,8' 8 8888 ,8. ,8. + `8.`888b ,8' 8 8888 ,888. ,888. + `8.`888b ,8' 8 8888 .`8888. .`8888. + `8.`888b ,8' 8 8888 ,8.`8888. ,8.`8888. + `8.`888b ,8' 8 8888 ,8'8.`8888,8^8.`8888. + `8.`888b ,8' 8 8888 ,8' `8.`8888' `8.`8888. + `8.`888b8' 8 8888 ,8' `8.`88' `8.`8888. + `8.`888' 8 8888 ,8' `8.`' `8.`8888. + `8.`8' 8 8888 ,8' `8 `8.`8888. + `8.` 8 8888 ,8' ` `8.`8888. + +github.com/fschuermeyer/nvim-setup +]] + +return { + "folke/snacks.nvim", + opts = { + dashboard = { + preset = { + header = logo, + }, + sections = { + { section = "header" }, + { section = "keys", gap = 1, padding = 1 }, + { + icon = "ο…› ", + title = "Recent Files", + cwd = true, + section = "recent_files", + indent = 2, + padding = 1, + }, + { icon = " ", title = "Projects", section = "projects", indent = 2, padding = 2 }, + { section = "startup" }, + }, + }, + }, +} From b4d307d117b3524ba06a3ff4dedd17728d930eb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCrmeyer?= <25571323+fschuermeyer@users.noreply.github.com> Date: Fri, 20 Dec 2024 18:59:15 +0100 Subject: [PATCH 06/37] WIP: Add Telescope Base Settings --- lua/plugins/folke-todo-comments.lua | 5 +++ lua/plugins/telescope.lua | 56 +++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 lua/plugins/folke-todo-comments.lua create mode 100644 lua/plugins/telescope.lua diff --git a/lua/plugins/folke-todo-comments.lua b/lua/plugins/folke-todo-comments.lua new file mode 100644 index 0000000..0009823 --- /dev/null +++ b/lua/plugins/folke-todo-comments.lua @@ -0,0 +1,5 @@ +return { + "folke/todo-comments.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + opts = {}, +} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua new file mode 100644 index 0000000..da53a00 --- /dev/null +++ b/lua/plugins/telescope.lua @@ -0,0 +1,56 @@ +return { + "nvim-telescope/telescope.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, + "nvim-tree/nvim-web-devicons", + "folke/todo-comments.nvim", + "BurntSushi/ripgrep", + }, + config = function() + local telescope = require("telescope") + local actions = require("telescope.actions") + local layout = require("telescope.actions.layout") + local todo = require("todo-comments") + + telescope.setup({ + defaults = { + path_display = { "truncate" }, + mappings = { + i = { + [""] = actions.move_selection_previous, -- move to prev result + [""] = actions.move_selection_next, -- move to next result + [""] = layout.toggle_preview, -- toggle preview + }, + }, + }, + }) + + telescope.load_extension("fzf") + + -- set keymaps + local keymap = vim.keymap -- for conciseness + keymap.set( + "n", + "", + "Telescope find_files sort_mru=true", + { desc = "Find Files (Root Dir)" } + ) + keymap.set("n", ":", "Telescope command_history", { desc = "Command History" }) + keymap.set( + "n", + "fb", + "Telescope buffers sort_mru=true sort_lastused=true ignore_current_buffer=true", + { desc = "Buffers" } + ) + + keymap.set("n", "fg", "Telescope live_grep", { desc = "Find Grep" }) + keymap.set("n", "fr", "Telescope oldfiles", { desc = "Find Recent" }) + keymap.set("n", "ft", "TodoTelescope", { desc = "Find TODOs" }) + + -- git + keymap.set("n", "gs", "Telescope git_status", { desc = "Git Status" }) + keymap.set("n", "gc", "Telescope git_commits", { desc = "Git Commits" }) + keymap.set("n", "gb", "Telescope git_branches", { desc = "Git Branches" }) + end, +} From c74a4ec1cf2230eec223b978774edc1f4d37ab87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCrmeyer?= <25571323+fschuermeyer@users.noreply.github.com> Date: Fri, 20 Dec 2024 20:49:12 +0100 Subject: [PATCH 07/37] WIP: Add UI Options --- lua/core/keymaps.lua | 12 ++++++------ lua/core/options.lua | 1 + lua/plugins/folke-snaks.lua | 9 +++++++++ lua/plugins/lsp/mason.lua | 0 lua/plugins/telescope.lua | 6 +++++- 5 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 lua/plugins/lsp/mason.lua diff --git a/lua/core/keymaps.lua b/lua/core/keymaps.lua index 7b3f80e..37f9ca7 100644 --- a/lua/core/keymaps.lua +++ b/lua/core/keymaps.lua @@ -5,12 +5,12 @@ local setKey = vim.keymap.set setKey("n", "q", ":q", { desc = "Exit Nvim" }) -- Move Lines -setKey("n", "", "m .-2==", { desc = "Move Up" }) -setKey("n", "", "m .+1==", { desc = "Move Down" }) -setKey("i", "", "m .-2==gi", { desc = "Move Up" }) -setKey("i", "", "m .+1==gi", { desc = "Move Down" }) -setKey("v", "", ":m '>+1gv=gv", { desc = "Move Down" }) -setKey("v", "", ":m '<-2gv=gv", { desc = "Move Up" }) +-- setKey("n", "", "m .-2==", { desc = "Move Up" }) +-- setKey("n", "", "m .+1==", { desc = "Move Down" }) +-- setKey("i", "", "m .+1==gi", { desc = "Move Down" }) +-- setKey("i", "", "m .-2==gi", { desc = "Move Up" }) +-- setKey("v", "", ":m '>+1gv=gv", { desc = "Move Down" }) +-- setKey("v", "", ":m '<-2gv=gv", { desc = "Move Up" }) -- Diffview setKey("n", "gf", "DiffviewFileHistory %", { desc = "Diffview Current File" }) diff --git a/lua/core/options.lua b/lua/core/options.lua index 75173a2..115deef 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -14,3 +14,4 @@ opt.relativenumber = true opt.cursorline = true opt.wrap = false +opt.termguicolors = true diff --git a/lua/plugins/folke-snaks.lua b/lua/plugins/folke-snaks.lua index b6335bf..6322077 100644 --- a/lua/plugins/folke-snaks.lua +++ b/lua/plugins/folke-snaks.lua @@ -15,6 +15,7 @@ github.com/fschuermeyer/nvim-setup return { "folke/snacks.nvim", + lazy = false, opts = { dashboard = { preset = { @@ -36,4 +37,12 @@ return { }, }, }, + config = function(_, opts) + require("snacks").setup(opts) + + Snacks.toggle.option("wrap", { name = "Line Wrap" }):map("uw") + Snacks.toggle.option("number", { name = "Line Numbers" }):map("un") + Snacks.toggle.option("relativenumber", { name = "Relative Line Numbers" }):map("ur") + Snacks.toggle.option("cursorline", { name = "Cursorline" }):map("uc") + end, } diff --git a/lua/plugins/lsp/mason.lua b/lua/plugins/lsp/mason.lua new file mode 100644 index 0000000..e69de29 diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index da53a00..24dc2a7 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -6,12 +6,12 @@ return { "nvim-tree/nvim-web-devicons", "folke/todo-comments.nvim", "BurntSushi/ripgrep", + "andrew-george/telescope-themes", }, config = function() local telescope = require("telescope") local actions = require("telescope.actions") local layout = require("telescope.actions.layout") - local todo = require("todo-comments") telescope.setup({ defaults = { @@ -27,6 +27,7 @@ return { }) telescope.load_extension("fzf") + telescope.load_extension("themes") -- set keymaps local keymap = vim.keymap -- for conciseness @@ -52,5 +53,8 @@ return { keymap.set("n", "gs", "Telescope git_status", { desc = "Git Status" }) keymap.set("n", "gc", "Telescope git_commits", { desc = "Git Commits" }) keymap.set("n", "gb", "Telescope git_branches", { desc = "Git Branches" }) + + -- ui + keymap.set("n", "ut", "Telescope themes", { desc = "UI Themes" }) end, } From 8536e927a50c979d3d599dc8f50bf7a3dffcd644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCrmeyer?= <25571323+fschuermeyer@users.noreply.github.com> Date: Fri, 20 Dec 2024 21:23:52 +0100 Subject: [PATCH 08/37] WIP: Adding additional UI and Keymap Options --- lua/core/keymaps.lua | 6 ++++++ lua/core/options.lua | 1 + lua/plugins/colorizer.lua | 7 +++++++ lua/plugins/folke-which-key.lua | 12 +++++++++++- lua/plugins/gitsigns.lua | 12 ++++++++++++ 5 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 lua/plugins/colorizer.lua diff --git a/lua/core/keymaps.lua b/lua/core/keymaps.lua index 37f9ca7..9562098 100644 --- a/lua/core/keymaps.lua +++ b/lua/core/keymaps.lua @@ -18,3 +18,9 @@ setKey("n", "gh", "DiffviewFileHistory", { desc = "Diffview His setKey("n", "gt", "DiffviewClose", { desc = "Diffview Close" }) setKey("n", "gd", "DiffviewOpen", { desc = "Diffview Open" }) setKey("n", "gp", "DiffviewOpen origin/HEAD...HEAD --imply-local", { desc = "Diffview Branch" }) + +-- Window Mappings +setKey("n", "#", "vsplit", { desc = "Split Window Vertically" }) +setKey("n", "-", "split", { desc = "Split Window Horizontally" }) + + diff --git a/lua/core/options.lua b/lua/core/options.lua index 115deef..2bf3ebc 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -15,3 +15,4 @@ opt.cursorline = true opt.wrap = false opt.termguicolors = true +opt.mouse = "" diff --git a/lua/plugins/colorizer.lua b/lua/plugins/colorizer.lua new file mode 100644 index 0000000..9045748 --- /dev/null +++ b/lua/plugins/colorizer.lua @@ -0,0 +1,7 @@ +return { + { + "norcalli/nvim-colorizer.lua", + event = "BufEnter", + opts = { "*" }, + }, +} diff --git a/lua/plugins/folke-which-key.lua b/lua/plugins/folke-which-key.lua index 4d0102a..078c002 100644 --- a/lua/plugins/folke-which-key.lua +++ b/lua/plugins/folke-which-key.lua @@ -1,5 +1,15 @@ return { "folke/which-key.nvim", event = "VeryLazy", - opts = {}, + opts = { + preset = "helix", + sort = {"alphanum"}, + spec = { + mode = { "n", "v" }, + { "d", group = "debug" }, + { "f", group = "file/find" }, + { "g", group = "git" }, + { "u", group = "ui", icon = { icon = "σ°™΅ ", color = "cyan" } }, + }, + }, } diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua index 75a3794..7c5d6c7 100644 --- a/lua/plugins/gitsigns.lua +++ b/lua/plugins/gitsigns.lua @@ -27,11 +27,23 @@ return { vim.keymap.set(mode, key, action, { buffer = buffer, desc = desc }) end + -- git setMap("n", "gb", function() gs.blame_line({ full = true }) end, "Git Blame") + -- ui setMap("n", "ub", ":Gitsigns toggle_current_line_blame", "Toggle Current Line Git Blame") + + Snacks.toggle({ + name = "Git Signs", + get = function() + return require("gitsigns.config").config.signcolumn + end, + set = function(state) + require("gitsigns").toggle_signs(state) + end, + }):map("ug") end, }, } From 5281c6d4b5bcd35029e88c0ebe385261dd6e9665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCrmeyer?= <25571323+fschuermeyer@users.noreply.github.com> Date: Fri, 20 Dec 2024 22:47:39 +0100 Subject: [PATCH 09/37] WIP: Add UI Updates --- lua/plugins/dressing.lua | 5 +++++ lua/plugins/folke-noice.lua | 43 +++++++++++++++++++++++++++++++++++++ lua/plugins/lualine.lua | 6 +++++- lua/plugins/neotree.lua | 32 +++++++++++++++++++++++++++ 4 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 lua/plugins/dressing.lua create mode 100644 lua/plugins/folke-noice.lua create mode 100644 lua/plugins/neotree.lua diff --git a/lua/plugins/dressing.lua b/lua/plugins/dressing.lua new file mode 100644 index 0000000..194527c --- /dev/null +++ b/lua/plugins/dressing.lua @@ -0,0 +1,5 @@ +return { + "stevearc/dressing.nvim", + event = "VeryLazy", + opts = {}, +} diff --git a/lua/plugins/folke-noice.lua b/lua/plugins/folke-noice.lua new file mode 100644 index 0000000..a619e1d --- /dev/null +++ b/lua/plugins/folke-noice.lua @@ -0,0 +1,43 @@ +return { + "folke/noice.nvim", + event = "VeryLazy", + dependencies = { + "MunifTanjim/nui.nvim", + "rcarriga/nvim-notify", + }, + config = function() + require("noice").setup({ + views = { + cmdline_popup = { + position = { + row = 5, + col = "50%", + }, + size = { + width = 60, + height = "auto", + }, + }, + popupmenu = { + relative = "editor", + position = { + row = 8, + col = "50%", + }, + size = { + width = 60, + height = 10, + }, + border = { + style = "rounded", + padding = { 0, 1 }, + }, + win_options = { + winhighlight = { Normal = "Normal", FloatBorder = "DiagnosticInfo" }, + }, + }, + }, + }) + + end, +} diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index d4f56b4..2ae391e 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -2,6 +2,10 @@ return { "nvim-lualine/lualine.nvim", dependencies = { "nvim-tree/nvim-web-devicons" }, config = function() - require("lualine").setup({}) + local lualine = require("lualine") + + lualine.setup({ + extensions = { "neo-tree" }, + }) end, } diff --git a/lua/plugins/neotree.lua b/lua/plugins/neotree.lua new file mode 100644 index 0000000..840544b --- /dev/null +++ b/lua/plugins/neotree.lua @@ -0,0 +1,32 @@ +return { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", + }, + config = function() + local neo_tree = require("neo-tree") + + neo_tree.setup({ + filesystem = { + filtered_items = { + visible = true, + }, + }, + source_selector = { + winbar = true, + } + }) + + local setKey = vim.keymap.set + + setKey( + "n", + "e", + "Neotree right toggle", + { noremap = true, silent = true, desc="Explorer"} + ) + end, +} From 06162fda9c080d8174643fc6f4e1a85c17b7bfed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCrmeyer?= <25571323+fschuermeyer@users.noreply.github.com> Date: Fri, 20 Dec 2024 23:02:47 +0100 Subject: [PATCH 10/37] WIP: Add UI Updates --- lua/plugins/folke-snaks.lua | 4 +++- lua/plugins/neotree.lua | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lua/plugins/folke-snaks.lua b/lua/plugins/folke-snaks.lua index 6322077..eb1ed5c 100644 --- a/lua/plugins/folke-snaks.lua +++ b/lua/plugins/folke-snaks.lua @@ -38,7 +38,9 @@ return { }, }, config = function(_, opts) - require("snacks").setup(opts) + require("snacks").setup(opts) + + vim.api.nvim_set_hl(0, "SnacksDashboardHeader", { fg = "#FFA500" }) -- Orange Farbe Snacks.toggle.option("wrap", { name = "Line Wrap" }):map("uw") Snacks.toggle.option("number", { name = "Line Numbers" }):map("un") diff --git a/lua/plugins/neotree.lua b/lua/plugins/neotree.lua index 840544b..56cbea2 100644 --- a/lua/plugins/neotree.lua +++ b/lua/plugins/neotree.lua @@ -15,9 +15,9 @@ return { visible = true, }, }, - source_selector = { - winbar = true, - } + source_selector = { + winbar = true, + }, }) local setKey = vim.keymap.set @@ -26,7 +26,7 @@ return { "n", "e", "Neotree right toggle", - { noremap = true, silent = true, desc="Explorer"} + { noremap = true, silent = true, desc = "Explorer NeoTree" } ) end, } From 735785b892770fb1ec6f0a3530ab4d8f79e08696 Mon Sep 17 00:00:00 2001 From: fschuermeyer <25571323+fschuermeyer@users.noreply.github.com> Date: Mon, 23 Dec 2024 01:44:03 +0100 Subject: [PATCH 11/37] WIP: Neotree Improvments --- lazy-lock.json | 17 +++++++++++++++-- lua/plugins/neotree.lua | 7 +++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index e8c7700..123c336 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,11 +1,24 @@ { "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, + "dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" }, "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, - "nvim-treesitter": { "branch": "master", "commit": "102bc74e093ef54aab57a368db15befeb9ba9d58" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" }, + "noice.nvim": { "branch": "main", "commit": "eaed6cc9c06aa2013b5255349e4f26a6b17ab70f" }, + "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, + "nvim-notify": { "branch": "master", "commit": "fbef5d32be8466dd76544a257d3f3dce20082a07" }, + "nvim-treesitter": { "branch": "master", "commit": "caba7ef3556079dec03407bcbb290ddc688ea06e" }, "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" }, - "nvim-web-devicons": { "branch": "master", "commit": "0eb18da56e2ba6ba24de7130a12bcc4e31ad11cb" }, + "nvim-web-devicons": { "branch": "master", "commit": "15c7d0f616ebf88960ce5c4221828f62789d36d9" }, + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, + "ripgrep": { "branch": "master", "commit": "79cbe89deb1151e703f4d91b19af9cdcc128b765" }, + "snacks.nvim": { "branch": "main", "commit": "98df370703b3c47a297988f3e55ce99628639590" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" }, + "telescope-themes": { "branch": "main", "commit": "9b7c368b83b82b53c0a6e9e977f8329e5f1fe269" }, + "telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" }, + "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, "tokyonight.nvim": { "branch": "main", "commit": "45d22cf0e1b93476d3b6d362d720412b3d34465c" }, "vim-tmux-navigator": { "branch": "master", "commit": "424b5caa154bff34dc258ee53cec5a8e36cf7ea8" }, "which-key.nvim": { "branch": "main", "commit": "8ab96b38a2530eacba5be717f52e04601eb59326" } diff --git a/lua/plugins/neotree.lua b/lua/plugins/neotree.lua index 56cbea2..93fd69b 100644 --- a/lua/plugins/neotree.lua +++ b/lua/plugins/neotree.lua @@ -10,6 +10,13 @@ return { local neo_tree = require("neo-tree") neo_tree.setup({ + window = { + mappings = { + -- fix: german layout + ["<"] = "next_source", + [">"] = "prev_source", + }, + }, filesystem = { filtered_items = { visible = true, From d837a2ee5ed9b695097004f3e767f1bb93a426bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCrmeyer?= <25571323+fschuermeyer@users.noreply.github.com> Date: Mon, 23 Dec 2024 02:21:32 +0100 Subject: [PATCH 12/37] WIP: Add Yank Highlights --- lua/core/autocmd.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 lua/core/autocmd.lua diff --git a/lua/core/autocmd.lua b/lua/core/autocmd.lua new file mode 100644 index 0000000..093c105 --- /dev/null +++ b/lua/core/autocmd.lua @@ -0,0 +1,11 @@ +vim.api.nvim_set_hl(0, "YankHighlight", { bg = "#C11B3B", fg = "#F3A3B3" }) + +-- Highlight, was gejankt wurde +vim.api.nvim_create_autocmd("TextYankPost", { + callback = function() + vim.highlight.on_yank({ + higroup = "YankHighlight", + timeout = 200, + }) + end, +}) From 599a1ddcbbd811d5961c4f202ef9d18884040277 Mon Sep 17 00:00:00 2001 From: fschuermeyer <25571323+fschuermeyer@users.noreply.github.com> Date: Mon, 23 Dec 2024 02:39:22 +0100 Subject: [PATCH 13/37] WIP: Add TextObject, Yank Highlights --- init.lua | 1 + lazy-lock.json | 1 + lua/core/options.lua | 1 + lua/plugins/mini-ai.lua | 92 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 95 insertions(+) create mode 100644 lua/plugins/mini-ai.lua diff --git a/init.lua b/init.lua index 9728eb3..c3f3781 100644 --- a/init.lua +++ b/init.lua @@ -1,4 +1,5 @@ require("core.options") require("core.keymaps") require("core.provider") +require("core.autocmd") require("core.lazy") diff --git a/lazy-lock.json b/lazy-lock.json index 123c336..4d6f69e 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -4,6 +4,7 @@ "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, + "mini.ai": { "branch": "main", "commit": "40e380a589d07ec2c856940c6422aafe5d949a0d" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" }, "noice.nvim": { "branch": "main", "commit": "eaed6cc9c06aa2013b5255349e4f26a6b17ab70f" }, "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" }, diff --git a/lua/core/options.lua b/lua/core/options.lua index 2bf3ebc..3bb4916 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -16,3 +16,4 @@ opt.wrap = false opt.termguicolors = true opt.mouse = "" +opt.clipboard = "unnamedplus" -- System Clipboard diff --git a/lua/plugins/mini-ai.lua b/lua/plugins/mini-ai.lua new file mode 100644 index 0000000..7c4555b --- /dev/null +++ b/lua/plugins/mini-ai.lua @@ -0,0 +1,92 @@ +return { + { + "echasnovski/mini.ai", + version = "*", -- Use the latest version + event = "VeryLazy", + config = function(_, opts) + local ai = require("mini.ai") + ai.setup({ + mappings = { + around = "a", -- Default mapping for "around" textobject + inside = "i", -- Default mapping for "inside" textobject + }, + 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]", + }, + "^().*()$", + }, + u = ai.gen_spec.function_call(), -- u for "Usage" + U = ai.gen_spec.function_call({ name_pattern = "[%w_]" }), -- without dot in function name + }, + }) + + local objects = { + { " ", desc = "whitespace" }, + { '"', desc = '" string' }, + { "'", desc = "' string" }, + { "(", desc = "() block" }, + { ")", desc = "() block with ws" }, + { "<", desc = "<> block" }, + { ">", desc = "<> block with ws" }, + { "?", desc = "user prompt" }, + { "U", desc = "use/call without dot" }, + { "[", desc = "[] block" }, + { "]", desc = "[] block with ws" }, + { "_", desc = "underscore" }, + { "`", desc = "` string" }, + { "a", desc = "argument" }, + { "b", desc = ")]} block" }, + { "c", desc = "class" }, + { "d", desc = "digit(s)" }, + { "e", desc = "CamelCase / snake_case" }, + { "f", desc = "function" }, + { "i", desc = "indent" }, + { "o", desc = "block, conditional, loop" }, + { "q", desc = "quote `\"'" }, + { "t", desc = "tag" }, + { "u", desc = "use/call" }, + { "{", desc = "{} block" }, + { "}", desc = "{} with ws" }, + } + ---@type wk.Spec[] + local ret = { mode = { "o", "x" } } + ---@type table + local mappings = vim.tbl_extend("force", {}, { + around = "a", + inside = "i", + around_next = "an", + inside_next = "in", + around_last = "al", + inside_last = "il", + }, opts.mappings or {}) + mappings.goto_left = nil + mappings.goto_right = nil + + for name, prefix in pairs(mappings) do + name = name:gsub("^around_", ""):gsub("^inside_", "") + ret[#ret + 1] = { prefix, group = name } + for _, obj in ipairs(objects) do + local desc = obj.desc + if prefix:sub(1, 1) == "i" then + desc = desc:gsub(" with ws", "") + end + ret[#ret + 1] = { prefix .. obj[1], desc = obj.desc } + end + end + require("which-key").add(ret, { notify = false }) + end, + }, +} From a2bdf3c48e1493a35583df229c78d33aa27b1b97 Mon Sep 17 00:00:00 2001 From: fschuermeyer <25571323+fschuermeyer@users.noreply.github.com> Date: Mon, 23 Dec 2024 02:59:27 +0100 Subject: [PATCH 14/37] WIP: Adding Indentions --- lua/plugins/{folke-snaks.lua => folke-snacks.lua} | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) rename lua/plugins/{folke-snaks.lua => folke-snacks.lua} (88%) diff --git a/lua/plugins/folke-snaks.lua b/lua/plugins/folke-snacks.lua similarity index 88% rename from lua/plugins/folke-snaks.lua rename to lua/plugins/folke-snacks.lua index eb1ed5c..39afbb8 100644 --- a/lua/plugins/folke-snaks.lua +++ b/lua/plugins/folke-snacks.lua @@ -36,9 +36,20 @@ return { { section = "startup" }, }, }, + indent = { + enabled = true, + animate = { + duration = { + step = 5, + total = 250, + }, + }, + }, + scope = { enabled = true }, + scroll = { enabled = true }, }, config = function(_, opts) - require("snacks").setup(opts) + require("snacks").setup(opts) vim.api.nvim_set_hl(0, "SnacksDashboardHeader", { fg = "#FFA500" }) -- Orange Farbe From 20d9e95e0a42ff62402f666a6ca9469b098c2bf8 Mon Sep 17 00:00:00 2001 From: fschuermeyer <25571323+fschuermeyer@users.noreply.github.com> Date: Mon, 23 Dec 2024 03:15:01 +0100 Subject: [PATCH 15/37] WIP: Add AlternateToggler, BigFile, VimGo --- lazy-lock.json | 3 +++ lua/core/keymaps.lua | 4 ++++ lua/plugins/alternate-toggler.lua | 3 +++ lua/plugins/bigfile.lua | 10 ++++++++++ lua/plugins/vim-go.lua | 13 +++++++++++++ 5 files changed, 33 insertions(+) create mode 100644 lua/plugins/alternate-toggler.lua create mode 100644 lua/plugins/bigfile.lua create mode 100644 lua/plugins/vim-go.lua diff --git a/lazy-lock.json b/lazy-lock.json index 4d6f69e..4da8ae0 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,4 +1,6 @@ { + "alternate-toggler": { "branch": "main", "commit": "819800304d3e8e575fd6aa461a8bcf2217e1cfb6" }, + "bigfile.nvim": { "branch": "main", "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" }, "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, @@ -21,6 +23,7 @@ "telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" }, "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, "tokyonight.nvim": { "branch": "main", "commit": "45d22cf0e1b93476d3b6d362d720412b3d34465c" }, + "vim-go": { "branch": "master", "commit": "ec7a59ef10d417c0cc1cd571a165c7c9dec30d27" }, "vim-tmux-navigator": { "branch": "master", "commit": "424b5caa154bff34dc258ee53cec5a8e36cf7ea8" }, "which-key.nvim": { "branch": "main", "commit": "8ab96b38a2530eacba5be717f52e04601eb59326" } } diff --git a/lua/core/keymaps.lua b/lua/core/keymaps.lua index 9562098..c6817cc 100644 --- a/lua/core/keymaps.lua +++ b/lua/core/keymaps.lua @@ -23,4 +23,8 @@ setKey("n", "gp", "DiffviewOpen origin/HEAD...HEAD --imply-local#", "vsplit", { desc = "Split Window Vertically" }) setKey("n", "-", "split", { desc = "Split Window Horizontally" }) +-- AlternateToggler +setKey("n", "i", "ToggleAlternate", { desc = "Toggle State" }) +-- VimGo +setKey("n", "tg", "GoTestFunc", { desc = "Test Golang" }) diff --git a/lua/plugins/alternate-toggler.lua b/lua/plugins/alternate-toggler.lua new file mode 100644 index 0000000..5588148 --- /dev/null +++ b/lua/plugins/alternate-toggler.lua @@ -0,0 +1,3 @@ +return { + "rmagatti/alternate-toggler", +} diff --git a/lua/plugins/bigfile.lua b/lua/plugins/bigfile.lua new file mode 100644 index 0000000..3f70b5f --- /dev/null +++ b/lua/plugins/bigfile.lua @@ -0,0 +1,10 @@ +return { + "LunarVim/bigfile.nvim", + event = "BufReadPre", + opts = { + filesize = 3, + }, + config = function(_, opts) + require("bigfile").setup(opts) + end, +} diff --git a/lua/plugins/vim-go.lua b/lua/plugins/vim-go.lua new file mode 100644 index 0000000..042076e --- /dev/null +++ b/lua/plugins/vim-go.lua @@ -0,0 +1,13 @@ +return { + { + "gatih/vim-go", + build = ":GoInstallBinaries", + run = ":GoUpdateBinaries", + config = function() + vim.g.go_def_mode = "gopls" + vim.g.go_info_mode = "gopls" + vim.g.go_fmt_command = "goimports" + vim.g.go_auto_type_info = 1 + end, + }, +} From 42ec7f5e87f95bad925b616dbac3dee08e729cd7 Mon Sep 17 00:00:00 2001 From: fschuermeyer <25571323+fschuermeyer@users.noreply.github.com> Date: Mon, 23 Dec 2024 03:19:13 +0100 Subject: [PATCH 16/37] WIP: Switch Which Key Mode --- lua/plugins/folke-which-key.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/folke-which-key.lua b/lua/plugins/folke-which-key.lua index 078c002..504be0f 100644 --- a/lua/plugins/folke-which-key.lua +++ b/lua/plugins/folke-which-key.lua @@ -2,7 +2,7 @@ return { "folke/which-key.nvim", event = "VeryLazy", opts = { - preset = "helix", + preset = "modern", sort = {"alphanum"}, spec = { mode = { "n", "v" }, From fe874cc707ed593645682ef10c84108453f135c2 Mon Sep 17 00:00:00 2001 From: fschuermeyer <25571323+fschuermeyer@users.noreply.github.com> Date: Sat, 28 Dec 2024 00:10:20 +0100 Subject: [PATCH 17/37] WIP: clean up --- lazy-lock.json | 135 +++++++++-------------------------------- lua/plugins/vim-go.lua | 2 +- 2 files changed, 28 insertions(+), 109 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index f242345..ea85512 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,110 +1,29 @@ { - "alternate-toggler": { - "branch": "main", - "commit": "819800304d3e8e575fd6aa461a8bcf2217e1cfb6" - }, - "bigfile.nvim": { - "branch": "main", - "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" - }, - "diffview.nvim": { - "branch": "main", - "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" - }, - "dressing.nvim": { - "branch": "master", - "commit": "3a45525bb182730fe462325c99395529308f431e" - }, - "gitsigns.nvim": { - "branch": "main", - "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" - }, - "lazy.nvim": { - "branch": "main", - "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" - }, - "lualine.nvim": { - "branch": "master", - "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" - }, - "mini.ai": { - "branch": "main", - "commit": "40e380a589d07ec2c856940c6422aafe5d949a0d" - }, - "neo-tree.nvim": { - "branch": "v3.x", - "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" - }, - "noice.nvim": { - "branch": "main", - "commit": "eaed6cc9c06aa2013b5255349e4f26a6b17ab70f" - }, - "nui.nvim": { - "branch": "main", - "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" - }, - "nvim-colorizer.lua": { - "branch": "master", - "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" - }, - "nvim-notify": { - "branch": "master", - "commit": "fbef5d32be8466dd76544a257d3f3dce20082a07" - }, - "nvim-treesitter": { - "branch": "master", - "commit": "caba7ef3556079dec03407bcbb290ddc688ea06e" - }, - "nvim-ts-autotag": { - "branch": "main", - "commit": "1cca23c9da708047922d3895a71032bc0449c52d" - }, - "nvim-web-devicons": { - "branch": "master", - "commit": "15c7d0f616ebf88960ce5c4221828f62789d36d9" - }, - "plenary.nvim": { - "branch": "master", - "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" - }, - "ripgrep": { - "branch": "master", - "commit": "79cbe89deb1151e703f4d91b19af9cdcc128b765" - }, - "snacks.nvim": { - "branch": "main", - "commit": "98df370703b3c47a297988f3e55ce99628639590" - }, - "telescope-fzf-native.nvim": { - "branch": "main", - "commit": "dae2eac9d91464448b584c7949a31df8faefec56" - }, - "telescope-themes": { - "branch": "main", - "commit": "9b7c368b83b82b53c0a6e9e977f8329e5f1fe269" - }, - "telescope.nvim": { - "branch": "master", - "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" - }, - "todo-comments.nvim": { - "branch": "main", - "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" - }, - "tokyonight.nvim": { - "branch": "main", - "commit": "45d22cf0e1b93476d3b6d362d720412b3d34465c" - }, - "vim-go": { - "branch": "master", - "commit": "ec7a59ef10d417c0cc1cd571a165c7c9dec30d27" - }, - "vim-tmux-navigator": { - "branch": "master", - "commit": "424b5caa154bff34dc258ee53cec5a8e36cf7ea8" - }, - "which-key.nvim": { - "branch": "main", - "commit": "8ab96b38a2530eacba5be717f52e04601eb59326" - } + "alternate-toggler": { "branch": "main", "commit": "819800304d3e8e575fd6aa461a8bcf2217e1cfb6" }, + "bigfile.nvim": { "branch": "main", "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" }, + "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, + "dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" }, + "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, + "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, + "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, + "mini.ai": { "branch": "main", "commit": "40e380a589d07ec2c856940c6422aafe5d949a0d" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" }, + "noice.nvim": { "branch": "main", "commit": "eaed6cc9c06aa2013b5255349e4f26a6b17ab70f" }, + "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, + "nvim-notify": { "branch": "master", "commit": "29b33efc802a304b1cf13ab200915d4e9e67373d" }, + "nvim-treesitter": { "branch": "master", "commit": "eb3e850acff4d9f2f2dd8dacd75353043c899753" }, + "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" }, + "nvim-web-devicons": { "branch": "master", "commit": "63f552a7f59badc6e6b6d22e603150f0d5abebb7" }, + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, + "ripgrep": { "branch": "master", "commit": "79cbe89deb1151e703f4d91b19af9cdcc128b765" }, + "snacks.nvim": { "branch": "main", "commit": "98df370703b3c47a297988f3e55ce99628639590" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" }, + "telescope-themes": { "branch": "main", "commit": "9b7c368b83b82b53c0a6e9e977f8329e5f1fe269" }, + "telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" }, + "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, + "tokyonight.nvim": { "branch": "main", "commit": "45d22cf0e1b93476d3b6d362d720412b3d34465c" }, + "vim-go": { "branch": "master", "commit": "6adc82bfef7f9a4b0db78065ae51b8ebb145c355" }, + "vim-tmux-navigator": { "branch": "master", "commit": "d847ea942a5bb4d4fab6efebc9f30d787fd96e65" }, + "which-key.nvim": { "branch": "main", "commit": "8ab96b38a2530eacba5be717f52e04601eb59326" } } diff --git a/lua/plugins/vim-go.lua b/lua/plugins/vim-go.lua index 042076e..fe7900b 100644 --- a/lua/plugins/vim-go.lua +++ b/lua/plugins/vim-go.lua @@ -1,6 +1,6 @@ return { { - "gatih/vim-go", + "fatih/vim-go", build = ":GoInstallBinaries", run = ":GoUpdateBinaries", config = function() From 7482db483b6452683eb0984f664954fef132dd27 Mon Sep 17 00:00:00 2001 From: fschuermeyer <25571323+fschuermeyer@users.noreply.github.com> Date: Sat, 28 Dec 2024 00:11:47 +0100 Subject: [PATCH 18/37] WIP: Removed Unused UI File --- lua/plugins/ui.lua | 62 ---------------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 lua/plugins/ui.lua diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua deleted file mode 100644 index e3692ab..0000000 --- a/lua/plugins/ui.lua +++ /dev/null @@ -1,62 +0,0 @@ -local logo = [[ -`8.`888b ,8' 8 8888 ,8. ,8. - `8.`888b ,8' 8 8888 ,888. ,888. - `8.`888b ,8' 8 8888 .`8888. .`8888. - `8.`888b ,8' 8 8888 ,8.`8888. ,8.`8888. - `8.`888b ,8' 8 8888 ,8'8.`8888,8^8.`8888. - `8.`888b ,8' 8 8888 ,8' `8.`8888' `8.`8888. - `8.`888b8' 8 8888 ,8' `8.`88' `8.`8888. - `8.`888' 8 8888 ,8' `8.`' `8.`8888. - `8.`8' 8 8888 ,8' `8 `8.`8888. - `8.` 8 8888 ,8' ` `8.`8888. -]] - --- define the colorscheme for nvim -return { - { - "norcalli/nvim-colorizer.lua", - event = "BufEnter", - opts = { "*" }, - }, - { - "folke/tokyonight.nvim", - opts = { - transparent = true, - style = "night", - styles = { - sidebars = "transparent", - floats = "transparent", - }, - }, - }, - { - "nvim-lualine/lualine.nvim", - opts = { - sections = { - lualine_z = {}, - }, - }, - }, - { - "folke/snacks.nvim", - opts = { - dashboard = { - preset = { - header = logo, - }, - sections = { - { section = "header" }, - { section = "keys", gap = 1, padding = 1 }, - { icon = "ο…› ", title = "Recent Files", cwd = true, section = "recent_files", indent = 2, padding = 1 }, - { icon = " ", title = "Projects", section = "projects", indent = 2, padding = 2 }, - { section = "startup" }, - }, - }, - }, - config = function(_, opts) - require("snacks").setup(opts) - - vim.api.nvim_set_hl(0, "SnacksDashboardHeader", { fg = "#FFA500" }) -- Orange Farbe - end, - }, -} From 1d68b235a6d06de1cd1ebbd114737aed4ba094ea Mon Sep 17 00:00:00 2001 From: fschuermeyer <25571323+fschuermeyer@users.noreply.github.com> Date: Sat, 28 Dec 2024 00:35:43 +0100 Subject: [PATCH 19/37] WIP: Move Lines Shortcuts - compatible for macos and linux --- lua/core/keymaps.lua | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/lua/core/keymaps.lua b/lua/core/keymaps.lua index c6817cc..7b94903 100644 --- a/lua/core/keymaps.lua +++ b/lua/core/keymaps.lua @@ -5,12 +5,19 @@ local setKey = vim.keymap.set setKey("n", "q", ":q", { desc = "Exit Nvim" }) -- Move Lines --- setKey("n", "", "m .-2==", { desc = "Move Up" }) --- setKey("n", "", "m .+1==", { desc = "Move Down" }) --- setKey("i", "", "m .+1==gi", { desc = "Move Down" }) --- setKey("i", "", "m .-2==gi", { desc = "Move Up" }) --- setKey("v", "", ":m '>+1gv=gv", { desc = "Move Down" }) --- setKey("v", "", ":m '<-2gv=gv", { desc = "Move Up" }) +local moveUp = { noremap = true, silent = true, desc = "Move the Line Up" } +local moveDown = { noremap = true, silent = true, desc = "Move the Line Down" } +local keyMapUp = "" +local keyMapDown = "" + +setKey("n", keyMapUp, "m .-2==", moveUp) +setKey("n", keyMapDown, "m .+1==", moveDown) + +setKey("i", keyMapUp, "m .-2==gi", moveUp) +setKey("i", keyMapDown, "m .+1==gi", moveDown) + +setKey("v", keyMapUp, ":m '<-2gv=gv", moveUp) +setKey("v", keyMapDown, ":m '>+1gv=gv", moveDown) -- Diffview setKey("n", "gf", "DiffviewFileHistory %", { desc = "Diffview Current File" }) From 6dd72115460fc90ac9efd382f9d078a29b65fccc Mon Sep 17 00:00:00 2001 From: fschuermeyer <25571323+fschuermeyer@users.noreply.github.com> Date: Sat, 28 Dec 2024 15:36:11 +0100 Subject: [PATCH 20/37] WIP: Adding CMP, Mason / Format on Save --- lazy-lock.json | 18 ++++- lua/core/lazy.lua | 41 +++++----- lua/plugins/lsp/lspconfig.lua | 140 ++++++++++++++++++++++++++++++++++ lua/plugins/lsp/mason.lua | 88 +++++++++++++++++++++ lua/plugins/nvim-cmp.lua | 71 +++++++++++++++++ 5 files changed, 336 insertions(+), 22 deletions(-) create mode 100644 lua/plugins/lsp/lspconfig.lua create mode 100644 lua/plugins/nvim-cmp.lua diff --git a/lazy-lock.json b/lazy-lock.json index ea85512..a3e0324 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,18 +1,32 @@ { + "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, "alternate-toggler": { "branch": "main", "commit": "819800304d3e8e575fd6aa461a8bcf2217e1cfb6" }, "bigfile.nvim": { "branch": "main", "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" }, + "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, + "lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" }, "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "c6c686781f9841d855bf1b926e10aa5e19430a38" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "mini.ai": { "branch": "main", "commit": "40e380a589d07ec2c856940c6422aafe5d949a0d" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" }, + "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, "noice.nvim": { "branch": "main", "commit": "eaed6cc9c06aa2013b5255349e4f26a6b17ab70f" }, "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" }, + "nvim-cmp": { "branch": "main", "commit": "b555203ce4bd7ff6192e759af3362f9d217e8c89" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-notify": { "branch": "master", "commit": "29b33efc802a304b1cf13ab200915d4e9e67373d" }, - "nvim-treesitter": { "branch": "master", "commit": "eb3e850acff4d9f2f2dd8dacd75353043c899753" }, + "nvim-lsp-file-operations": { "branch": "master", "commit": "9744b738183a5adca0f916527922078a965515ed" }, + "nvim-lspconfig": { "branch": "master", "commit": "57154fd9a24e76907e3b0bdba4677ef42c88d91c" }, + "nvim-notify": { "branch": "master", "commit": "1e99f4f9534ecf3b84eb7ef54a8d460230e78442" }, + "nvim-treesitter": { "branch": "master", "commit": "5d18ef22dc63624e90aa7b6dbc17f2c3856ae716" }, "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" }, "nvim-web-devicons": { "branch": "master", "commit": "63f552a7f59badc6e6b6d22e603150f0d5abebb7" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, diff --git a/lua/core/lazy.lua b/lua/core/lazy.lua index 0750c56..d910984 100644 --- a/lua/core/lazy.lua +++ b/lua/core/lazy.lua @@ -1,29 +1,30 @@ -- Bootstrap lazy.nvim local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 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 + 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(lazypath) -- Setup lazy.nvim require("lazy").setup({ - spec = { - -- import your plugins - { import = "plugins" }, - }, - -- Configure any other settings here. See the documentation for more details. - -- colorscheme that will be used when installing plugins. - install = { colorscheme = { "habamax" } }, - -- automatically check for plugin updates - checker = { enabled = true }, + spec = { + -- import your plugins + { import = "plugins" }, + { import = "plugins.lsp" } + }, + -- Configure any other settings here. See the documentation for more details. + -- colorscheme that will be used when installing plugins. + install = { colorscheme = { "habamax" } }, + -- automatically check for plugin updates + checker = { enabled = true }, }) diff --git a/lua/plugins/lsp/lspconfig.lua b/lua/plugins/lsp/lspconfig.lua new file mode 100644 index 0000000..4452aa2 --- /dev/null +++ b/lua/plugins/lsp/lspconfig.lua @@ -0,0 +1,140 @@ +return { + "neovim/nvim-lspconfig", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + "hrsh7th/cmp-nvim-lsp", + { "antosha417/nvim-lsp-file-operations", config = true }, + { "folke/neodev.nvim", opts = {} }, + }, + config = function() + -- import lspconfig plugin + local lspconfig = require("lspconfig") + + -- import mason_lspconfig plugin + local mason_lspconfig = require("mason-lspconfig") + + -- import cmp-nvim-lsp plugin + local cmp_nvim_lsp = require("cmp_nvim_lsp") + + + local keymap = vim.keymap -- for conciseness + + vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("UserLspConfig", {}), + callback = function(ev) + -- Buffer local mappings. + -- See `:help vim.lsp.*` for documentation on any of the below functions + local opts = { buffer = ev.buf, silent = true } + + -- set keybinds + opts.desc = "Show references" + keymap.set("n", "gr", "Telescope lsp_references", opts) -- show definition, references + + opts.desc = "Go to declaration" + keymap.set("n", "gD", vim.lsp.buf.declaration, opts) -- go to declaration + + opts.desc = "Show definitions" + keymap.set("n", "gd", "Telescope lsp_definitions", opts) -- show lsp definitions + + opts.desc = "Show implementations" + keymap.set("n", "gi", "Telescope lsp_implementations", opts) -- show lsp implementations + + opts.desc = "Show type definitions" + keymap.set("n", "gt", "Telescope lsp_type_definitions", opts) -- show lsp type definitions + + opts.desc = "See available code actions" + keymap.set({ "n", "v" }, "ca", vim.lsp.buf.code_action, opts) -- see available code actions, in visual mode will apply to selection + + opts.desc = "Smart rename" + keymap.set("n", "rn", vim.lsp.buf.rename, opts) -- smart rename + + opts.desc = "Show buffer diagnostics" + keymap.set("n", "D", "Telescope diagnostics bufnr=0", opts) -- show diagnostics for file + + opts.desc = "Show line diagnostics" + keymap.set("n", "d", vim.diagnostic.open_float, opts) -- show diagnostics for line + + opts.desc = "Go to previous diagnostic" + keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) -- jump to previous diagnostic in buffer + + opts.desc = "Go to next diagnostic" + keymap.set("n", "]d", vim.diagnostic.goto_next, opts) -- jump to next diagnostic in buffer + + opts.desc = "Show documentation for what is under cursor" + keymap.set("n", "K", vim.lsp.buf.hover, opts) -- show documentation for what is under cursor + + opts.desc = "Restart LSP" + keymap.set("n", "rs", ":LspRestart", opts) -- mapping to restart lsp if necessary + end, + }) + + -- used to enable autocompletion (assign to every lsp server config) + local capabilities = cmp_nvim_lsp.default_capabilities() + + -- Change the Diagnostic symbols in the sign column (gutter) + -- (not in youtube nvim video) + local signs = { Error = " ", Warn = " ", Hint = "σ°   ", Info = " " } + for type, icon in pairs(signs) do + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) + end + + -- Format on Save + local on_attach = function(client, bufnr) + if client.server_capabilities.documentFormattingProvider then + vim.api.nvim_create_autocmd("BufWritePre", { + group = vim.api.nvim_create_augroup("LspFormatting", { clear = true }), + buffer = bufnr, + callback = function() + vim.lsp.buf.format({ async = false }) + end, + }) + end + end + + mason_lspconfig.setup_handlers({ + -- default handler for installed servers + function(server_name) + lspconfig[server_name].setup({ + capabilities = capabilities, + on_attach = on_attach, + }) + end, + ["emmet_ls"] = function() + -- configure emmet language server + lspconfig["emmet_ls"].setup({ + capabilities = capabilities, + on_attach = on_attach, + filetypes = { + "html", + "typescriptreact", + "javascriptreact", + "css", + "sass", + "scss", + "less", + "svelte", + }, + }) + end, + ["lua_ls"] = function() + -- configure lua server (with special settings) + lspconfig["lua_ls"].setup({ + capabilities = capabilities, + on_attach = on_attach, + settings = { + Lua = { + -- make the language server recognize "vim" global + diagnostics = { + globals = { "vim" }, + }, + completion = { + callSnippet = "Replace", + }, + }, + }, + }) + end, + }) + end, +} diff --git a/lua/plugins/lsp/mason.lua b/lua/plugins/lsp/mason.lua index e69de29..821cca9 100644 --- a/lua/plugins/lsp/mason.lua +++ b/lua/plugins/lsp/mason.lua @@ -0,0 +1,88 @@ +return { + "williamboman/mason.nvim", + dependencies = { + "williamboman/mason-lspconfig.nvim", + "WhoIsSethDaniel/mason-tool-installer.nvim", + }, + config = function() + -- import mason + local mason = require("mason") + -- import mason-lspconfig + local mason_lspconfig = require("mason-lspconfig") + + local mason_tool_installer = require("mason-tool-installer") + + -- enable mason and configure icons + mason.setup({ + ui = { + icons = { + package_installed = "βœ“", + package_pending = "➜", + package_uninstalled = "βœ—", + }, + }, + }) + + mason_lspconfig.setup({ + automatic_installation = true, + -- list of servers for mason to install + ensure_installed = { + "bashls", -- Bash language support + "cssls", -- CSS language support + "css_variables", -- CSS Variables support + "docker_compose_language_service", -- Docker Compose language support + "dockerls", -- Dockerfile language support + "emmet_ls", -- Emmet language support + "eslint", -- ESLint language support + "gopls", -- Go language server + "groovyls", -- Groovy language support + "hls", -- Haskell language server + "html", -- HTML language support + "intelephense", -- PHP language support + "jedi_language_server", -- Python language server + "jsonls", -- JSON language support + "kotlin_language_server", -- Kotlin language support + "lua_ls", -- Lua language server + "pyright", -- Python language server + "tailwindcss", -- Tailwind CSS language support + "ts_ls", -- TypeScript language support + "yamlls", -- YAML language support + "vtsls", -- Vue and TypeScript support + "volar", -- Vue.js language support + "stimulus_ls", -- Stimulus language support + }, + }) + + mason_tool_installer.setup({ + ensure_installed = { + "autoflake", -- Python tool + "debugpy", -- Python debugger + "delve", -- Go debugger + "eslint_d", -- Faster ESLint + "gofumpt", -- Go formatter + "goimports", -- Go imports formatter + "golangci-lint-langserver", -- Go linter + "hadolint", -- Dockerfile linter + "haskell-debug-adapter", -- Haskell debugger + "isort", -- Python import sorter + "markdownlint-cli2", -- Markdown linter + "marksman", -- Markdown language server + "php-cs-fixer", -- PHP formatter + "php-debug-adapter", -- PHP debugger + "phpactor", -- PHP language server + "phpcs", -- PHP linter + "prettier", -- Code formatter + "ruff", -- Python linter + "shfmt", -- Shell formatter + "sqlfluff", -- SQL formatter and linter + "stylua", -- Lua formatter + "taplo", -- TOML language server + "markdown-toc", -- Markdown TOC generator + "shellcheck", -- Shell script analysis + "shfmt", -- Shell script formatter + "ruff-lsp", -- Python linter support + "js-debug-adapter", -- JavaScript debug adapter + }, + }) + end, +} diff --git a/lua/plugins/nvim-cmp.lua b/lua/plugins/nvim-cmp.lua new file mode 100644 index 0000000..efc2b25 --- /dev/null +++ b/lua/plugins/nvim-cmp.lua @@ -0,0 +1,71 @@ +return { + "hrsh7th/nvim-cmp", + event = "InsertEnter", + dependencies = { + "hrsh7th/cmp-buffer", -- source for text in buffer + "hrsh7th/cmp-path", -- source for file system paths + { + "L3MON4D3/LuaSnip", + -- follow latest release. + version = "v2.*", -- Replace by the latest released major (first number of latest release) + -- install jsregexp (optional!). + build = "make install_jsregexp", + }, + "saadparwaiz1/cmp_luasnip", -- for autocompletion + "rafamadriz/friendly-snippets", -- useful snippets + "onsails/lspkind.nvim", -- vs-code like pictograms + }, + config = function() + local cmp = require("cmp") + + local luasnip = require("luasnip") + -- loads vscode style snippets from installed plugins (e.g. friendly-snippets) + require("luasnip.loaders.from_vscode").lazy_load() + + cmp.setup({ + window = { + completion = { + border = "rounded", + winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None", + col_offset = -3, + side_padding = 0, + }, + }, + completion = { + completeopt = "menu,menuone,preview,noselect", + }, + snippet = { -- configure how nvim-cmp interacts with snippet engine + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.select_prev_item(), -- previous suggestion + [""] = cmp.mapping.select_next_item(), -- next suggestion + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), -- show completion suggestions + [""] = cmp.mapping.abort(), -- close completion window + [""] = cmp.mapping.confirm({ select = false }), + }), + -- sources for autocompletion + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, -- snippets + { name = "path" }, -- file system paths + { name = "buffer" }, -- text within current buffer + }), + formatting = { + fields = { "kind", "abbr", "menu" }, + format = function(entry, vim_item) + local kind = require("lspkind").cmp_format({ mode = "symbol_text", maxwidth = 50 })(entry, vim_item) + local strings = vim.split(kind.kind, "%s", { trimempty = true }) + kind.kind = " " .. (strings[1] or "") .. " " + kind.menu = " (" .. (strings[2] or "") .. ")" + + return kind + end, + }, + }) + end, +} From cacaf656a879c5435e985fddbc26de49f7ae02bc Mon Sep 17 00:00:00 2001 From: fschuermeyer <25571323+fschuermeyer@users.noreply.github.com> Date: Sat, 28 Dec 2024 15:44:02 +0100 Subject: [PATCH 21/37] WIP: Adding Stylelint Settings --- lua/plugins/lsp/lspconfig.lua | 12 ++++++++++++ lua/plugins/lsp/mason.lua | 1 + 2 files changed, 13 insertions(+) diff --git a/lua/plugins/lsp/lspconfig.lua b/lua/plugins/lsp/lspconfig.lua index 4452aa2..a69fb44 100644 --- a/lua/plugins/lsp/lspconfig.lua +++ b/lua/plugins/lsp/lspconfig.lua @@ -135,6 +135,18 @@ return { }, }) end, + ["stylelint-lsp"] = function() + lspconfig["stylelint-lsp"].setup({ + capabilities = capabilities, + on_attach = on_attach, + settings = { + stylelintplus = { + autoFixOnFormat = true + } + }, + filetypes = { "css", "less", "scss", "sugarss", "vue", "wxss", "sass" } + }) + end, }) end, } diff --git a/lua/plugins/lsp/mason.lua b/lua/plugins/lsp/mason.lua index 821cca9..b35585d 100644 --- a/lua/plugins/lsp/mason.lua +++ b/lua/plugins/lsp/mason.lua @@ -50,6 +50,7 @@ return { "vtsls", -- Vue and TypeScript support "volar", -- Vue.js language support "stimulus_ls", -- Stimulus language support + "stylelint_lsp" -- Stylint LSP }, }) From e5df083ba6094ef545808432470975fca9a612fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCrmeyer?= <25571323+fschuermeyer@users.noreply.github.com> Date: Sat, 28 Dec 2024 16:13:26 +0100 Subject: [PATCH 22/37] WIP: fix stylelint --- lua/plugins/lsp/lspconfig.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/plugins/lsp/lspconfig.lua b/lua/plugins/lsp/lspconfig.lua index a69fb44..a4952b0 100644 --- a/lua/plugins/lsp/lspconfig.lua +++ b/lua/plugins/lsp/lspconfig.lua @@ -92,6 +92,7 @@ return { end end + mason_lspconfig.setup_handlers({ -- default handler for installed servers function(server_name) @@ -135,8 +136,8 @@ return { }, }) end, - ["stylelint-lsp"] = function() - lspconfig["stylelint-lsp"].setup({ + ["stylelint_lsp"] = function() + lspconfig["stylelint_lsp"].setup({ capabilities = capabilities, on_attach = on_attach, settings = { From 40025596d4cf203ba08868d06a629f0973a60b23 Mon Sep 17 00:00:00 2001 From: fschuermeyer <25571323+fschuermeyer@users.noreply.github.com> Date: Sat, 28 Dec 2024 17:00:15 +0100 Subject: [PATCH 23/37] WIP: Adding Bufferline --- lazy-lock.json | 1 + lua/plugins/bufferline.lua | 16 ++++++++++++++++ lua/plugins/lsp/lspconfig.lua | 1 - 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 lua/plugins/bufferline.lua diff --git a/lazy-lock.json b/lazy-lock.json index a3e0324..7024c4a 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -2,6 +2,7 @@ "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, "alternate-toggler": { "branch": "main", "commit": "819800304d3e8e575fd6aa461a8bcf2217e1cfb6" }, "bigfile.nvim": { "branch": "main", "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" }, + "bufferline.nvim": { "branch": "main", "commit": "261a72b90d6db4ed8014f7bda976bcdc9dd7ce76" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, diff --git a/lua/plugins/bufferline.lua b/lua/plugins/bufferline.lua new file mode 100644 index 0000000..21e491c --- /dev/null +++ b/lua/plugins/bufferline.lua @@ -0,0 +1,16 @@ +return { + 'akinsho/bufferline.nvim', + dependencies = 'nvim-tree/nvim-web-devicons', + event = "VeryLazy", + keys = { + { "bp", "BufferLineTogglePin", desc = "Toggle Pin" }, + { "bP", "BufferLineGroupClose ungrouped", desc = "Delete Non-Pinned Buffers" }, + { "br", "BufferLineCloseRight", desc = "Delete Buffers to the Right" }, + { "bl", "BufferLineCloseLeft", desc = "Delete Buffers to the Left" }, + { "", "BufferLineCyclePrev", desc = "Prev Buffer" }, + { "", "BufferLineCycleNext", desc = "Next Buffer" }, + }, + config = function() + require("bufferline").setup() + end +} diff --git a/lua/plugins/lsp/lspconfig.lua b/lua/plugins/lsp/lspconfig.lua index a4952b0..290119e 100644 --- a/lua/plugins/lsp/lspconfig.lua +++ b/lua/plugins/lsp/lspconfig.lua @@ -92,7 +92,6 @@ return { end end - mason_lspconfig.setup_handlers({ -- default handler for installed servers function(server_name) From 23258cc2bbed36609125f1955dc085873175905a Mon Sep 17 00:00:00 2001 From: fschuermeyer <25571323+fschuermeyer@users.noreply.github.com> Date: Sat, 28 Dec 2024 17:40:26 +0100 Subject: [PATCH 24/37] WIP: Adding Copilot Autocompletion, Bufferline Settings, Addtional Keymaps --- lazy-lock.json | 2 ++ lua/core/keymaps.lua | 6 ++++++ lua/plugins/bufferline.lua | 1 + lua/plugins/copilot.lua | 28 ++++++++++++++++++++++++++++ lua/plugins/nvim-cmp.lua | 22 +++++++++++++++++++++- 5 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 lua/plugins/copilot.lua diff --git a/lazy-lock.json b/lazy-lock.json index 7024c4a..76b38c1 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -7,6 +7,8 @@ "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "copilot-cmp": { "branch": "master", "commit": "15fc12af3d0109fa76b60b5cffa1373697e261d1" }, + "copilot.lua": { "branch": "master", "commit": "886ee73b6d464b2b3e3e6a7ff55ce87feac423a9" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" }, "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, diff --git a/lua/core/keymaps.lua b/lua/core/keymaps.lua index 7b94903..911bad1 100644 --- a/lua/core/keymaps.lua +++ b/lua/core/keymaps.lua @@ -35,3 +35,9 @@ setKey("n", "i", "ToggleAlternate", { desc = "Toggle State" }) -- VimGo setKey("n", "tg", "GoTestFunc", { desc = "Test Golang" }) + +-- Center after Scroll +setKey("n", "", "zz", { desc = "Center after Scroll" }) +setKey("n", "", "zz", { desc = "Center after Scroll" }) +setKey("n", "", "zz", { desc = "Center after Scroll" }) +setKey("n", "", "zz", { desc = "Center after Scroll" }) diff --git a/lua/plugins/bufferline.lua b/lua/plugins/bufferline.lua index 21e491c..d59c0f8 100644 --- a/lua/plugins/bufferline.lua +++ b/lua/plugins/bufferline.lua @@ -7,6 +7,7 @@ return { { "bP", "BufferLineGroupClose ungrouped", desc = "Delete Non-Pinned Buffers" }, { "br", "BufferLineCloseRight", desc = "Delete Buffers to the Right" }, { "bl", "BufferLineCloseLeft", desc = "Delete Buffers to the Left" }, + { "bs", "Telescope buffers", desc = "Search Buffer" }, { "", "BufferLineCyclePrev", desc = "Prev Buffer" }, { "", "BufferLineCycleNext", desc = "Next Buffer" }, }, diff --git a/lua/plugins/copilot.lua b/lua/plugins/copilot.lua new file mode 100644 index 0000000..69842c7 --- /dev/null +++ b/lua/plugins/copilot.lua @@ -0,0 +1,28 @@ +return { + { + "zbirenbaum/copilot.lua", + cmd = "Copilot", + build = ":Copilot auth", + event = "InsertEnter", + config = function() + require("copilot").setup({ + suggestion = { + enabled = true, + auto_trigger = true, + keymap = { + accept = false, + next = false, + prev = false, + }, + }, + panel = { enabled = false }, + }) + end, + }, + { + "zbirenbaum/copilot-cmp", + config = function() + require("copilot_cmp").setup() + end + }, +} diff --git a/lua/plugins/nvim-cmp.lua b/lua/plugins/nvim-cmp.lua index efc2b25..dfc4898 100644 --- a/lua/plugins/nvim-cmp.lua +++ b/lua/plugins/nvim-cmp.lua @@ -14,6 +14,23 @@ return { "saadparwaiz1/cmp_luasnip", -- for autocompletion "rafamadriz/friendly-snippets", -- useful snippets "onsails/lspkind.nvim", -- vs-code like pictograms + { + "zbirenbaum/copilot-cmp", + opts = {}, + config = function(_, opts) + local copilot_cmp = require("copilot_cmp") + copilot_cmp.setup(opts) + + local lspkind = require("lspkind") + lspkind.init({ + symbol_map = { + Copilot = "ο„“", + }, + }) + + vim.api.nvim_set_hl(0, "CmpItemKindCopilot", { fg = "#CA2222" }) + end, + }, }, config = function() local cmp = require("cmp") @@ -22,6 +39,8 @@ return { -- loads vscode style snippets from installed plugins (e.g. friendly-snippets) require("luasnip.loaders.from_vscode").lazy_load() + + cmp.setup({ window = { completion = { @@ -32,7 +51,7 @@ return { }, }, completion = { - completeopt = "menu,menuone,preview,noselect", + completeopt = "menu,menuone,preview,noinsert", }, snippet = { -- configure how nvim-cmp interacts with snippet engine expand = function(args) @@ -50,6 +69,7 @@ return { }), -- sources for autocompletion sources = cmp.config.sources({ + { name = "copilot" }, { name = "nvim_lsp" }, { name = "luasnip" }, -- snippets { name = "path" }, -- file system paths From 04fc9ee603977961bc142b538637c8dd0e092051 Mon Sep 17 00:00:00 2001 From: fschuermeyer <25571323+fschuermeyer@users.noreply.github.com> Date: Sat, 28 Dec 2024 17:52:17 +0100 Subject: [PATCH 25/37] WIP: Adding Rename Keymaps --- lua/plugins/folke-snacks.lua | 105 +++++++++++++++++----------------- lua/plugins/lsp/lspconfig.lua | 4 +- 2 files changed, 55 insertions(+), 54 deletions(-) diff --git a/lua/plugins/folke-snacks.lua b/lua/plugins/folke-snacks.lua index 39afbb8..2eab04d 100644 --- a/lua/plugins/folke-snacks.lua +++ b/lua/plugins/folke-snacks.lua @@ -1,61 +1,62 @@ local logo = [[ -`8.`888b ,8' 8 8888 ,8. ,8. - `8.`888b ,8' 8 8888 ,888. ,888. - `8.`888b ,8' 8 8888 .`8888. .`8888. - `8.`888b ,8' 8 8888 ,8.`8888. ,8.`8888. - `8.`888b ,8' 8 8888 ,8'8.`8888,8^8.`8888. - `8.`888b ,8' 8 8888 ,8' `8.`8888' `8.`8888. - `8.`888b8' 8 8888 ,8' `8.`88' `8.`8888. - `8.`888' 8 8888 ,8' `8.`' `8.`8888. - `8.`8' 8 8888 ,8' `8 `8.`8888. - `8.` 8 8888 ,8' ` `8.`8888. +`8.`888b ,8' 8 8888 ,8. ,8. + `8.`888b ,8' 8 8888 ,888. ,888. + `8.`888b ,8' 8 8888 .`8888. .`8888. + `8.`888b ,8' 8 8888 ,8.`8888. ,8.`8888. + `8.`888b ,8' 8 8888 ,8'8.`8888,8^8.`8888. + `8.`888b ,8' 8 8888 ,8' `8.`8888' `8.`8888. + `8.`888b8' 8 8888 ,8' `8.`88' `8.`8888. + `8.`888' 8 8888 ,8' `8.`' `8.`8888. + `8.`8' 8 8888 ,8' `8 `8.`8888. + `8.` 8 8888 ,8' ` `8.`8888. github.com/fschuermeyer/nvim-setup ]] return { - "folke/snacks.nvim", - lazy = false, - opts = { - dashboard = { - preset = { - header = logo, - }, - sections = { - { section = "header" }, - { section = "keys", gap = 1, padding = 1 }, - { - icon = "ο…› ", - title = "Recent Files", - cwd = true, - section = "recent_files", - indent = 2, - padding = 1, - }, - { icon = " ", title = "Projects", section = "projects", indent = 2, padding = 2 }, - { section = "startup" }, - }, - }, - indent = { - enabled = true, - animate = { - duration = { - step = 5, - total = 250, - }, - }, - }, - scope = { enabled = true }, - scroll = { enabled = true }, - }, - config = function(_, opts) - require("snacks").setup(opts) + "folke/snacks.nvim", + lazy = false, + opts = { + dashboard = { + preset = { + header = logo, + }, + sections = { + { section = "header" }, + { section = "keys", gap = 1, padding = 1 }, + { + icon = "ο…› ", + title = "Recent Files", + cwd = true, + section = "recent_files", + indent = 2, + padding = 1, + }, + { icon = " ", title = "Projects", section = "projects", indent = 2, padding = 2 }, + { section = "startup" }, + }, + }, + indent = { + enabled = true, + animate = { + duration = { + step = 5, + total = 250, + }, + }, + }, + scope = { enabled = true }, + scroll = { enabled = true }, + }, + config = function(_, opts) + require("snacks").setup(opts) - vim.api.nvim_set_hl(0, "SnacksDashboardHeader", { fg = "#FFA500" }) -- Orange Farbe + vim.api.nvim_set_hl(0, "SnacksDashboardHeader", { fg = "#FFA500" }) -- Orange Farbe + vim.keymap.set("n", "cR", Snacks.rename.rename_file, { desc = "Rename File" }) - Snacks.toggle.option("wrap", { name = "Line Wrap" }):map("uw") - Snacks.toggle.option("number", { name = "Line Numbers" }):map("un") - Snacks.toggle.option("relativenumber", { name = "Relative Line Numbers" }):map("ur") - Snacks.toggle.option("cursorline", { name = "Cursorline" }):map("uc") - end, + Snacks.toggle.option("wrap", { name = "Line Wrap" }):map("uw") + Snacks.toggle.option("number", { name = "Line Numbers" }):map("un") + Snacks.toggle.option("relativenumber", { name = "Relative Line Numbers" }):map("ur") + Snacks.toggle.option("cursorline", { name = "Cursorline" }):map("uc") + end, } diff --git a/lua/plugins/lsp/lspconfig.lua b/lua/plugins/lsp/lspconfig.lua index 290119e..f57414b 100644 --- a/lua/plugins/lsp/lspconfig.lua +++ b/lua/plugins/lsp/lspconfig.lua @@ -45,8 +45,8 @@ return { opts.desc = "See available code actions" keymap.set({ "n", "v" }, "ca", vim.lsp.buf.code_action, opts) -- see available code actions, in visual mode will apply to selection - opts.desc = "Smart rename" - keymap.set("n", "rn", vim.lsp.buf.rename, opts) -- smart rename + opts.desc = "Rename" + keymap.set("n", "cr", vim.lsp.buf.rename, opts) -- smart rename opts.desc = "Show buffer diagnostics" keymap.set("n", "D", "Telescope diagnostics bufnr=0", opts) -- show diagnostics for file From aa9d2b66ad6b39bd0952f6ac6957f6daa29a4efb Mon Sep 17 00:00:00 2001 From: fschuermeyer <25571323+fschuermeyer@users.noreply.github.com> Date: Sat, 28 Dec 2024 18:08:53 +0100 Subject: [PATCH 26/37] WIP: Add Refactoring Code Actions --- lazy-lock.json | 5 +- lua/plugins/refactoring.lua | 19 ++++++ lua/plugins/telescope.lua | 111 +++++++++++++++++++----------------- 3 files changed, 79 insertions(+), 56 deletions(-) create mode 100644 lua/plugins/refactoring.lua diff --git a/lazy-lock.json b/lazy-lock.json index 76b38c1..f5c8b24 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -33,11 +33,8 @@ "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" }, "nvim-web-devicons": { "branch": "master", "commit": "63f552a7f59badc6e6b6d22e603150f0d5abebb7" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, - "ripgrep": { "branch": "master", "commit": "79cbe89deb1151e703f4d91b19af9cdcc128b765" }, + "refactoring.nvim": { "branch": "master", "commit": "2db6d378e873de31d18ade549c2edba64ff1c2e3" }, "snacks.nvim": { "branch": "main", "commit": "98df370703b3c47a297988f3e55ce99628639590" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" }, - "telescope-themes": { "branch": "main", "commit": "9b7c368b83b82b53c0a6e9e977f8329e5f1fe269" }, - "telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" }, "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, "tokyonight.nvim": { "branch": "main", "commit": "45d22cf0e1b93476d3b6d362d720412b3d34465c" }, "vim-go": { "branch": "master", "commit": "6adc82bfef7f9a4b0db78065ae51b8ebb145c355" }, diff --git a/lua/plugins/refactoring.lua b/lua/plugins/refactoring.lua new file mode 100644 index 0000000..4633ff2 --- /dev/null +++ b/lua/plugins/refactoring.lua @@ -0,0 +1,19 @@ +return { + "ThePrimeagen/refactoring.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + }, + lazy = false, + config = function() + local promptLanguage = { + go = true, + java = true, + } + + require("refactoring").setup({ + prompt_func_return_type = promptLanguage, + prompt_func_param_type = promptLanguage, + }) + end, +} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 24dc2a7..2654e63 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -1,60 +1,67 @@ return { - "nvim-telescope/telescope.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, - "nvim-tree/nvim-web-devicons", - "folke/todo-comments.nvim", - "BurntSushi/ripgrep", - "andrew-george/telescope-themes", - }, - config = function() - local telescope = require("telescope") - local actions = require("telescope.actions") - local layout = require("telescope.actions.layout") + "nvim-telescope/telescope.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, + "nvim-tree/nvim-web-devicons", + "folke/todo-comments.nvim", + "BurntSushi/ripgrep", + "andrew-george/telescope-themes", + "ThePrimeagen/refactoring.nvim", + }, + config = function() + local telescope = require("telescope") + local actions = require("telescope.actions") + local layout = require("telescope.actions.layout") - telescope.setup({ - defaults = { - path_display = { "truncate" }, - mappings = { - i = { - [""] = actions.move_selection_previous, -- move to prev result - [""] = actions.move_selection_next, -- move to next result - [""] = layout.toggle_preview, -- toggle preview - }, - }, - }, - }) + telescope.setup({ + defaults = { + path_display = { "truncate" }, + mappings = { + i = { + [""] = actions.move_selection_previous, -- move to prev result + [""] = actions.move_selection_next, -- move to next result + [""] = layout.toggle_preview, -- toggle preview + }, + }, + }, + }) - telescope.load_extension("fzf") - telescope.load_extension("themes") + telescope.load_extension("fzf") + telescope.load_extension("themes") + telescope.load_extension("refactoring") - -- set keymaps - local keymap = vim.keymap -- for conciseness - keymap.set( - "n", - "", - "Telescope find_files sort_mru=true", - { desc = "Find Files (Root Dir)" } - ) - keymap.set("n", ":", "Telescope command_history", { desc = "Command History" }) - keymap.set( - "n", - "fb", - "Telescope buffers sort_mru=true sort_lastused=true ignore_current_buffer=true", - { desc = "Buffers" } - ) + -- set keymaps + local keymap = vim.keymap -- for conciseness + keymap.set( + "n", + "", + "Telescope find_files sort_mru=true", + { desc = "Find Files (Root Dir)" } + ) + keymap.set("n", ":", "Telescope command_history", { desc = "Command History" }) + keymap.set( + "n", + "fb", + "Telescope buffers sort_mru=true sort_lastused=true ignore_current_buffer=true", + { desc = "Buffers" } + ) - keymap.set("n", "fg", "Telescope live_grep", { desc = "Find Grep" }) - keymap.set("n", "fr", "Telescope oldfiles", { desc = "Find Recent" }) - keymap.set("n", "ft", "TodoTelescope", { desc = "Find TODOs" }) + keymap.set("n", "fg", "Telescope live_grep", { desc = "Find Grep" }) + keymap.set("n", "fr", "Telescope oldfiles", { desc = "Find Recent" }) + keymap.set("n", "ft", "TodoTelescope", { desc = "Find TODOs" }) - -- git - keymap.set("n", "gs", "Telescope git_status", { desc = "Git Status" }) - keymap.set("n", "gc", "Telescope git_commits", { desc = "Git Commits" }) - keymap.set("n", "gb", "Telescope git_branches", { desc = "Git Branches" }) + -- git + keymap.set("n", "gs", "Telescope git_status", { desc = "Git Status" }) + keymap.set("n", "gc", "Telescope git_commits", { desc = "Git Commits" }) + keymap.set("n", "gb", "Telescope git_branches", { desc = "Git Branches" }) - -- ui - keymap.set("n", "ut", "Telescope themes", { desc = "UI Themes" }) - end, + -- code action + keymap.set({ "n", "x" }, "cf", function() + require('telescope').extensions.refactoring.refactors() + end, { desc = "Refactoring Actions" }) + + -- ui + keymap.set("n", "ut", "Telescope themes", { desc = "UI Themes" }) + end, } From 7ac1d133857c45c0c2b23d96f782125d2004c4d2 Mon Sep 17 00:00:00 2001 From: fschuermeyer <25571323+fschuermeyer@users.noreply.github.com> Date: Sat, 28 Dec 2024 19:01:45 +0100 Subject: [PATCH 27/37] WIP: Adding LSP Clients Floating Window --- init.lua | 1 + lua/core/keymaps.lua | 2 - lua/core/lspinfo.lua | 93 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 94 insertions(+), 2 deletions(-) create mode 100644 lua/core/lspinfo.lua diff --git a/init.lua b/init.lua index c3f3781..d1bd2f9 100644 --- a/init.lua +++ b/init.lua @@ -3,3 +3,4 @@ require("core.keymaps") require("core.provider") require("core.autocmd") require("core.lazy") +require("core.lspinfo") diff --git a/lua/core/keymaps.lua b/lua/core/keymaps.lua index 911bad1..f620e80 100644 --- a/lua/core/keymaps.lua +++ b/lua/core/keymaps.lua @@ -39,5 +39,3 @@ setKey("n", "tg", "GoTestFunc", { desc = "Test Golang" }) -- Center after Scroll setKey("n", "", "zz", { desc = "Center after Scroll" }) setKey("n", "", "zz", { desc = "Center after Scroll" }) -setKey("n", "", "zz", { desc = "Center after Scroll" }) -setKey("n", "", "zz", { desc = "Center after Scroll" }) diff --git a/lua/core/lspinfo.lua b/lua/core/lspinfo.lua new file mode 100644 index 0000000..d3f034d --- /dev/null +++ b/lua/core/lspinfo.lua @@ -0,0 +1,93 @@ +local state = { + floating = { + buf = -1, + win = -1, + } +} + +local function create_floating_window(opts) + opts = opts or {} + local width = opts.width or math.floor(vim.o.columns * 0.2) + local height = opts.height or math.floor(vim.o.lines * 0.2) + + -- Calculate the position to center the window + local col = math.floor((vim.o.columns - width) / 2) + local row = math.floor((vim.o.lines - height) / 2) + + -- Create a buffer + local buf = nil + if vim.api.nvim_buf_is_valid(opts.buf) then + buf = opts.buf + else + buf = vim.api.nvim_create_buf(false, true) -- No file, scratch buffer + end + + local win_config = { + relative = "editor", + width = width, + height = height, + col = col, + row = row, + style = "minimal", -- No borders or extra UI elements + border = "rounded", + } + + local win = vim.api.nvim_open_win(buf, true, win_config) + + return { buf = buf, win = win } +end + +local function highlight_dashed_lines(buf, lines) + for i, line in ipairs(lines) do + if line == "---" then + vim.api.nvim_buf_add_highlight(buf, -1, "diffIndexLine", i - 1, 0, -1) + end + end +end + +vim.api.nvim_set_hl(0, "BoldTitle", { bold = true, fg = "#4B5FEC" }) + +local function show_lsp_info_in_buffer(buf) + local clients = vim.lsp.get_clients() + local lines = {} + + if #clients == 0 then + table.insert(lines, "Keine aktiven LSP-Clients gefunden.") + else + table.insert(lines, "Aktive LSP-Clients:") + table.insert(lines, "---") + + for _, client in ipairs(clients) do + table.insert(lines, "Client-Name: " .. client.name) + table.insert(lines, "Server-ID: " .. client.id) + + table.insert(lines, "---") + end + end + + vim.api.nvim_buf_set_option(buf, "readonly", false) + vim.api.nvim_buf_set_option(buf, "modifiable", true) + + vim.api.nvim_buf_set_lines(buf, 0, -1, false, lines) + vim.api.nvim_buf_add_highlight(buf, -1, "BoldTitle", 0, 0, -1) + highlight_dashed_lines(buf, lines) + + vim.api.nvim_buf_set_option(buf, "readonly", true) + vim.api.nvim_buf_set_option(buf, "modifiable", false) + + vim.api.nvim_buf_set_keymap(buf, "n", "q", ":q", { noremap = true, silent = true }) +end + +local toggle_lsp_info = function() + if not vim.api.nvim_win_is_valid(state.floating.win) then + state.floating = create_floating_window { buf = state.floating.buf } + + show_lsp_info_in_buffer(state.floating.buf) + else + vim.api.nvim_win_hide(state.floating.win) + end +end + +vim.api.nvim_create_user_command("LspClients", toggle_lsp_info, {}) + +vim.keymap.set("n", "cl", ":LspClients", { noremap = true, silent = true, desc = "LSP Clients anzeigen" }) From 9b5aae7a093fb52929122eda699737a84d031705 Mon Sep 17 00:00:00 2001 From: fschuermeyer <25571323+fschuermeyer@users.noreply.github.com> Date: Sat, 28 Dec 2024 19:49:41 +0100 Subject: [PATCH 28/37] WIP: Adding Copilot Chat --- lazy-lock.json | 7 ++ lua/plugins/copilot.lua | 185 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 192 insertions(+) diff --git a/lazy-lock.json b/lazy-lock.json index f5c8b24..93eb4a6 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,4 +1,5 @@ { + "CopilotChat.nvim": { "branch": "main", "commit": "2ebe591cff06018e265263e71e1dbc4c5aa8281e" }, "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, "alternate-toggler": { "branch": "main", "commit": "819800304d3e8e575fd6aa461a8bcf2217e1cfb6" }, "bigfile.nvim": { "branch": "main", "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" }, @@ -9,8 +10,10 @@ "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "copilot-cmp": { "branch": "master", "commit": "15fc12af3d0109fa76b60b5cffa1373697e261d1" }, "copilot.lua": { "branch": "master", "commit": "886ee73b6d464b2b3e3e6a7ff55ce87feac423a9" }, + "copilot.vim": { "branch": "release", "commit": "61f11db27b691435590b684ed49cba5a691f1884" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" }, + "edgy.nvim": { "branch": "main", "commit": "7e8dedc39abebe40c289b8012cc89b11c69aa7a0" }, "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, @@ -34,7 +37,11 @@ "nvim-web-devicons": { "branch": "master", "commit": "63f552a7f59badc6e6b6d22e603150f0d5abebb7" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "refactoring.nvim": { "branch": "master", "commit": "2db6d378e873de31d18ade549c2edba64ff1c2e3" }, + "ripgrep": { "branch": "master", "commit": "79cbe89deb1151e703f4d91b19af9cdcc128b765" }, "snacks.nvim": { "branch": "main", "commit": "98df370703b3c47a297988f3e55ce99628639590" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" }, + "telescope-themes": { "branch": "main", "commit": "9b7c368b83b82b53c0a6e9e977f8329e5f1fe269" }, + "telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" }, "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, "tokyonight.nvim": { "branch": "main", "commit": "45d22cf0e1b93476d3b6d362d720412b3d34465c" }, "vim-go": { "branch": "master", "commit": "6adc82bfef7f9a4b0db78065ae51b8ebb145c355" }, diff --git a/lua/plugins/copilot.lua b/lua/plugins/copilot.lua index 69842c7..72f6ac8 100644 --- a/lua/plugins/copilot.lua +++ b/lua/plugins/copilot.lua @@ -1,3 +1,23 @@ +-- Some Parts from: https://github.com/jellydn/lazy-nvim-ide/blob/main/lua/plugins/extras/copilot-chat-v2.lua +local prompts = { + -- Code related prompts + Explain = "Please explain how the following code works.", + Review = "Please review the following code and provide suggestions for improvement.", + Tests = "Please explain how the selected code works, then generate unit tests for it.", + Refactor = "Please refactor the following code to improve its clarity and readability.", + FixCode = "Please fix the following code to make it work as intended.", + FixError = "Please explain the error in the following text and provide a solution.", + BetterNamings = "Please provide better names for the following variables and functions.", + Documentation = "Please provide documentation for the following code.", + SwaggerApiDocs = "Please provide documentation for the following API using Swagger.", + SwaggerJsDocs = "Please write JSDoc for the following API using Swagger.", + -- Text related prompts + Summarize = "Please summarize the following text.", + Spelling = "Please correct any grammar and spelling errors in the following text.", + Wording = "Please improve the grammar and wording of the following text.", + Concise = "Please rewrite the following text to make it more concise.", +} + return { { "zbirenbaum/copilot.lua", @@ -25,4 +45,169 @@ return { require("copilot_cmp").setup() end }, + -- Copilot Chat + { + "CopilotC-Nvim/CopilotChat.nvim", + -- version = "v3.3.0", -- Use a specific version to prevent breaking changes + dependencies = { + { "zbirenbaum/copilot.vim" }, -- or zbirenbaum/copilot.lua + { "nvim-telescope/telescope.nvim" }, -- Use telescope for help actions + { "nvim-lua/plenary.nvim" }, + }, + opts = { + question_header = " " .. (vim.env.GITHUB_USER or vim.env.USER or "User") .. " ", + answer_header = "ο’Έ Copilot ", + error_header = "## Error ", + prompts = prompts, + mappings = { + -- Use tab for completion + complete = { + detail = "Use @ or / for options.", + insert = "", + }, + -- Close the chat + close = { + normal = "q", + insert = "", + }, + -- Reset the chat buffer + reset = { + normal = "", + insert = "", + }, + -- Show help + show_help = { + normal = "g?", + }, + }, + window = { + layout = "vertical", + width = 0.4, + } + }, + config = function(_, opts) + local chat = require("CopilotChat") + chat.setup(opts) + + local select = require("CopilotChat.select") + vim.api.nvim_create_user_command("CopilotChatVisual", function(args) + chat.ask(args.args, { selection = select.visual }) + end, { nargs = "*", range = true }) + + -- Inline chat with Copilot + vim.api.nvim_create_user_command("CopilotChatInline", function(args) + chat.ask(args.args, { + selection = select.visual, + window = { + layout = "float", + relative = "cursor", + width = 1, + height = 0.4, + row = 1, + }, + }) + end, { nargs = "*", range = true }) + + -- Restore CopilotChatBuffer + vim.api.nvim_create_user_command("CopilotChatBuffer", function(args) + chat.ask(args.args, { selection = select.buffer }) + end, { nargs = "*", range = true }) + + -- Custom buffer for CopilotChat + vim.api.nvim_create_autocmd("BufEnter", { + pattern = "copilot-*", + callback = function() + vim.opt_local.relativenumber = true + vim.opt_local.number = true + + -- Get current filetype and set it to markdown if the current filetype is copilot-chat + local ft = vim.bo.filetype + if ft == "copilot-chat" then + vim.bo.filetype = "markdown" + + -- verschieben des Fensters nach Rechts + vim.cmd("wincmd r") + end + end, + }) + end, + event = "VeryLazy", + keys = { + { "a", "", desc = "+ai", mode = { "n", "v" } }, + -- Show prompts actions with telescope + { + "ap", + function() + local actions = require("CopilotChat.actions") + require("CopilotChat.integrations.telescope").pick(actions.prompt_actions()) + end, + desc = "CopilotChat - Prompt actions", + }, + { + "ap", + ":lua require('CopilotChat.integrations.telescope').pick(require('CopilotChat.actions').prompt_actions({selection = require('CopilotChat.select').visual}))", + mode = "x", + desc = "CopilotChat - Prompt actions", + }, + -- Code related commands + { "ae", "CopilotChatExplain", desc = "CopilotChat - Explain code" }, + { "at", "CopilotChatTests", desc = "CopilotChat - Generate tests" }, + { "ar", "CopilotChatReview", desc = "CopilotChat - Review code" }, + { "aR", "CopilotChatRefactor", desc = "CopilotChat - Refactor code" }, + { "an", "CopilotChatBetterNamings", desc = "CopilotChat - Better Naming" }, + -- Chat with Copilot in visual mode + { + "av", + ":CopilotChatVisual", + mode = "x", + desc = "CopilotChat - Open in vertical split", + }, + { + "ax", + ":CopilotChatInline", + mode = "x", + desc = "CopilotChat - Inline chat", + }, + -- Custom input for CopilotChat + { + "ai", + function() + local input = vim.fn.input("Ask Copilot: ") + if input ~= "" then + vim.cmd("CopilotChat " .. input) + end + end, + desc = "CopilotChat - Ask input", + }, + -- Generate commit message based on the git diff + { + "am", + "CopilotChatCommit", + desc = "CopilotChat - Generate commit message for all changes", + }, + -- Quick chat with Copilot + { + "aq", + function() + local input = vim.fn.input("Quick Chat: ") + if input ~= "" then + vim.cmd("CopilotChatBuffer " .. input) + end + end, + desc = "CopilotChat - Quick chat", + }, + -- Debug + { "ad", "CopilotChatDebugInfo", desc = "CopilotChat - Debug Info" }, + -- Fix the issue with diagnostic + { "af", "CopilotChatFixDiagnostic", desc = "CopilotChat - Fix Diagnostic" }, + -- Clear buffer and chat history + { "al", "CopilotChatReset", desc = "CopilotChat - Clear buffer and chat history" }, + -- Toggle Copilot Chat Vsplit + { "aa", "CopilotChatToggle", desc = "CopilotChat - Toggle" }, + -- Copilot Chat Models + { "a?", "CopilotChatModels", desc = "CopilotChat - Select Models" }, + -- Copilot Chat Agents + { "as", "CopilotChatAgents", desc = "CopilotChat - Select Agents" }, + }, + }, } From bda41d6067698a9457ff406e168c46ab03459f04 Mon Sep 17 00:00:00 2001 From: fschuermeyer <25571323+fschuermeyer@users.noreply.github.com> Date: Sat, 28 Dec 2024 23:38:50 +0100 Subject: [PATCH 29/37] WIP: add neotest and telescope-undo plugins - Added neotest plugin with support for Go, Python, Jest, and Vitest - Added telescope-undo plugin for managing undo history - Enabled persistent undo history in options.lua - Updated lualine to include copilot status - Modified key mappings for LSP restart and which-key groups - Disabled copilot suggestions by default --- lazy-lock.json | 10 ++++- lua/core/options.lua | 11 ++++++ lua/core/provider.lua | 3 +- lua/plugins/copilot.lua | 15 ++++--- lua/plugins/folke-which-key.lua | 28 +++++++------ lua/plugins/lsp/lspconfig.lua | 2 +- lua/plugins/lualine.lua | 24 ++++++++---- lua/plugins/neotest.lua | 69 +++++++++++++++++++++++++++++++++ lua/plugins/nvim-cmp.lua | 16 ++++---- lua/plugins/telescope.lua | 15 +++++-- 10 files changed, 154 insertions(+), 39 deletions(-) create mode 100644 lua/plugins/neotest.lua diff --git a/lazy-lock.json b/lazy-lock.json index 93eb4a6..26098d1 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,5 +1,6 @@ { "CopilotChat.nvim": { "branch": "main", "commit": "2ebe591cff06018e265263e71e1dbc4c5aa8281e" }, + "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, "alternate-toggler": { "branch": "main", "commit": "819800304d3e8e575fd6aa461a8bcf2217e1cfb6" }, "bigfile.nvim": { "branch": "main", "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" }, @@ -9,11 +10,11 @@ "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "copilot-cmp": { "branch": "master", "commit": "15fc12af3d0109fa76b60b5cffa1373697e261d1" }, + "copilot-lualine": { "branch": "main", "commit": "f40450c3e138766026327e7807877ea860618258" }, "copilot.lua": { "branch": "master", "commit": "886ee73b6d464b2b3e3e6a7ff55ce87feac423a9" }, "copilot.vim": { "branch": "release", "commit": "61f11db27b691435590b684ed49cba5a691f1884" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" }, - "edgy.nvim": { "branch": "main", "commit": "7e8dedc39abebe40c289b8012cc89b11c69aa7a0" }, "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, @@ -25,12 +26,18 @@ "mini.ai": { "branch": "main", "commit": "40e380a589d07ec2c856940c6422aafe5d949a0d" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" }, "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, + "neotest": { "branch": "master", "commit": "0dccb5ebcf00de245e2060fa17822a9464f5c41a" }, + "neotest-go": { "branch": "main", "commit": "92950ad7be2ca02a41abca5c6600ff6ffaf5b5d6" }, + "neotest-jest": { "branch": "main", "commit": "514fd4eae7da15fd409133086bb8e029b65ac43f" }, + "neotest-python": { "branch": "master", "commit": "a2861ab3c9a0bf75a56b11835c2bfc8270f5be7e" }, + "neotest-vitest": { "branch": "main", "commit": "3e338b77700853f725856c37ff5a3cf9295bffae" }, "noice.nvim": { "branch": "main", "commit": "eaed6cc9c06aa2013b5255349e4f26a6b17ab70f" }, "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" }, "nvim-cmp": { "branch": "main", "commit": "b555203ce4bd7ff6192e759af3362f9d217e8c89" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, "nvim-lsp-file-operations": { "branch": "master", "commit": "9744b738183a5adca0f916527922078a965515ed" }, "nvim-lspconfig": { "branch": "master", "commit": "57154fd9a24e76907e3b0bdba4677ef42c88d91c" }, + "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, "nvim-notify": { "branch": "master", "commit": "1e99f4f9534ecf3b84eb7ef54a8d460230e78442" }, "nvim-treesitter": { "branch": "master", "commit": "5d18ef22dc63624e90aa7b6dbc17f2c3856ae716" }, "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" }, @@ -41,6 +48,7 @@ "snacks.nvim": { "branch": "main", "commit": "98df370703b3c47a297988f3e55ce99628639590" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" }, "telescope-themes": { "branch": "main", "commit": "9b7c368b83b82b53c0a6e9e977f8329e5f1fe269" }, + "telescope-undo.nvim": { "branch": "main", "commit": "2971cc9f193ec09e0c5de3563f99cbea16b63f10" }, "telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" }, "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, "tokyonight.nvim": { "branch": "main", "commit": "45d22cf0e1b93476d3b6d362d720412b3d34465c" }, diff --git a/lua/core/options.lua b/lua/core/options.lua index 3bb4916..4c55b69 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -6,6 +6,7 @@ opt.tabstop = 4 opt.shiftwidth = 4 opt.smarttab = true opt.autoindent = true +opt.smartindent = true opt.expandtab = true -- Use spaces instead of tabs -- Line Configs @@ -17,3 +18,13 @@ opt.wrap = false opt.termguicolors = true opt.mouse = "" opt.clipboard = "unnamedplus" -- System Clipboard + +-- Persitent Undo History +opt.undofile = true +opt.undodir = vim.fn.stdpath("data") .. "/undo" +opt.undolevels = 10000 + +opt.splitright = true +opt.splitbelow = true + +opt.confirm = true diff --git a/lua/core/provider.lua b/lua/core/provider.lua index f39149b..fae41fa 100644 --- a/lua/core/provider.lua +++ b/lua/core/provider.lua @@ -1,4 +1,3 @@ - --- disable provider +-- disable provider vim.g.loaded_perl_provider = 0 vim.g.loaded_ruby_provider = 0 diff --git a/lua/plugins/copilot.lua b/lua/plugins/copilot.lua index 72f6ac8..8e11d95 100644 --- a/lua/plugins/copilot.lua +++ b/lua/plugins/copilot.lua @@ -27,7 +27,7 @@ return { config = function() require("copilot").setup({ suggestion = { - enabled = true, + enabled = false, auto_trigger = true, keymap = { accept = false, @@ -43,14 +43,14 @@ return { "zbirenbaum/copilot-cmp", config = function() require("copilot_cmp").setup() - end + end, }, -- Copilot Chat { "CopilotC-Nvim/CopilotChat.nvim", -- version = "v3.3.0", -- Use a specific version to prevent breaking changes dependencies = { - { "zbirenbaum/copilot.vim" }, -- or zbirenbaum/copilot.lua + { "zbirenbaum/copilot.vim" }, -- or zbirenbaum/copilot.lua { "nvim-telescope/telescope.nvim" }, -- Use telescope for help actions { "nvim-lua/plenary.nvim" }, }, @@ -83,7 +83,7 @@ return { window = { layout = "vertical", width = 0.4, - } + }, }, config = function(_, opts) local chat = require("CopilotChat") @@ -133,7 +133,12 @@ return { end, event = "VeryLazy", keys = { - { "a", "", desc = "+ai", mode = { "n", "v" } }, + { + "a", + "", + desc = "+ai", + mode = { "n", "v" }, + }, -- Show prompts actions with telescope { "ap", diff --git a/lua/plugins/folke-which-key.lua b/lua/plugins/folke-which-key.lua index 504be0f..3a25237 100644 --- a/lua/plugins/folke-which-key.lua +++ b/lua/plugins/folke-which-key.lua @@ -1,15 +1,19 @@ return { - "folke/which-key.nvim", - event = "VeryLazy", - opts = { + "folke/which-key.nvim", + event = "VeryLazy", + opts = { preset = "modern", - sort = {"alphanum"}, - spec = { - mode = { "n", "v" }, - { "d", group = "debug" }, - { "f", group = "file/find" }, - { "g", group = "git" }, - { "u", group = "ui", icon = { icon = "σ°™΅ ", color = "cyan" } }, - }, - }, + sort = { "alphanum" }, + spec = { + mode = { "n", "v" }, + { "e", icon = { icon = " ", color = "yellow" } }, + { "t", icon = { icon = "󰙨 ", color = "green" }, group = "test" }, + { "b", group = "buffer", icon = { icon = "ξΎ– ", color = "yellow" } }, + { "c", group = "code" }, + { "d", group = "debug" }, + { "f", group = "file/find" }, + { "g", group = "git" }, + { "u", group = "ui", icon = { icon = "σ°™΅ ", color = "cyan" } }, + }, + }, } diff --git a/lua/plugins/lsp/lspconfig.lua b/lua/plugins/lsp/lspconfig.lua index f57414b..7d87b41 100644 --- a/lua/plugins/lsp/lspconfig.lua +++ b/lua/plugins/lsp/lspconfig.lua @@ -64,7 +64,7 @@ return { keymap.set("n", "K", vim.lsp.buf.hover, opts) -- show documentation for what is under cursor opts.desc = "Restart LSP" - keymap.set("n", "rs", ":LspRestart", opts) -- mapping to restart lsp if necessary + keymap.set("n", "cs", ":LspRestart", opts) -- mapping to restart lsp if necessary end, }) diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index 2ae391e..9164971 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -1,11 +1,19 @@ return { - "nvim-lualine/lualine.nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, - config = function() - local lualine = require("lualine") + "nvim-lualine/lualine.nvim", + dependencies = { "nvim-tree/nvim-web-devicons", "AndreM222/copilot-lualine" }, + config = function() + local lualine = require("lualine") - lualine.setup({ - extensions = { "neo-tree" }, - }) - end, + lualine.setup({ + extensions = { "neo-tree" }, + sections = { + lualine_a = { 'mode' }, + lualine_b = { 'branch', 'diff', 'diagnostics' }, + lualine_c = { 'filename' }, + lualine_x = { 'copilot', 'encoding', 'fileformat', 'filetype' }, + lualine_y = { 'progress' }, + lualine_z = { 'location' } + }, + }) + end, } diff --git a/lua/plugins/neotest.lua b/lua/plugins/neotest.lua new file mode 100644 index 0000000..040028d --- /dev/null +++ b/lua/plugins/neotest.lua @@ -0,0 +1,69 @@ +local function get_javascript_adapter_test() + local jestCommand = vim.fn.executable("yarn") == 1 and "yarn jest" or "npx jest" + + if vim.fn.findfile("jest.config.js", ".;") ~= "" or vim.fn.findfile("jest.config.ts", ".;") ~= "" then + return require("neotest-jest")({ + jestConfigFile = "jest.config.js", + jestCommand = jestCommand, + }) + end + + if vim.fn.findfile("vite.config.js", ".;") ~= "" or vim.fn.findfile("vite.config.ts", ".;") ~= "" then + return require("neotest-vitest")({ + is_test_file = function(file_path) + if string.match(file_path, "test.ts") then + return true + end + end, + }) + end + + return nil +end + +return { + { + "nvim-neotest/neotest", + dependencies = { + "nvim-neotest/nvim-nio", + "nvim-lua/plenary.nvim", + "antoinemadec/FixCursorHold.nvim", + "nvim-treesitter/nvim-treesitter", + "nvim-neotest/neotest-go", + "nvim-neotest/neotest-python", + "nvim-neotest/neotest-jest", + "marilari88/neotest-vitest", + }, + keys = { + { "t", "", desc = "+test" }, + { "tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File (Neotest)" }, + { "tr", function() require("neotest").run.run() end, desc = "Run Nearest (Neotest)" }, + { "tl", function() require("neotest").run.run_last() end, desc = "Run Last (Neotest)" }, + { "ts", function() require("neotest").summary.toggle() end, desc = "Toggle Summary (Neotest)" }, + { "to", function() require("neotest").output.open({ enter = true, auto_close = true }) end, desc = "Show Output (Neotest)" }, + { "tO", function() require("neotest").output_panel.toggle() end, desc = "Toggle Output Panel (Neotest)" }, + { "tS", function() require("neotest").run.stop() end, desc = "Stop (Neotest)" }, + }, + config = function() + local goAdapter = require("neotest-go")({ + args = { "-v" }, + }) + + local pyAdapter = require("neotest-python")({ + args = { "-s", "-vv" }, + runner = "pytest", + }) + + local jsAdapter = get_javascript_adapter_test() + + ---@diagnostic disable-next-line: missing-fields + require("neotest").setup({ + adapters = { goAdapter, pyAdapter, jsAdapter }, + ---@diagnostic disable-next-line: missing-fields + diagnostic = { + enable = true, + }, + }) + end, + }, +} diff --git a/lua/plugins/nvim-cmp.lua b/lua/plugins/nvim-cmp.lua index dfc4898..71c20c2 100644 --- a/lua/plugins/nvim-cmp.lua +++ b/lua/plugins/nvim-cmp.lua @@ -39,8 +39,6 @@ return { -- loads vscode style snippets from installed plugins (e.g. friendly-snippets) require("luasnip.loaders.from_vscode").lazy_load() - - cmp.setup({ window = { completion = { @@ -53,18 +51,17 @@ return { completion = { completeopt = "menu,menuone,preview,noinsert", }, + preselect = cmp.PreselectMode.Item, snippet = { -- configure how nvim-cmp interacts with snippet engine expand = function(args) luasnip.lsp_expand(args.body) end, }, mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.select_prev_item(), -- previous suggestion [""] = cmp.mapping.select_next_item(), -- next suggestion - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), -- show completion suggestions - [""] = cmp.mapping.abort(), -- close completion window + [""] = cmp.mapping.select_prev_item(), -- previous suggestion + [""] = cmp.mapping.complete(), -- show completion suggestions + [""] = cmp.mapping.abort(), -- close completion window [""] = cmp.mapping.confirm({ select = false }), }), -- sources for autocompletion @@ -85,6 +82,11 @@ return { return kind end, + expandable_indicator = true, + }, + experimental = { + -- required for inline preview of completion items + ghost_text = true, }, }) end, diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 2654e63..019e930 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -8,6 +8,7 @@ return { "BurntSushi/ripgrep", "andrew-george/telescope-themes", "ThePrimeagen/refactoring.nvim", + "debugloop/telescope-undo.nvim", }, config = function() local telescope = require("telescope") @@ -25,11 +26,16 @@ return { }, }, }, + extensions = { + undo = { + use_delta = true, + }, + }, }) - telescope.load_extension("fzf") - telescope.load_extension("themes") - telescope.load_extension("refactoring") + for _, ext in ipairs({ "fzf", "themes", "refactoring", "undo" }) do + telescope.load_extension(ext) + end -- set keymaps local keymap = vim.keymap -- for conciseness @@ -63,5 +69,8 @@ return { -- ui keymap.set("n", "ut", "Telescope themes", { desc = "UI Themes" }) + + -- undo + keymap.set("n", "fu", "Telescope undo", { desc = "Find Undo" }) end, } From abb2c2c5b8dfc14834956104c8dbe9040e407d1c Mon Sep 17 00:00:00 2001 From: fschuermeyer <25571323+fschuermeyer@users.noreply.github.com> Date: Sat, 28 Dec 2024 23:49:15 +0100 Subject: [PATCH 30/37] WIP: update README with personal Neovim setup --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index e69de29..51eb82b 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,12 @@ +# Personal Neovim Setup + +This is my personal Neovim setup, updated in Dezember 2024 from LazyVim to a own configuration Setup. I'm using Neovim as my main editor for coding and writing. The Setup is manly focused on Golang, JavaScript/TypeScript, Python and Lua. + +## Installation + +Clone the repository to your local machine: + +```bash +git clone git@github.com/fschuermeyer/nvim-setup.git ~/.config/nvim +``` + From 996a09314108153dcad06e4830f9449b6ca97a9b Mon Sep 17 00:00:00 2001 From: fschuermeyer <25571323+fschuermeyer@users.noreply.github.com> Date: Sun, 29 Dec 2024 22:37:27 +0100 Subject: [PATCH 31/37] WIP: remove redundant window command in copilot.lua The window command to move the window to the right has been removed from the copilot-chat filetype handling. This change cleans up the code and removes unnecessary commands. --- lua/plugins/copilot.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lua/plugins/copilot.lua b/lua/plugins/copilot.lua index 8e11d95..4f29207 100644 --- a/lua/plugins/copilot.lua +++ b/lua/plugins/copilot.lua @@ -50,7 +50,7 @@ return { "CopilotC-Nvim/CopilotChat.nvim", -- version = "v3.3.0", -- Use a specific version to prevent breaking changes dependencies = { - { "zbirenbaum/copilot.vim" }, -- or zbirenbaum/copilot.lua + { "zbirenbaum/copilot.vim" }, -- or zbirenbaum/copilot.lua { "nvim-telescope/telescope.nvim" }, -- Use telescope for help actions { "nvim-lua/plenary.nvim" }, }, @@ -124,9 +124,6 @@ return { local ft = vim.bo.filetype if ft == "copilot-chat" then vim.bo.filetype = "markdown" - - -- verschieben des Fensters nach Rechts - vim.cmd("wincmd r") end end, }) From 9076c56311a2ebae662f9631a75ba4efb6a96690 Mon Sep 17 00:00:00 2001 From: fschuermeyer <25571323+fschuermeyer@users.noreply.github.com> Date: Sun, 29 Dec 2024 23:24:33 +0100 Subject: [PATCH 32/37] WIP: Improve Treesitter Options --- lazy-lock.json | 4 +- lua/plugins/treesitter.lua | 142 +++++++++++++++++++------------------ 2 files changed, 75 insertions(+), 71 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 26098d1..2a5e373 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -36,10 +36,10 @@ "nvim-cmp": { "branch": "main", "commit": "b555203ce4bd7ff6192e759af3362f9d217e8c89" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, "nvim-lsp-file-operations": { "branch": "master", "commit": "9744b738183a5adca0f916527922078a965515ed" }, - "nvim-lspconfig": { "branch": "master", "commit": "57154fd9a24e76907e3b0bdba4677ef42c88d91c" }, + "nvim-lspconfig": { "branch": "master", "commit": "8b15a1a597a59f4f5306fad9adfe99454feab743" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, "nvim-notify": { "branch": "master", "commit": "1e99f4f9534ecf3b84eb7ef54a8d460230e78442" }, - "nvim-treesitter": { "branch": "master", "commit": "5d18ef22dc63624e90aa7b6dbc17f2c3856ae716" }, + "nvim-treesitter": { "branch": "master", "commit": "7e0fcf0d456fc5818da1af35b1a3f5c784fce457" }, "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" }, "nvim-web-devicons": { "branch": "master", "commit": "63f552a7f59badc6e6b6d22e603150f0d5abebb7" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index ca98068..aa7f7c7 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,72 +1,76 @@ return { - "nvim-treesitter/nvim-treesitter", - event = { "BufReadPre", "BufNewFile" }, - build = ":TSUpdate", - dependencies = { - "windwp/nvim-ts-autotag", - }, - config = function() - -- import nvim-treesitter plugin - local treesitter = require("nvim-treesitter.configs") + "nvim-treesitter/nvim-treesitter", + event = { "BufReadPre", "BufNewFile" }, + build = ":TSUpdate", + dependencies = { + "windwp/nvim-ts-autotag", + }, + config = function() + -- import nvim-treesitter plugin + local treesitter = require("nvim-treesitter.configs") - -- configure treesitter - treesitter.setup({ -- enable syntax highlighting - highlight = { - enable = true, - }, - -- enable indentation - indent = { enable = true }, - -- enable autotagging (w/ nvim-ts-autotag plugin) - autotag = { - enable = true, - }, - -- ensure these language parsers are installed - ensure_installed = { - "json", - "javascript", - "typescript", - "tsx", - "yaml", - "html", - "css", - "markdown", - "markdown_inline", - "graphql", - "bash", - "lua", - "vim", - "dockerfile", - "gitignore", - "query", - "vimdoc", - "go", - "php", - "csv", - "dart", - "diff", - "editorconfig", - "gomod", - "gosum", - "gotmpl", - "haskell", - "java", - "jq", - "kotlin", - "python", - "sql", - "tmux", - "vue", - "xml", - }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = "", - node_incremental = "", - scope_incremental = false, - node_decremental = "", - }, - }, - }) - end, + -- configure treesitter + treesitter.setup({ -- enable syntax highlighting + highlight = { + enable = true, + }, + -- enable indentation + indent = { enable = true }, + -- enable autotagging (w/ nvim-ts-autotag plugin) + autotag = { + enable = true, + }, + -- ensure these language parsers are installed + ensure_installed = { + "json", + "javascript", + "typescript", + "tsx", + "yaml", + "html", + "css", + "markdown", + "markdown_inline", + "graphql", + "bash", + "lua", + "vim", + "dockerfile", + "gitignore", + "query", + "vimdoc", + "go", + "php", + "csv", + "dart", + "diff", + "editorconfig", + "gomod", + "gosum", + "gotmpl", + "haskell", + "java", + "jq", + "kotlin", + "python", + "sql", + "tmux", + "vue", + "xml", + }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "", + node_incremental = "", + scope_incremental = false, + node_decremental = "", + }, + }, + -- some default options + sync_install = true, + ignore_install = {}, + auto_install = false, + }) + end, } From 030782478aaff15ea85cb39eea21d83c1b04c8fc Mon Sep 17 00:00:00 2001 From: fschuermeyer <25571323+fschuermeyer@users.noreply.github.com> Date: Mon, 30 Dec 2024 00:09:13 +0100 Subject: [PATCH 33/37] WIP: Plugin Options Improvments --- lua/plugins/bigfile.lua | 16 +++--- lua/plugins/colorizer.lua | 22 +++++++-- lua/plugins/colorschema.lua | 27 ++++++----- lua/plugins/dressing.lua | 3 +- lua/plugins/folke-noice.lua | 86 ++++++++++++++++++--------------- lua/plugins/folke-which-key.lua | 1 + 6 files changed, 87 insertions(+), 68 deletions(-) diff --git a/lua/plugins/bigfile.lua b/lua/plugins/bigfile.lua index 3f70b5f..7f308b5 100644 --- a/lua/plugins/bigfile.lua +++ b/lua/plugins/bigfile.lua @@ -1,10 +1,10 @@ return { - "LunarVim/bigfile.nvim", - event = "BufReadPre", - opts = { - filesize = 3, - }, - config = function(_, opts) - require("bigfile").setup(opts) - end, + "LunarVim/bigfile.nvim", + event = "BufReadPre", + opts = { + filesize = 1, + }, + config = function(_, opts) + require("bigfile").setup(opts) + end, } diff --git a/lua/plugins/colorizer.lua b/lua/plugins/colorizer.lua index 9045748..452499b 100644 --- a/lua/plugins/colorizer.lua +++ b/lua/plugins/colorizer.lua @@ -1,7 +1,19 @@ return { - { - "norcalli/nvim-colorizer.lua", - event = "BufEnter", - opts = { "*" }, - }, + { + "norcalli/nvim-colorizer.lua", + event = "BufEnter", + config = function() + require("colorizer").setup({ "*" }, { + RGB = true, -- #RGB hex codes + RRGGBB = true, -- #RRGGBB hex codes + RRGGBBAA = true, -- #RRGGBBAA hex codes + names = true, -- "Name" codes like Blue + rgb_fn = true, -- CSS rgb() and rgba() functions + hsl_fn = true, -- CSS hsl() and hsla() functions + css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB + css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn + }) + end, + + }, } diff --git a/lua/plugins/colorschema.lua b/lua/plugins/colorschema.lua index cb74dae..d3d84a2 100644 --- a/lua/plugins/colorschema.lua +++ b/lua/plugins/colorschema.lua @@ -1,15 +1,16 @@ return { - "folke/tokyonight.nvim", - priority = 1000, - config = function() - require("tokyonight").setup({ - transparent = true, - style = "night", - styles = { - sidebars = "transparent", - floats = "transparent", - }, - }) - vim.cmd("colorscheme tokyonight") - end, + "folke/tokyonight.nvim", + priority = 1000, + config = function() + ---@diagnostic disable-next-line: missing-fields + require("tokyonight").setup({ + transparent = true, + style = "night", + styles = { + sidebars = "transparent", + floats = "transparent", + }, + }) + vim.cmd("colorscheme tokyonight") + end, } diff --git a/lua/plugins/dressing.lua b/lua/plugins/dressing.lua index 194527c..32df64b 100644 --- a/lua/plugins/dressing.lua +++ b/lua/plugins/dressing.lua @@ -1,5 +1,4 @@ return { - "stevearc/dressing.nvim", + "stevearc/dressing.nvim", event = "VeryLazy", - opts = {}, } diff --git a/lua/plugins/folke-noice.lua b/lua/plugins/folke-noice.lua index a619e1d..a61fc4e 100644 --- a/lua/plugins/folke-noice.lua +++ b/lua/plugins/folke-noice.lua @@ -1,43 +1,49 @@ return { - "folke/noice.nvim", - event = "VeryLazy", - dependencies = { - "MunifTanjim/nui.nvim", - "rcarriga/nvim-notify", - }, - config = function() - require("noice").setup({ - views = { - cmdline_popup = { - position = { - row = 5, - col = "50%", - }, - size = { - width = 60, - height = "auto", - }, - }, - popupmenu = { - relative = "editor", - position = { - row = 8, - col = "50%", - }, - size = { - width = 60, - height = 10, - }, - border = { - style = "rounded", - padding = { 0, 1 }, - }, - win_options = { - winhighlight = { Normal = "Normal", FloatBorder = "DiagnosticInfo" }, - }, - }, - }, - }) + "folke/noice.nvim", + event = "VeryLazy", + dependencies = { + "MunifTanjim/nui.nvim", + "rcarriga/nvim-notify", + }, + config = function() + ---@diagnostic disable-next-line: missing-fields + require("noice").setup({ + views = { + cmdline_popup = { + position = { + row = 5, + col = "50%", + }, + size = { + width = 60, + height = "auto", + }, + }, + popupmenu = { + relative = "editor", + position = { + row = 8, + col = "50%", + }, + size = { + width = 60, + height = 10, + }, + border = { + style = "rounded", + padding = { 0, 1 }, + }, + win_options = { + winhighlight = { Normal = "Normal", FloatBorder = "DiagnosticInfo" }, + }, + }, + }, + }) - end, + local set = vim.keymap.set + + set("n", "mx", "Noice dismiss", { noremap = true, silent = true, desc = "Dismiss Messages" }) + set("n", "ml", "Noice last", { noremap = true, silent = true, desc = "Last Message" }) + set("n", "mh", "Noice telescope", { noremap = true, silent = true, desc = "History" }) + end, } diff --git a/lua/plugins/folke-which-key.lua b/lua/plugins/folke-which-key.lua index 3a25237..7d8ddb2 100644 --- a/lua/plugins/folke-which-key.lua +++ b/lua/plugins/folke-which-key.lua @@ -6,6 +6,7 @@ return { sort = { "alphanum" }, spec = { mode = { "n", "v" }, + { "m", group = "message", icon = { icon = " ", color = "blue" } }, { "e", icon = { icon = " ", color = "yellow" } }, { "t", icon = { icon = "󰙨 ", color = "green" }, group = "test" }, { "b", group = "buffer", icon = { icon = "ξΎ– ", color = "yellow" } }, From cfdc89dc551a5c47eb8c0053565ab606cde1b2da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCrmeyer?= <25571323+fschuermeyer@users.noreply.github.com> Date: Mon, 30 Dec 2024 12:21:11 +0100 Subject: [PATCH 34/37] WIP: add buffer keymaps, fix lsps for css formatting --- lua/core/autocmd.lua | 21 +++++++++++++++------ lua/plugins/folke-snacks.lua | 7 +++++++ lua/plugins/lsp/lspconfig.lua | 22 +++++++++++++++++++++- 3 files changed, 43 insertions(+), 7 deletions(-) diff --git a/lua/core/autocmd.lua b/lua/core/autocmd.lua index 093c105..2343265 100644 --- a/lua/core/autocmd.lua +++ b/lua/core/autocmd.lua @@ -2,10 +2,19 @@ vim.api.nvim_set_hl(0, "YankHighlight", { bg = "#C11B3B", fg = "#F3A3B3" }) -- Highlight, was gejankt wurde vim.api.nvim_create_autocmd("TextYankPost", { - callback = function() - vim.highlight.on_yank({ - higroup = "YankHighlight", - timeout = 200, - }) - end, + callback = function() + vim.highlight.on_yank({ + higroup = "YankHighlight", + timeout = 200, + }) + end, }) + +-- Highlight for Template Files +vim.cmd([[ + autocmd BufNewFile,BufRead *.tmpl set filetype=gohtmltmpl + autocmd BufNewFile,BufRead *.gohtml set filetype=gohtmltmpl + autocmd BufNewFile,BufRead *.gohtmltmpl set filetype=gohtmltmpl + autocmd BufNewFile,BufRead *.gotexttmpl set filetype=gotexttmpl + autocmd BufNewFile,BufRead *.twig set filetype=html +]]) diff --git a/lua/plugins/folke-snacks.lua b/lua/plugins/folke-snacks.lua index 2eab04d..b3d6d49 100644 --- a/lua/plugins/folke-snacks.lua +++ b/lua/plugins/folke-snacks.lua @@ -54,6 +54,13 @@ return { vim.api.nvim_set_hl(0, "SnacksDashboardHeader", { fg = "#FFA500" }) -- Orange Farbe vim.keymap.set("n", "cR", Snacks.rename.rename_file, { desc = "Rename File" }) + vim.keymap.set("n", "bd", function() + Snacks.bufdelete() + end, { desc = "Delete Buffer" }) + vim.keymap.set("n", "bo", function() + Snacks.bufdelete.other() + end, { desc = "Delete Other Buffers" }) + Snacks.toggle.option("wrap", { name = "Line Wrap" }):map("uw") Snacks.toggle.option("number", { name = "Line Numbers" }):map("un") Snacks.toggle.option("relativenumber", { name = "Relative Line Numbers" }):map("ur") diff --git a/lua/plugins/lsp/lspconfig.lua b/lua/plugins/lsp/lspconfig.lua index 7d87b41..f0eb18c 100644 --- a/lua/plugins/lsp/lspconfig.lua +++ b/lua/plugins/lsp/lspconfig.lua @@ -86,12 +86,20 @@ return { group = vim.api.nvim_create_augroup("LspFormatting", { clear = true }), buffer = bufnr, callback = function() - vim.lsp.buf.format({ async = false }) + vim.lsp.buf.format({ + async = false, + timeout_ms = 3000, + }) end, }) end end + local on_attach_disable_formatting = function(client, _) + client.server_capabilities.documentFormattingProvider = false + client.server_capabilities.documentRangeFormattingProvider = false + end + mason_lspconfig.setup_handlers({ -- default handler for installed servers function(server_name) @@ -135,12 +143,24 @@ return { }, }) end, + ["cssls"] = function() + lspconfig["cssls"].setup({ + capabilities = capabilities, + on_attach = on_attach_disable_formatting, + settings = { + init_options = { + provideFormatter = false, + }, + }, + }) + end, ["stylelint_lsp"] = function() lspconfig["stylelint_lsp"].setup({ capabilities = capabilities, on_attach = on_attach, settings = { stylelintplus = { + autoFixOnSave = true, autoFixOnFormat = true } }, From d24d55770ea2cdb29890d1bb7f542f5e8233d6f1 Mon Sep 17 00:00:00 2001 From: fschuermeyer <25571323+fschuermeyer@users.noreply.github.com> Date: Tue, 31 Dec 2024 17:50:36 +0100 Subject: [PATCH 35/37] WIP: Improvments / Add Dadbod --- lazy-lock.json | 15 +++++++++------ lua/core/keymaps.lua | 2 -- lua/plugins/dadbod.lua | 27 +++++++++++++++++++++++++++ lua/plugins/lsp/lspconfig.lua | 7 ++----- lua/plugins/nvim-cmp.lua | 14 ++++++++------ 5 files changed, 46 insertions(+), 19 deletions(-) create mode 100644 lua/plugins/dadbod.lua diff --git a/lazy-lock.json b/lazy-lock.json index 2a5e373..84d68ef 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -4,7 +4,7 @@ "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, "alternate-toggler": { "branch": "main", "commit": "819800304d3e8e575fd6aa461a8bcf2217e1cfb6" }, "bigfile.nvim": { "branch": "main", "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" }, - "bufferline.nvim": { "branch": "main", "commit": "261a72b90d6db4ed8014f7bda976bcdc9dd7ce76" }, + "bufferline.nvim": { "branch": "main", "commit": "9f0826ae6adfd836a23bf8a4910e3c07450211f4" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, @@ -38,20 +38,23 @@ "nvim-lsp-file-operations": { "branch": "master", "commit": "9744b738183a5adca0f916527922078a965515ed" }, "nvim-lspconfig": { "branch": "master", "commit": "8b15a1a597a59f4f5306fad9adfe99454feab743" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, - "nvim-notify": { "branch": "master", "commit": "1e99f4f9534ecf3b84eb7ef54a8d460230e78442" }, - "nvim-treesitter": { "branch": "master", "commit": "7e0fcf0d456fc5818da1af35b1a3f5c784fce457" }, + "nvim-notify": { "branch": "master", "commit": "c3797193536711b5d8983975791c4b11dc35ab3a" }, + "nvim-treesitter": { "branch": "master", "commit": "5f78e989243f9fb0fb55e0cf54820920d86dfd30" }, "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" }, - "nvim-web-devicons": { "branch": "master", "commit": "63f552a7f59badc6e6b6d22e603150f0d5abebb7" }, + "nvim-web-devicons": { "branch": "master", "commit": "4adeeaa7a32d46cf3b5833341358c797304f950a" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "refactoring.nvim": { "branch": "master", "commit": "2db6d378e873de31d18ade549c2edba64ff1c2e3" }, - "ripgrep": { "branch": "master", "commit": "79cbe89deb1151e703f4d91b19af9cdcc128b765" }, - "snacks.nvim": { "branch": "main", "commit": "98df370703b3c47a297988f3e55ce99628639590" }, + "ripgrep": { "branch": "master", "commit": "94305125ef33b86151b6cd2ce2b33d641f6b6ac3" }, + "snacks.nvim": { "branch": "main", "commit": "d312053f78b4fb55523def179ac502438dd93193" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" }, "telescope-themes": { "branch": "main", "commit": "9b7c368b83b82b53c0a6e9e977f8329e5f1fe269" }, "telescope-undo.nvim": { "branch": "main", "commit": "2971cc9f193ec09e0c5de3563f99cbea16b63f10" }, "telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" }, "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, "tokyonight.nvim": { "branch": "main", "commit": "45d22cf0e1b93476d3b6d362d720412b3d34465c" }, + "vim-dadbod": { "branch": "master", "commit": "f740950d0703099e0f172016f10e0e39f50fd0ba" }, + "vim-dadbod-completion": { "branch": "master", "commit": "71eb73d1f7399be6a56cc43b928276cd5ca27ffd" }, + "vim-dadbod-ui": { "branch": "master", "commit": "0fec59e3e1e619e302198cd491b7d27f8d398b7c" }, "vim-go": { "branch": "master", "commit": "6adc82bfef7f9a4b0db78065ae51b8ebb145c355" }, "vim-tmux-navigator": { "branch": "master", "commit": "d847ea942a5bb4d4fab6efebc9f30d787fd96e65" }, "which-key.nvim": { "branch": "main", "commit": "8ab96b38a2530eacba5be717f52e04601eb59326" } diff --git a/lua/core/keymaps.lua b/lua/core/keymaps.lua index f620e80..c477db1 100644 --- a/lua/core/keymaps.lua +++ b/lua/core/keymaps.lua @@ -2,8 +2,6 @@ vim.g.mapleader = " " local setKey = vim.keymap.set -setKey("n", "q", ":q", { desc = "Exit Nvim" }) - -- Move Lines local moveUp = { noremap = true, silent = true, desc = "Move the Line Up" } local moveDown = { noremap = true, silent = true, desc = "Move the Line Down" } diff --git a/lua/plugins/dadbod.lua b/lua/plugins/dadbod.lua new file mode 100644 index 0000000..f45f634 --- /dev/null +++ b/lua/plugins/dadbod.lua @@ -0,0 +1,27 @@ +return { + 'kristijanhusak/vim-dadbod-ui', + dependencies = { + { 'tpope/vim-dadbod', lazy = true }, + { 'kristijanhusak/vim-dadbod-completion', ft = { 'sql', 'mysql', 'plsql' }, lazy = true }, + }, + keys = { + { "D", "DBUIToggle", desc = "Toggle DBUI" }, + }, + cmd = { + 'DBUI', + 'DBUIToggle', + 'DBUIAddConnection', + 'DBUIFindBuffer', + }, + init = function() + local data_path = vim.fn.stdpath("data") + + vim.g.db_ui_auto_execute_table_helpers = 1 + vim.g.db_ui_save_location = data_path .. "/dadbod_ui" + vim.g.db_ui_show_database_icon = true + vim.g.db_ui_tmp_query_location = data_path .. "/dadbod_ui/tmp" + vim.g.db_ui_use_nerd_fonts = true + vim.g.db_ui_use_nvim_notify = true + vim.g.db_ui_execute_on_save = false + end, +} diff --git a/lua/plugins/lsp/lspconfig.lua b/lua/plugins/lsp/lspconfig.lua index f0eb18c..65fc8b7 100644 --- a/lua/plugins/lsp/lspconfig.lua +++ b/lua/plugins/lsp/lspconfig.lua @@ -40,7 +40,7 @@ return { keymap.set("n", "gi", "Telescope lsp_implementations", opts) -- show lsp implementations opts.desc = "Show type definitions" - keymap.set("n", "gt", "Telescope lsp_type_definitions", opts) -- show lsp type definitions + keymap.set("n", "gy", "Telescope lsp_type_definitions", opts) -- show lsp type definitions opts.desc = "See available code actions" keymap.set({ "n", "v" }, "ca", vim.lsp.buf.code_action, opts) -- see available code actions, in visual mode will apply to selection @@ -49,10 +49,7 @@ return { keymap.set("n", "cr", vim.lsp.buf.rename, opts) -- smart rename opts.desc = "Show buffer diagnostics" - keymap.set("n", "D", "Telescope diagnostics bufnr=0", opts) -- show diagnostics for file - - opts.desc = "Show line diagnostics" - keymap.set("n", "d", vim.diagnostic.open_float, opts) -- show diagnostics for line + keymap.set("n", "d", "Telescope diagnostics bufnr=0", opts) -- show diagnostics for file opts.desc = "Go to previous diagnostic" keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) -- jump to previous diagnostic in buffer diff --git a/lua/plugins/nvim-cmp.lua b/lua/plugins/nvim-cmp.lua index 71c20c2..dc4a4cc 100644 --- a/lua/plugins/nvim-cmp.lua +++ b/lua/plugins/nvim-cmp.lua @@ -11,9 +11,10 @@ return { -- install jsregexp (optional!). build = "make install_jsregexp", }, - "saadparwaiz1/cmp_luasnip", -- for autocompletion - "rafamadriz/friendly-snippets", -- useful snippets - "onsails/lspkind.nvim", -- vs-code like pictograms + "saadparwaiz1/cmp_luasnip", -- for autocompletion + "rafamadriz/friendly-snippets", -- useful snippets + "onsails/lspkind.nvim", -- vs-code like pictograms + "kristijanhusak/vim-dadbod-completion", -- completion for vim-dadbod-ui { "zbirenbaum/copilot-cmp", opts = {}, @@ -67,10 +68,11 @@ return { -- sources for autocompletion sources = cmp.config.sources({ { name = "copilot" }, + { name = "vim-dadbod-completion" }, -- completion for vim-dadbod-ui { name = "nvim_lsp" }, - { name = "luasnip" }, -- snippets - { name = "path" }, -- file system paths - { name = "buffer" }, -- text within current buffer + { name = "luasnip" }, -- snippets + { name = "path" }, -- file system paths + { name = "buffer" }, -- text within current buffer }), formatting = { fields = { "kind", "abbr", "menu" }, From 24c35ae6720f810538b0ef947219e6ff3527543a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCrmeyer?= <25571323+fschuermeyer@users.noreply.github.com> Date: Tue, 31 Dec 2024 18:10:17 +0100 Subject: [PATCH 36/37] WIP: fix for dadbod notifications --- lua/plugins/folke-noice.lua | 1 - lua/plugins/folke-snacks.lua | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/folke-noice.lua b/lua/plugins/folke-noice.lua index a61fc4e..7639fbb 100644 --- a/lua/plugins/folke-noice.lua +++ b/lua/plugins/folke-noice.lua @@ -3,7 +3,6 @@ return { event = "VeryLazy", dependencies = { "MunifTanjim/nui.nvim", - "rcarriga/nvim-notify", }, config = function() ---@diagnostic disable-next-line: missing-fields diff --git a/lua/plugins/folke-snacks.lua b/lua/plugins/folke-snacks.lua index b3d6d49..bbba0ea 100644 --- a/lua/plugins/folke-snacks.lua +++ b/lua/plugins/folke-snacks.lua @@ -47,6 +47,7 @@ return { }, scope = { enabled = true }, scroll = { enabled = true }, + notifier = { enabled = true }, }, config = function(_, opts) require("snacks").setup(opts) From c697595c7949e9d63d3fde38a0acd75d456b5850 Mon Sep 17 00:00:00 2001 From: fschuermeyer <25571323+fschuermeyer@users.noreply.github.com> Date: Tue, 31 Dec 2024 18:30:10 +0100 Subject: [PATCH 37/37] WIP: Enable Telescope Preview for gohtml --- lua/plugins/telescope.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 019e930..818f336 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -33,6 +33,20 @@ return { }, }) + -- Enable Preview for gohtml files in Telescope + vim.api.nvim_create_autocmd("User", { + pattern = "TelescopePreviewerLoaded", + callback = function(args) + print("TelescopePreviewerLoaded", args.data.bufname) + local gotmpl = { "%.gohtmltmpl$", "%.gohtml$", "%.gotmpl$", "%.tmpl$" } + for _, ext in ipairs(gotmpl) do + if args.data.bufname:match(ext) then + vim.cmd("setlocal filetype=gohtmltmpl") + end + end + end, + }) + for _, ext in ipairs({ "fzf", "themes", "refactoring", "undo" }) do telescope.load_extension(ext) end