From 8230492c3adef93aba6ee907f3c63e8a83a7ce1d Mon Sep 17 00:00:00 2001 From: Baerspektivo Date: Mon, 13 Oct 2025 10:00:52 +0200 Subject: [PATCH] feat: Sync complete config - Fish, Ghostty, Neovim Scratch - Add missing Fish configs (direnv, ssh function) - Add Tokyo Night theme for Ghostty - Complete Neovim scratch config sync - Rewrite install.sh for new structure - Add comprehensive README.md --- .config/fish/conf.d/direnv.fish | 8 + .config/fish/functions/ssh.fish | 3 + .config/ghostty/themes/tokyonight_night.yml | 24 + .config/nvim.bak/.gitignore | 8 - .config/nvim.bak/.neoconf.json | 15 - .config/nvim.bak/LICENSE | 201 ---- .config/nvim.bak/README.md | 4 - .config/nvim.bak/init.lua | 2 - .config/nvim.bak/lazy-lock.json | 54 - .config/nvim.bak/lazyvim.json | 10 - .config/nvim.bak/lua/config/autocmds.lua | 35 - .config/nvim.bak/lua/config/keymaps.lua | 16 - .config/nvim.bak/lua/config/lazy.lua | 61 - .config/nvim.bak/lua/config/options.lua | 13 - .config/nvim.bak/lua/plugins/coding.lua | 43 - .config/nvim.bak/lua/plugins/colorscheme.lua | 43 - .config/nvim.bak/lua/plugins/lsp.lua | 191 --- .config/nvim.bak/lua/plugins/neo-tree.lua | 54 - .config/nvim.bak/lua/plugins/telescope.lua | 27 - .config/nvim.bak/lua/plugins/tools.lua | 38 - .config/nvim.bak/lua/plugins/treesitter.lua | 46 - .config/nvim.bak/stylua.toml | 3 - .../nvim/.github/ISSUE_TEMPLATE/bug_report.md | 35 - .config/nvim/.github/pull_request_template.md | 8 - .config/nvim/.github/workflows/stylua.yml | 21 - .config/nvim/.gitignore | 21 +- .config/nvim/.stylua.toml | 6 - .config/nvim/LICENSE.md | 19 - .config/nvim/README.md | 381 +++--- .config/nvim/doc/kickstart.txt | 24 - .config/nvim/init.lua | 71 +- .config/nvim/init.lua.bak | 1033 ----------------- .config/nvim/lazy-lock.json | 61 +- .config/nvim/lua/core/keymaps.lua | 50 + .config/nvim/lua/core/lazy.lua | 45 + .config/nvim/lua/core/options.lua | 61 + .config/nvim/lua/custom/config.lua | 94 -- .config/nvim/lua/custom/hydra.lua | 183 --- .config/nvim/lua/custom/lsp.lua | 280 ----- .config/nvim/lua/custom/plugins.lua | 449 ------- .config/nvim/lua/custom/plugins/init.lua | 5 - .config/nvim/lua/kickstart/health.lua | 52 - .../nvim/lua/kickstart/plugins/autopairs.lua | 16 - .config/nvim/lua/kickstart/plugins/debug.lua | 148 --- .../nvim/lua/kickstart/plugins/gitsigns.lua | 61 - .../lua/kickstart/plugins/indent_line.lua | 9 - .config/nvim/lua/kickstart/plugins/lint.lua | 60 - .../nvim/lua/kickstart/plugins/neo-tree.lua | 25 - .config/nvim/lua/plugins/completion.lua | 147 +++ .config/nvim/lua/plugins/editor.lua | 67 ++ .config/nvim/lua/plugins/formatting.lua | 77 ++ .config/nvim/lua/plugins/git.lua | 72 ++ .config/nvim/lua/plugins/harpoon.lua | 31 + .config/nvim/lua/plugins/lsp.lua | 276 +++++ .config/nvim/lua/plugins/neotree.lua | 113 ++ .config/nvim/lua/plugins/telescope.lua | 89 ++ .config/nvim/lua/plugins/treesitter.lua | 103 ++ .config/nvim/lua/plugins/ui.lua | 76 ++ README.md | 253 ++++ install.sh | 854 +++----------- 60 files changed, 1893 insertions(+), 4382 deletions(-) create mode 100644 .config/fish/conf.d/direnv.fish create mode 100644 .config/fish/functions/ssh.fish create mode 100644 .config/ghostty/themes/tokyonight_night.yml delete mode 100644 .config/nvim.bak/.gitignore delete mode 100644 .config/nvim.bak/.neoconf.json delete mode 100644 .config/nvim.bak/LICENSE delete mode 100644 .config/nvim.bak/README.md delete mode 100644 .config/nvim.bak/init.lua delete mode 100644 .config/nvim.bak/lazy-lock.json delete mode 100644 .config/nvim.bak/lazyvim.json delete mode 100644 .config/nvim.bak/lua/config/autocmds.lua delete mode 100644 .config/nvim.bak/lua/config/keymaps.lua delete mode 100644 .config/nvim.bak/lua/config/lazy.lua delete mode 100644 .config/nvim.bak/lua/config/options.lua delete mode 100644 .config/nvim.bak/lua/plugins/coding.lua delete mode 100644 .config/nvim.bak/lua/plugins/colorscheme.lua delete mode 100644 .config/nvim.bak/lua/plugins/lsp.lua delete mode 100644 .config/nvim.bak/lua/plugins/neo-tree.lua delete mode 100644 .config/nvim.bak/lua/plugins/telescope.lua delete mode 100644 .config/nvim.bak/lua/plugins/tools.lua delete mode 100644 .config/nvim.bak/lua/plugins/treesitter.lua delete mode 100644 .config/nvim.bak/stylua.toml delete mode 100644 .config/nvim/.github/ISSUE_TEMPLATE/bug_report.md delete mode 100644 .config/nvim/.github/pull_request_template.md delete mode 100644 .config/nvim/.github/workflows/stylua.yml delete mode 100644 .config/nvim/.stylua.toml delete mode 100644 .config/nvim/LICENSE.md delete mode 100644 .config/nvim/doc/kickstart.txt delete mode 100644 .config/nvim/init.lua.bak create mode 100644 .config/nvim/lua/core/keymaps.lua create mode 100644 .config/nvim/lua/core/lazy.lua create mode 100644 .config/nvim/lua/core/options.lua delete mode 100644 .config/nvim/lua/custom/config.lua delete mode 100644 .config/nvim/lua/custom/hydra.lua delete mode 100644 .config/nvim/lua/custom/lsp.lua delete mode 100644 .config/nvim/lua/custom/plugins.lua delete mode 100644 .config/nvim/lua/custom/plugins/init.lua delete mode 100644 .config/nvim/lua/kickstart/health.lua delete mode 100644 .config/nvim/lua/kickstart/plugins/autopairs.lua delete mode 100644 .config/nvim/lua/kickstart/plugins/debug.lua delete mode 100644 .config/nvim/lua/kickstart/plugins/gitsigns.lua delete mode 100644 .config/nvim/lua/kickstart/plugins/indent_line.lua delete mode 100644 .config/nvim/lua/kickstart/plugins/lint.lua delete mode 100644 .config/nvim/lua/kickstart/plugins/neo-tree.lua create mode 100644 .config/nvim/lua/plugins/completion.lua create mode 100644 .config/nvim/lua/plugins/editor.lua create mode 100644 .config/nvim/lua/plugins/formatting.lua create mode 100644 .config/nvim/lua/plugins/git.lua create mode 100644 .config/nvim/lua/plugins/harpoon.lua create mode 100644 .config/nvim/lua/plugins/lsp.lua create mode 100644 .config/nvim/lua/plugins/neotree.lua create mode 100644 .config/nvim/lua/plugins/telescope.lua create mode 100644 .config/nvim/lua/plugins/treesitter.lua create mode 100644 .config/nvim/lua/plugins/ui.lua create mode 100644 README.md diff --git a/.config/fish/conf.d/direnv.fish b/.config/fish/conf.d/direnv.fish new file mode 100644 index 0000000..2cf8614 --- /dev/null +++ b/.config/fish/conf.d/direnv.fish @@ -0,0 +1,8 @@ +# Direnv integration for fish +if type -q direnv + # Remove any existing direnv functions first + functions -e __direnv_export_eval 2>/dev/null + + # Set up direnv with the correct path + eval (direnv hook fish) +end diff --git a/.config/fish/functions/ssh.fish b/.config/fish/functions/ssh.fish new file mode 100644 index 0000000..27c137c --- /dev/null +++ b/.config/fish/functions/ssh.fish @@ -0,0 +1,3 @@ +function ssh + TERM=xterm-256color command ssh $argv +end diff --git a/.config/ghostty/themes/tokyonight_night.yml b/.config/ghostty/themes/tokyonight_night.yml new file mode 100644 index 0000000..f3d512a --- /dev/null +++ b/.config/ghostty/themes/tokyonight_night.yml @@ -0,0 +1,24 @@ +# Tokyo Night theme for Ghostty +background: "#1a1b26" +foreground: "#c0caf5" +cursor-color: "#c0caf5" +selection-background: "#33467c" +selection-foreground: "#c0caf5" + +palette: + - "#15161e" # black + - "#f7768e" # red + - "#9ece6a" # green + - "#e0af68" # yellow + - "#7aa2f7" # blue + - "#bb9af7" # magenta + - "#7dcfff" # cyan + - "#a9b1d6" # white + - "#414868" # bright black + - "#f7768e" # bright red + - "#9ece6a" # bright green + - "#e0af68" # bright yellow + - "#7aa2f7" # bright blue + - "#bb9af7" # bright magenta + - "#7dcfff" # bright cyan + - "#c0caf5" # bright white diff --git a/.config/nvim.bak/.gitignore b/.config/nvim.bak/.gitignore deleted file mode 100644 index cc5457a..0000000 --- a/.config/nvim.bak/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -tt.* -.tests -doc/tags -debug -.repro -foo.* -*.log -data diff --git a/.config/nvim.bak/.neoconf.json b/.config/nvim.bak/.neoconf.json deleted file mode 100644 index 7c48087..0000000 --- a/.config/nvim.bak/.neoconf.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "neodev": { - "library": { - "enabled": true, - "plugins": true - } - }, - "neoconf": { - "plugins": { - "lua_ls": { - "enabled": true - } - } - } -} diff --git a/.config/nvim.bak/LICENSE b/.config/nvim.bak/LICENSE deleted file mode 100644 index 261eeb9..0000000 --- a/.config/nvim.bak/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/.config/nvim.bak/README.md b/.config/nvim.bak/README.md deleted file mode 100644 index 185280b..0000000 --- a/.config/nvim.bak/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# ๐Ÿ’ค LazyVim - -A starter template for [LazyVim](https://github.com/LazyVim/LazyVim). -Refer to the [documentation](https://lazyvim.github.io/installation) to get started. diff --git a/.config/nvim.bak/init.lua b/.config/nvim.bak/init.lua deleted file mode 100644 index 2514f9e..0000000 --- a/.config/nvim.bak/init.lua +++ /dev/null @@ -1,2 +0,0 @@ --- bootstrap lazy.nvim, LazyVim and your plugins -require("config.lazy") diff --git a/.config/nvim.bak/lazy-lock.json b/.config/nvim.bak/lazy-lock.json deleted file mode 100644 index 6aa7c78..0000000 --- a/.config/nvim.bak/lazy-lock.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "LazyVim": { "branch": "main", "commit": "3f034d0a7f58031123300309f2efd3bb0356ee21" }, - "SchemaStore.nvim": { "branch": "main", "commit": "c61a74033522c3efbb8465fe6e9c75b27f5c3667" }, - "blink.cmp": { "branch": "main", "commit": "cb5e346d9e0efa7a3eee7fd4da0b690c48d2a98e" }, - "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, - "catppuccin": { "branch": "main", "commit": "5b5e3aef9ad7af84f463d17b5479f06b87d5c429" }, - "code_runner.nvim": { "branch": "main", "commit": "cb9e1bc37c5e15a870f27730343f62ffd1d9c443" }, - "conform.nvim": { "branch": "master", "commit": "eebc724d12c5579d733d1f801386e0ceb909d001" }, - "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, - "flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" }, - "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, - "gitsigns.nvim": { "branch": "main", "commit": "17ab794b6fce6fce768430ebc925347e349e1d60" }, - "grug-far.nvim": { "branch": "main", "commit": "082f97122dd59d816a9a7b676d2b2f86a8ab6ed9" }, - "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, - "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, - "lualine.nvim": { "branch": "master", "commit": "834a5817f7e2be22a7062620032d49c600c35fab" }, - "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, - "mason-nvim-dap.nvim": { "branch": "main", "commit": "4c2cdc69d69fe00c15ae8648f7e954d99e5de3ea" }, - "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, - "mini.ai": { "branch": "main", "commit": "e139eb1101beb0250fea322f8c07a42f0f175688" }, - "mini.hipatterns": { "branch": "main", "commit": "e5083df391171dc9d8172645606f8496d9443374" }, - "mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" }, - "mini.pairs": { "branch": "main", "commit": "69864a2efb36c030877421634487fd90db1e4298" }, - "neo-tree.nvim": { "branch": "main", "commit": "73d63376352ac731379892e27ac7b3d9449148e3" }, - "noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" }, - "none-ls.nvim": { "branch": "main", "commit": "6377e77dae38015d0a8c24852530098f1d8a24f6" }, - "nui.nvim": { "branch": "main", "commit": "8d3bce9764e627b62b07424e0df77f680d47ffdb" }, - "nvim-autopairs": { "branch": "master", "commit": "2a406cdd8c373ae7fe378a9e062a5424472bd8d8" }, - "nvim-dap": { "branch": "master", "commit": "7aade9e99bef5f0735cf966e715b3ce45515d786" }, - "nvim-dap-ui": { "branch": "master", "commit": "bc81f8d3440aede116f821114547a476b082b319" }, - "nvim-dap-virtual-text": { "branch": "master", "commit": "df66808cd78b5a97576bbaeee95ed5ca385a9750" }, - "nvim-lint": { "branch": "master", "commit": "e7b4ffa6ab763af012e38b21af2c9159f10d2d33" }, - "nvim-lspconfig": { "branch": "master", "commit": "442e077e326ac467daf9cd63e72120fb450a850b" }, - "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, - "nvim-treesitter": { "branch": "master", "commit": "0e21ee8df6235511c02bab4a5b391d18e165a58d" }, - "nvim-treesitter-context": { "branch": "master", "commit": "439789a9a8df9639ecd749bb3286b77117024a6f" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "698b5f805722254bca3c509591c1806d268b6c2f" }, - "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, - "nvim-web-devicons": { "branch": "master", "commit": "57dfa947cc88cdf1baa2c7e13ed31edddd8fb1d1" }, - "persistence.nvim": { "branch": "main", "commit": "166a79a55bfa7a4db3e26fc031b4d92af71d0b51" }, - "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, - "snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, - "telescope.nvim": { "branch": "master", "commit": "a4ed82509cecc56df1c7138920a1aeaf246c0ac5" }, - "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, - "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, - "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, - "ts-comments.nvim": { "branch": "main", "commit": "1bd9d0ba1d8b336c3db50692ffd0955fe1bb9f0c" }, - "typescript-tools.nvim": { "branch": "master", "commit": "a4109c70e7d6a3a86f971cefea04ab6720582ba9" }, - "undotree": { "branch": "master", "commit": "b951b87b46c34356d44aa71886aecf9dd7f5788a" }, - "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }, - "yanky.nvim": { "branch": "main", "commit": "98b9c21d3c06d79f68fd9d471dcc28fc6d2d72ef" } -} diff --git a/.config/nvim.bak/lazyvim.json b/.config/nvim.bak/lazyvim.json deleted file mode 100644 index 6206f7e..0000000 --- a/.config/nvim.bak/lazyvim.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extras": [ - - ], - "install_version": 8, - "news": { - "NEWS.md": "10960" - }, - "version": 8 -} \ No newline at end of file diff --git a/.config/nvim.bak/lua/config/autocmds.lua b/.config/nvim.bak/lua/config/autocmds.lua deleted file mode 100644 index c400939..0000000 --- a/.config/nvim.bak/lua/config/autocmds.lua +++ /dev/null @@ -1,35 +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 --- with `vim.api.nvim_create_autocmd` --- --- Or remove existing autocmds by their group name (which is prefixed with `lazyvim_` for the defaults) --- e.g. vim.api.nvim_del_augroup_by_name("lazyvim_wrap_spell") - -vim.api.nvim_create_autocmd("FileType", { - pattern = { "python" }, - callback = function() - vim.opt_local.colorcolumn = "88" -- Black's default line length - vim.opt_local.tabstop = 4 - vim.opt_local.shiftwidth = 4 - end, -}) - -vim.api.nvim_create_autocmd("FileType", { - pattern = { "php" }, - callback = function() - vim.opt_local.colorcolumn = "120" - vim.opt_local.tabstop = 4 - vim.opt_local.shiftwidth = 4 - end, -}) - -vim.api.nvim_create_autocmd("FileType", { - pattern = { "typescript", "javascript", "typescriptreact", "javascriptreact" }, - callback = function() - vim.opt_local.colorcolumn = "80" - vim.opt_local.tabstop = 2 - vim.opt_local.shiftwidth = 2 - end, -}) diff --git a/.config/nvim.bak/lua/config/keymaps.lua b/.config/nvim.bak/lua/config/keymaps.lua deleted file mode 100644 index 46d9684..0000000 --- a/.config/nvim.bak/lua/config/keymaps.lua +++ /dev/null @@ -1,16 +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 --- Keymaps are automatically loaded on the VeryLazy event - -local function map(mode, lhs, rhs, opts) - local keys = require("lazy.core.handler").handlers.keys - if not keys.active[keys.parse({ lhs, mode = mode }).id] then - opts = opts or {} - opts.silent = opts.silent ~= false - vim.keymap.set(mode, lhs, rhs, opts) - end -end - --- Nรผtzliche Keymaps -map("n", "bo", "%bd|e#", { desc = "Close all buffers but the current one" }) diff --git a/.config/nvim.bak/lua/config/lazy.lua b/.config/nvim.bak/lua/config/lazy.lua deleted file mode 100644 index c225f35..0000000 --- a/.config/nvim.bak/lua/config/lazy.lua +++ /dev/null @@ -1,61 +0,0 @@ -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", - lazypath, - }) -end -vim.opt.rtp:prepend(lazypath) - -require("lazy").setup({ - spec = { - -- LazyVim Kern - { "LazyVim/LazyVim", import = "lazyvim.plugins" }, - - -- Sprachunterstรผtzung - { import = "lazyvim.plugins.extras.lang.typescript" }, - { import = "lazyvim.plugins.extras.lang.json" }, - { import = "lazyvim.plugins.extras.lang.docker" }, - { import = "lazyvim.plugins.extras.lang.yaml" }, - { import = "lazyvim.plugins.extras.lang.tailwind" }, - - -- Linting & Formatting - { import = "lazyvim.plugins.extras.linting.eslint" }, - { import = "lazyvim.plugins.extras.formatting.prettier" }, - { import = "lazyvim.plugins.extras.lsp.none-ls" }, - - -- Editor-Verbesserungen - -- { import = "lazyvim.plugins.extras.editor.mini-files" }, - { import = "lazyvim.plugins.extras.coding.yanky" }, - { import = "lazyvim.plugins.extras.util.mini-hipatterns" }, - - -- Debugging & Testing - { import = "lazyvim.plugins.extras.dap.core" }, - -- { import = "lazyvim.plugins.extras.test.core" }, - - -- Benutzerdefinierte Plugins - { import = "plugins" }, - }, - defaults = { - lazy = false, - version = false, - }, - install = { colorscheme = { "tokyonight", "catppuccin" } }, - checker = { enabled = true }, - - performance = { - rtp = { - disabled_plugins = { - "gzip", - "tarPlugin", - "tohtml", - "tutor", - "zipPlugin", - }, - }, - }, -}) diff --git a/.config/nvim.bak/lua/config/options.lua b/.config/nvim.bak/lua/config/options.lua deleted file mode 100644 index e0eef8f..0000000 --- a/.config/nvim.bak/lua/config/options.lua +++ /dev/null @@ -1,13 +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 ---- Options are automatically loaded before lazy.nvim startup - --- Allgemeine Einstellungen -vim.opt.listchars = "tab:โ–ธ ,trail:ยท,nbsp:โฃ,extends:โฏ,precedes:โฎ" -vim.opt.relativenumber = false -vim.opt.scrolloff = 10 -vim.opt.tabstop = 2 -vim.opt.shiftwidth = 2 -vim.opt.expandtab = true -vim.opt.smartindent = true -vim.lsp.inlay_hint.enable = false diff --git a/.config/nvim.bak/lua/plugins/coding.lua b/.config/nvim.bak/lua/plugins/coding.lua deleted file mode 100644 index 7bc517a..0000000 --- a/.config/nvim.bak/lua/plugins/coding.lua +++ /dev/null @@ -1,43 +0,0 @@ -return { - -- Code-Runner - { - "CRAG666/code_runner.nvim", - config = function() - require("code_runner").setup({ - focus = false, - filetype = { - python = "python3 -u", - typescript = "deno run", - javascript = "node", - php = "php", - }, - }) - end, - keys = { { "rf", "RunFile term", desc = "Run file" } }, - }, - - -- TypeScript-Tooling - { - "pmizio/typescript-tools.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - "neovim/nvim-lspconfig", - }, - opts = { - settings = { - tsserver_file_preferences = { - importModuleSpecifierPreference = "relative", - }, - }, - }, - }, - - -- Markdown-Vorschau - { - "iamcco/markdown-preview.nvim", - ft = "markdown", - build = function() - vim.fn["mkdp#util#install"]() - end, - }, -} diff --git a/.config/nvim.bak/lua/plugins/colorscheme.lua b/.config/nvim.bak/lua/plugins/colorscheme.lua deleted file mode 100644 index 66a704d..0000000 --- a/.config/nvim.bak/lua/plugins/colorscheme.lua +++ /dev/null @@ -1,43 +0,0 @@ -return { - -- Hauptfarbschema: Tokyo Night Storm - { - "folke/tokyonight.nvim", - lazy = false, - priority = 1000, - opts = { - style = "storm", - transparent = false, - styles = { - sidebars = "dark", - floats = "dark", - }, - }, - }, - - -- Alternative: Catppuccin - { - "catppuccin/nvim", - name = "catppuccin", - priority = 1000, - opts = { - flavour = "mocha", - transparent_background = false, - integrations = { - telescope = true, - gitsigns = true, - nvimtree = true, - indent_blankline = true, - which_key = true, - mini = true, - }, - }, - }, - - -- Aktiviere das Farbschema - { - "LazyVim/LazyVim", - opts = { - colorscheme = "tokyonight-storm", - }, - }, -} diff --git a/.config/nvim.bak/lua/plugins/lsp.lua b/.config/nvim.bak/lua/plugins/lsp.lua deleted file mode 100644 index 7e3e1f4..0000000 --- a/.config/nvim.bak/lua/plugins/lsp.lua +++ /dev/null @@ -1,191 +0,0 @@ -return { - -- LSP-Konfiguration - { - "neovim/nvim-lspconfig", - opts = { - servers = { - -- Python - pyright = {}, - ruff_lsp = {}, - - -- TypeScript/JavaScript - tsserver = { - settings = { - typescript = { - inlayHints = { - includeInlayParameterNameHints = "all", - includeInlayParameterNameHintsWhenArgumentMatchesName = false, - includeInlayFunctionParameterTypeHints = true, - includeInlayVariableTypeHints = true, - includeInlayPropertyDeclarationTypeHints = true, - includeInlayFunctionLikeReturnTypeHints = true, - }, - }, - javascript = { - inlayHints = { - includeInlayParameterNameHints = "all", - includeInlayParameterNameHintsWhenArgumentMatchesName = false, - includeInlayFunctionParameterTypeHints = true, - includeInlayVariableTypeHints = true, - includeInlayPropertyDeclarationTypeHints = true, - includeInlayFunctionLikeReturnTypeHints = true, - }, - }, - }, - }, - - -- PHP - intelephense = { - settings = { - intelephense = { - stubs = { - "bcmath", - "bz2", - "Core", - "curl", - "date", - "dom", - "fileinfo", - "filter", - "gd", - "gettext", - "hash", - "iconv", - "imap", - "intl", - "json", - "libxml", - "mbstring", - "mysqli", - "oci8", - "openssl", - "pcntl", - "pcre", - "PDO", - "pdo_mysql", - "Phar", - "readline", - "redis", - "Reflection", - "session", - "SimpleXML", - "SPL", - "standard", - "tokenizer", - "xml", - "xmlreader", - "xmlwriter", - "zip", - "zlib", - "wordpress", - "woocommerce", - "wordpress-globals", - "wp-cli", - }, - environment = { - includePaths = {}, - }, - files = { - maxSize = 5000000, - }, - }, - }, - }, - - -- Docker - dockerls = {}, - docker_compose_language_service = {}, - - -- YAML - yamlls = { - settings = { - yaml = { - schemaStore = { - enable = true, - url = "https://www.schemastore.org/api/json/catalog.json", - }, - format = { enable = true }, - validate = true, - }, - }, - }, - }, - }, - }, - - -- Mason fรผr einfache Tool-Installation - { - "williamboman/mason.nvim", - opts = function(_, opts) - opts.ensure_installed = opts.ensure_installed or {} - vim.list_extend(opts.ensure_installed, { - -- Python - "pyright", - "ruff-lsp", - "black", - "mypy", - - -- TypeScript/JavaScript - "typescript-language-server", - "eslint-lsp", - "prettier", - - -- PHP - "intelephense", - "php-cs-fixer", - - -- Docker - "dockerfile-language-server", - - -- YAML - "yaml-language-server", - "yamllint", - "yamlfix", - - -- Neue Tools fรผr alle Frameworks - "css-lsp", - "tailwindcss-language-server", - "vue-language-server", - "typescript-language-server", - "eslint-lsp", - "prettier", - "stylelint-lsp", - "phpactor", - }) - end, - }, - - -- Formatierung - { - "stevearc/conform.nvim", - opts = { - formatters_by_ft = { - lua = { "stylua" }, - python = { "black" }, - typescript = { "prettier" }, - javascript = { "prettier" }, - typescriptreact = { "prettier" }, - javascriptreact = { "prettier" }, - php = { "php_cs_fixer" }, - yaml = { "yamlfix" }, - json = { "prettier" }, - markdown = { "prettier" }, - }, - }, - }, - - -- Linting - { - "mfussenegger/nvim-lint", - opts = { - linters_by_ft = { - python = { "mypy", "ruff" }, - typescript = { "eslint" }, - javascript = { "eslint" }, - typescriptreact = { "eslint" }, - javascriptreact = { "eslint" }, - yaml = { "yamllint" }, - }, - }, - }, -} diff --git a/.config/nvim.bak/lua/plugins/neo-tree.lua b/.config/nvim.bak/lua/plugins/neo-tree.lua deleted file mode 100644 index 7a7b117..0000000 --- a/.config/nvim.bak/lua/plugins/neo-tree.lua +++ /dev/null @@ -1,54 +0,0 @@ -return { - "nvim-neo-tree/neo-tree.nvim", - cmd = "Neotree", - priority = 950, -- Hรถhere Prioritรคt fรผr korrekte Initialisierung - lazy = false, -- Verhindert lazy-loading - config = function() - -- Stelle sicher, dass die Konfiguration direkt angewendet wird - require("neo-tree").setup({ - sources = { "filesystem", "buffers", "git_status" }, - filesystem = { - filtered_items = { - visible = true, -- Zeigt gefilterte Elemente an - hide_dotfiles = false, -- Versteckte Dateien anzeigen - hide_gitignored = false, -- Git-ignorierte Dateien anzeigen - always_show = { - ".gitignore", - ".env", - ".gitlab-ci.yml", - ".php-cs-fixer.php", - }, - }, - follow_current_file = { - enabled = true, -- Folgt der aktuellen Datei - }, - use_libuv_file_watcher = true, - }, - window = { - position = "right", -- Position explizit auf rechts setzen - width = 35, -- Breite des Explorers - mappings = { - [""] = "none", -- Deaktiviert die Space-Taste im Explorer - ["H"] = "toggle_hidden", -- Tastenkombination zum Umschalten versteckter Dateien - }, - }, - default_component_configs = { - indent = { - with_expanders = true, - }, - }, - }) - -- Starte Neotree explizit nach der Konfiguration neu - vim.defer_fn(function() - vim.cmd("Neotree close") - vim.cmd("Neotree position=right") - end, 100) - end, - init = function() - -- Fรผhre diese Konfiguration sofort aus - vim.g.neo_tree_remove_legacy_commands = 1 - end, - keys = { - { "e", "Neotree toggle show position=right", desc = "Explorer (rechts)" }, - }, -} diff --git a/.config/nvim.bak/lua/plugins/telescope.lua b/.config/nvim.bak/lua/plugins/telescope.lua deleted file mode 100644 index a8352d8..0000000 --- a/.config/nvim.bak/lua/plugins/telescope.lua +++ /dev/null @@ -1,27 +0,0 @@ -return { - -- Telescope-Konfiguration - { - "nvim-telescope/telescope.nvim", - opts = { - defaults = { - file_ignore_patterns = { - "^.git/", - "^node_modules/", - "^vendor/", - "^.venv/", - "^__pycache__/", - }, - }, - }, - dependencies = { - -- Fuzzy-Finder-Verbesserung - { - "nvim-telescope/telescope-fzf-native.nvim", - build = "make", - config = function() - require("telescope").load_extension("fzf") - end, - }, - }, - }, -} diff --git a/.config/nvim.bak/lua/plugins/tools.lua b/.config/nvim.bak/lua/plugins/tools.lua deleted file mode 100644 index 08787fe..0000000 --- a/.config/nvim.bak/lua/plugins/tools.lua +++ /dev/null @@ -1,38 +0,0 @@ -return { - -- Auto-Pairs fรผr schnelleres Schreiben - { - "windwp/nvim-autopairs", - event = "InsertEnter", - opts = { - enable_check_bracket_line = true, - }, - }, - - -- Diffview fรผr Git-Diffs - { - "sindrets/diffview.nvim", - dependencies = { - { "nvim-lua/plenary.nvim" }, - { "nvim-tree/nvim-web-devicons" }, - }, - config = function() - vim.opt.fillchars = "diff:โ–‘" - require("diffview").setup({ - enhanced_diff_hl = true, - }) - end, - keys = { - { "gdo", ":DiffviewOpen", desc = "Open Diffview" }, - { "gdc", ":DiffviewClose", desc = "Close Diffview" }, - }, - }, - - -- Undotree fรผr detaillierte ร„nderungshistorie - { - "mbbill/undotree", - cmd = "UndotreeToggle", - keys = { - { "fu", "UndotreeToggle", desc = "Undo tree" }, - }, - }, -} diff --git a/.config/nvim.bak/lua/plugins/treesitter.lua b/.config/nvim.bak/lua/plugins/treesitter.lua deleted file mode 100644 index 06b4e3d..0000000 --- a/.config/nvim.bak/lua/plugins/treesitter.lua +++ /dev/null @@ -1,46 +0,0 @@ -return { - { - "nvim-treesitter/nvim-treesitter", - opts = { - ensure_installed = { - "bash", - "css", - "dockerfile", - "html", - "javascript", - "json", - "lua", - "markdown", - "markdown_inline", - "php", - "python", - "regex", - "tsx", - "typescript", - "vim", - "yaml", - }, - highlight = { - enable = true, - }, - indent = { - enable = true, - }, - autotag = { - enable = true, - }, - }, - }, - - -- Zusรคtzliche Treesitter-Erweiterungen - { - "nvim-treesitter/nvim-treesitter-context", - dependencies = { "nvim-treesitter/nvim-treesitter" }, - }, - - -- Automatisches Hinzufรผgen/SchlieรŸen von HTML/JSX-Tags - { - "windwp/nvim-ts-autotag", - config = true, - }, -} diff --git a/.config/nvim.bak/stylua.toml b/.config/nvim.bak/stylua.toml deleted file mode 100644 index 5d6c50d..0000000 --- a/.config/nvim.bak/stylua.toml +++ /dev/null @@ -1,3 +0,0 @@ -indent_type = "Spaces" -indent_width = 2 -column_width = 120 \ No newline at end of file diff --git a/.config/nvim/.github/ISSUE_TEMPLATE/bug_report.md b/.config/nvim/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 86598b8..0000000 --- a/.config/nvim/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - ---- - - - -## Before Reporting an Issue -- I have read the kickstart.nvim README.md. -- I have read the appropriate plugin's documentation. -- I have searched that this issue has not been reported before. - -- [ ] **By checking this, I confirm that the above steps are completed. I understand leaving this unchecked will result in this report being closed immediately.** - -## Describe the bug - - -## To Reproduce - -1. ... - -## Desktop - -- OS: -- Terminal: - -## Neovim Version - - -``` -``` diff --git a/.config/nvim/.github/pull_request_template.md b/.config/nvim/.github/pull_request_template.md deleted file mode 100644 index f401c9f..0000000 --- a/.config/nvim/.github/pull_request_template.md +++ /dev/null @@ -1,8 +0,0 @@ -*************************************************************************** -**NOTE** -Please verify that the `base repository` above has the intended destination! -Github by default opens Pull Requests against the parent of a forked repository. -If this is your personal fork and you didn't intend to open a PR for contribution -to the original project then adjust the `base repository` accordingly. -************************************************************************** - diff --git a/.config/nvim/.github/workflows/stylua.yml b/.config/nvim/.github/workflows/stylua.yml deleted file mode 100644 index 75db6c3..0000000 --- a/.config/nvim/.github/workflows/stylua.yml +++ /dev/null @@ -1,21 +0,0 @@ -# Check Lua Formatting -name: Check Lua Formatting -on: pull_request_target - -jobs: - stylua-check: - if: github.repository == 'nvim-lua/kickstart.nvim' - name: Stylua Check - runs-on: ubuntu-latest - steps: - - name: Checkout Code - uses: actions/checkout@v2 - with: - ref: ${{ github.event.pull_request.head.sha }} - - name: Stylua Check - uses: JohnnyMorganz/stylua-action@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version: latest - args: --check . - diff --git a/.config/nvim/.gitignore b/.config/nvim/.gitignore index 005b535..58b34eb 100644 --- a/.config/nvim/.gitignore +++ b/.config/nvim/.gitignore @@ -1,7 +1,16 @@ -tags -test.sh -.luarc.json -nvim - -spell/ +# Neovim lazy-lock.json +.neoconf.json + +# Plugin data +plugin/ +spell/ + +# Treesitter compiled parsers +parser/ + +# Undo history +*~ + +# OS +.DS_Store diff --git a/.config/nvim/.stylua.toml b/.config/nvim/.stylua.toml deleted file mode 100644 index 139e939..0000000 --- a/.config/nvim/.stylua.toml +++ /dev/null @@ -1,6 +0,0 @@ -column_width = 160 -line_endings = "Unix" -indent_type = "Spaces" -indent_width = 2 -quote_style = "AutoPreferSingle" -call_parentheses = "None" diff --git a/.config/nvim/LICENSE.md b/.config/nvim/LICENSE.md deleted file mode 100644 index 9cf1062..0000000 --- a/.config/nvim/LICENSE.md +++ /dev/null @@ -1,19 +0,0 @@ -MIT License - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/.config/nvim/README.md b/.config/nvim/README.md index 8ace8b9..4181544 100644 --- a/.config/nvim/README.md +++ b/.config/nvim/README.md @@ -1,240 +1,241 @@ -# kickstart.nvim +# Neovim Configuration - Built from Scratch -## Introduction +Moderne, minimale Neovim Config optimiert fรผr **TypeScript/Playwright QA** und **Go Development**. -A starting point for Neovim that is: +## ๐ŸŽฏ Philosophie -* Small -* Single-file -* Completely Documented +- **Scratch mit lazy.nvim**: Keine Distro, keine Abstraktionen +- **TypeScript First**: Optimiert fรผr Playwright Tests +- **Go Ready**: Volle gopls Integration +- **Verstรคndlich**: Jede Datei hat einen klaren Zweck +- **Wartbar**: Standard Neovim APIs, keine Magie -**NOT** a Neovim distribution, but instead a starting point for your configuration. - -## Installation - -### Install Neovim - -Kickstart.nvim targets *only* the latest -['stable'](https://github.com/neovim/neovim/releases/tag/stable) and latest -['nightly'](https://github.com/neovim/neovim/releases/tag/nightly) of Neovim. -If you are experiencing issues, please make sure you have the latest versions. - -### Install External Dependencies - -External Requirements: -- Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`) -- [ripgrep](https://github.com/BurntSushi/ripgrep#installation) -- Clipboard tool (xclip/xsel/win32yank or other depending on the platform) -- A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons - - if you have it set `vim.g.have_nerd_font` in `init.lua` to true -- Emoji fonts (Ubuntu only, and only if you want emoji!) `sudo apt install fonts-noto-color-emoji` -- Language Setup: - - If you want to write Typescript, you need `npm` - - If you want to write Golang, you will need `go` - - etc. - -> [!NOTE] -> See [Install Recipes](#Install-Recipes) for additional Windows and Linux specific notes -> and quick install snippets - -### Install Kickstart - -> [!NOTE] -> [Backup](#FAQ) your previous configuration (if any exists) - -Neovim's configurations are located under the following paths, depending on your OS: - -| OS | PATH | -| :- | :--- | -| Linux, MacOS | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` | -| Windows (cmd)| `%localappdata%\nvim\` | -| Windows (powershell)| `$env:LOCALAPPDATA\nvim\` | - -#### Recommended Step - -[Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repo -so that you have your own copy that you can modify, then install by cloning the -fork to your machine using one of the commands below, depending on your OS. - -> [!NOTE] -> Your fork's URL will be something like this: -> `https://github.com//kickstart.nvim.git` - -You likely want to remove `lazy-lock.json` from your fork's `.gitignore` file -too - it's ignored in the kickstart repo to make maintenance easier, but it's -[recommended to track it in version control](https://lazy.folke.io/usage/lockfile). - -#### Clone kickstart.nvim - -> [!NOTE] -> If following the recommended step above (i.e., forking the repo), replace -> `nvim-lua` with `` in the commands below - -
Linux and Mac - -```sh -git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim -``` - -
- -
Windows - -If you're using `cmd.exe`: +## ๐Ÿ“ Struktur ``` -git clone https://github.com/nvim-lua/kickstart.nvim.git "%localappdata%\nvim" +~/.config/nvim/ +โ”œโ”€โ”€ init.lua # Entry point +โ”œโ”€โ”€ lua/ +โ”‚ โ”œโ”€โ”€ core/ +โ”‚ โ”‚ โ”œโ”€โ”€ options.lua # Vim Settings +โ”‚ โ”‚ โ”œโ”€โ”€ keymaps.lua # Keybindings +โ”‚ โ”‚ โ””โ”€โ”€ lazy.lua # lazy.nvim Bootstrap +โ”‚ โ””โ”€โ”€ plugins/ +โ”‚ โ”œโ”€โ”€ lsp.lua # LSP (ts_ls, gopls, etc.) +โ”‚ โ”œโ”€โ”€ completion.lua # nvim-cmp +โ”‚ โ”œโ”€โ”€ treesitter.lua # Syntax Highlighting +โ”‚ โ”œโ”€โ”€ telescope.lua # Fuzzy Finder +โ”‚ โ”œโ”€โ”€ harpoon.lua # File Navigation +โ”‚ โ”œโ”€โ”€ neotree.lua # File Explorer +โ”‚ โ”œโ”€โ”€ git.lua # Git Integration +โ”‚ โ”œโ”€โ”€ formatting.lua # Code Formatting +โ”‚ โ”œโ”€โ”€ ui.lua # Theme + Statusline +โ”‚ โ””โ”€โ”€ editor.lua # QoL Plugins ``` -If you're using `powershell.exe` +## ๐Ÿš€ Installation -``` -git clone https://github.com/nvim-lua/kickstart.nvim.git "${env:LOCALAPPDATA}\nvim" +### Prerequisites + +```bash +# Neovim 0.10+ +brew install neovim + +# Ripgrep (fรผr Telescope) +brew install ripgrep + +# Node.js (fรผr TypeScript LSP) +brew install node + +# Go (fรผr gopls) +brew install go ``` -
+### Setup -### Post Installation +```bash +# Backup alte Config (falls vorhanden) +mv ~/.config/nvim ~/.config/nvim.backup -Start Neovim +# Symlink aus dotfiles +ln -sf ~/gits/dotfiles/.config/nvim ~/.config/nvim -```sh +# Neovim starten - lazy.nvim installiert automatisch nvim ``` -That's it! Lazy will install all the plugins you have. Use `:Lazy` to view -the current plugin status. Hit `q` to close the window. +Beim ersten Start: +1. lazy.nvim installiert sich selbst +2. Alle Plugins werden geladen +3. Mason installiert LSP Server automatisch +4. Treesitter installiert Parser -#### Read The Friendly Documentation +**Warte bis alles fertig ist!** (~2-3 Minuten) -Read through the `init.lua` file in your configuration folder for more -information about extending and exploring Neovim. That also includes -examples of adding popularly requested plugins. +## โŒจ๏ธ Key Bindings -> [!NOTE] -> For more information about a particular plugin check its repository's documentation. +### Leader Key: `Space` +### Core +- `w` - Save file +- `` - Clear search highlight +- `jk` / `jj` - Exit insert mode -### Getting Started +### Navigation +- `` - Navigate windows +- `` - Previous/Next buffer +- `bd` - Delete buffer -[The Only Video You Need to Get Started with Neovim](https://youtu.be/m8C0Cq9Uv9o) +### Telescope (Find) +- `ff` - Find files +- `fg` - Live grep +- `fb` - Buffers +- `fo` - Recent files +- `fw` - Find word under cursor +- `fd` - Diagnostics +- `/` - Search in buffer -### FAQ +### Harpoon (File Navigation) +- `a` - Add file to Harpoon +- `h` - Toggle Harpoon menu +- `` - Jump to file 1/2/3/4 -* What should I do if I already have a pre-existing Neovim configuration? - * You should back it up and then delete all associated files. - * This includes your existing init.lua and the Neovim files in `~/.local` - which can be deleted with `rm -rf ~/.local/share/nvim/` -* Can I keep my existing configuration in parallel to kickstart? - * Yes! You can use [NVIM_APPNAME](https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME)`=nvim-NAME` - to maintain multiple configurations. For example, you can install the kickstart - configuration in `~/.config/nvim-kickstart` and create an alias: - ``` - alias nvim-kickstart='NVIM_APPNAME="nvim-kickstart" nvim' - ``` - When you run Neovim using `nvim-kickstart` alias it will use the alternative - config directory and the matching local directory - `~/.local/share/nvim-kickstart`. You can apply this approach to any Neovim - distribution that you would like to try out. -* What if I want to "uninstall" this configuration: - * See [lazy.nvim uninstall](https://lazy.folke.io/usage#-uninstalling) information -* Why is the kickstart `init.lua` a single file? Wouldn't it make sense to split it into multiple files? - * The main purpose of kickstart is to serve as a teaching tool and a reference - configuration that someone can easily use to `git clone` as a basis for their own. - As you progress in learning Neovim and Lua, you might consider splitting `init.lua` - into smaller parts. A fork of kickstart that does this while maintaining the - same functionality is available here: - * [kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim) - * Discussions on this topic can be found here: - * [Restructure the configuration](https://github.com/nvim-lua/kickstart.nvim/issues/218) - * [Reorganize init.lua into a multi-file setup](https://github.com/nvim-lua/kickstart.nvim/pull/473) +### Neo-tree (Explorer) +- `e` - Toggle explorer +- `ef` - Focus filesystem +- `eb` - Focus buffers +- `eg` - Focus git status -### Install Recipes +### LSP +- `gd` - Goto definition +- `gr` - Goto references +- `gI` - Goto implementation +- `K` - Hover documentation +- `ca` - Code action +- `rn` - Rename +- `[d` / `]d` - Previous/Next diagnostic -Below you can find OS specific install instructions for Neovim and dependencies. +### Git +- `gs` - Git status (Fugitive) +- `gc` - Git commit +- `gp` - Git push +- `gb` - Git blame +- `hs` - Stage hunk +- `hr` - Reset hunk +- `hp` - Preview hunk +- `[c` / `]c` - Previous/Next git hunk -After installing all the dependencies continue with the [Install Kickstart](#Install-Kickstart) step. +### Go Specific +- `ee` - Insert `if err != nil { return err }` -#### Windows Installation +### Formatting +- `cf` - Format buffer +- `:FormatDisable` - Disable auto-format +- `:FormatEnable` - Enable auto-format -
Windows with Microsoft C++ Build Tools and CMake -Installation may require installing build tools and updating the run command for `telescope-fzf-native` +## ๐Ÿ› ๏ธ LSP Servers -See `telescope-fzf-native` documentation for [more details](https://github.com/nvim-telescope/telescope-fzf-native.nvim#installation) +Automatisch installiert via Mason: +- **ts_ls** - TypeScript/JavaScript (Playwright) +- **gopls** - Go +- **lua_ls** - Lua +- **html** - HTML +- **cssls** - CSS +- **jsonls** - JSON (mit Schema support) +- **yamlls** - YAML (mit Schema support) +- **dockerls** - Dockerfile +- **docker_compose_language_service** - Docker Compose -This requires: +### Weitere Sprachen hinzufรผgen -- Install CMake and the Microsoft C++ Build Tools on Windows +1. ร–ffne `lua/plugins/lsp.lua` +2. Fรผge Server zu `ensure_installed` hinzu +3. Fรผge Server Config hinzu (siehe Beispiele im File) +4. `:Mason` - Check ob installiert +## ๐Ÿ”ง Customization + +### Options รคndern +Editiere `lua/core/options.lua`: ```lua -{'nvim-telescope/telescope-fzf-native.nvim', build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' } -``` -
-
Windows with gcc/make using chocolatey -Alternatively, one can install gcc and make which don't require changing the config, -the easiest way is to use choco: - -1. install [chocolatey](https://chocolatey.org/install) -either follow the instructions on the page or use winget, -run in cmd as **admin**: -``` -winget install --accept-source-agreements chocolatey.chocolatey +opt.relativenumber = true -- Enable relative numbers ``` -2. install all requirements using choco, exit the previous cmd and -open a new one so that choco path is set, and run in cmd as **admin**: +### Keybindings รคndern +Editiere `lua/core/keymaps.lua`: +```lua +keymap('n', 'ff', 'Telescope find_files') ``` -choco install -y neovim git ripgrep wget fd unzip gzip mingw make -``` -
-
WSL (Windows Subsystem for Linux) +### Plugin hinzufรผgen +Neue Datei in `lua/plugins/`: +```lua +-- lua/plugins/myplugin.lua +return { + { + 'author/plugin-name', + config = function() + -- Setup here + end, + }, +} ``` -wsl --install -wsl -sudo add-apt-repository ppa:neovim-ppa/unstable -y -sudo apt update -sudo apt install make gcc ripgrep unzip git xclip neovim -``` -
- -#### Linux Install -
Ubuntu Install Steps +### Plugin entfernen +Datei lรถschen oder Plugin auskommentieren, dann: +```vim +:Lazy clean ``` -sudo add-apt-repository ppa:neovim-ppa/unstable -y -sudo apt update -sudo apt install make gcc ripgrep unzip git xclip neovim -``` -
-
Debian Install Steps -``` -sudo apt update -sudo apt install make gcc ripgrep unzip git xclip curl +## ๐Ÿ› Troubleshooting -# Now we install nvim -curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz -sudo rm -rf /opt/nvim-linux-x86_64 -sudo mkdir -p /opt/nvim-linux-x86_64 -sudo chmod a+rX /opt/nvim-linux-x86_64 -sudo tar -C /opt -xzf nvim-linux-x86_64.tar.gz - -# make it available in /usr/local/bin, distro installs to /usr/bin -sudo ln -sf /opt/nvim-linux-x86_64/bin/nvim /usr/local/bin/ +### LSP funktioniert nicht +```vim +:LspInfo " Check LSP status +:Mason " Check installed servers +:checkhealth " General health check ``` -
-
Fedora Install Steps +### Plugin-Probleme +```vim +:Lazy " Plugin manager UI +:Lazy sync " Update all plugins +:Lazy clean " Remove unused plugins ``` -sudo dnf install -y gcc make git ripgrep fd-find unzip neovim -``` -
- -
Arch Install Steps +### Performance +```vim +:Lazy profile " Check startup time ``` -sudo pacman -S --noconfirm --needed gcc make git ripgrep fd unzip neovim -``` -
+## ๐Ÿ“ฆ Updates + +```bash +# In Neovim: +:Lazy sync # Update plugins + +# Mason LSP updates: +:Mason # Then 'U' fรผr update all +``` + +## ๐ŸŽ“ Lernen + +Wenn du was nicht verstehst: +1. Schau in die entsprechende Datei (gut kommentiert!) +2. `:help ` nutzen +3. Frag Claude ๐Ÿ˜Š + +## ๐Ÿšจ Wichtig + +- **Backup**: Alte Config ist in `~/.config/nvim.kickstart-backup` +- **Dotfiles**: Diese Config sollte in Git sein! +- **Updates**: RegelmรครŸig `:Lazy sync` und `:Mason` checken + +## ๐Ÿ“ ร„nderungslog + +- **2024-10**: Initial Scratch Build + - TypeScript/Playwright optimiert + - Go Support + - Moderne LSP APIs (vim.lsp.config) + - Harpoon v2 + - Clean, modular structure diff --git a/.config/nvim/doc/kickstart.txt b/.config/nvim/doc/kickstart.txt deleted file mode 100644 index cb87ac3..0000000 --- a/.config/nvim/doc/kickstart.txt +++ /dev/null @@ -1,24 +0,0 @@ -================================================================================ -INTRODUCTION *kickstart.nvim* - -Kickstart.nvim is a project to help you get started on your neovim journey. - - *kickstart-is-not* -It is not: -- Complete framework for every plugin under the sun -- Place to add every plugin that could ever be useful - - *kickstart-is* -It is: -- Somewhere that has a good start for the most common "IDE" type features: - - autocompletion - - goto-definition - - find references - - fuzzy finding - - and hinting at what more can be done :) -- A place to _kickstart_ your journey. - - You should fork this project and use/modify it so that it matches your - style and preferences. If you don't want to do that, there are probably - other projects that would fit much better for you (and that's great!)! - - vim:tw=78:ts=8:ft=help:norl: diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 43bcb96..fc9c52f 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,64 +1,15 @@ --- Grundeinstellungen +-- ============================================================================ +-- Neovim Config - Built from Scratch +-- Optimiert fรผr TypeScript/Playwright QA und Go Development +-- ============================================================================ + +-- Leader key muss VOR lazy.nvim gesetzt werden vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -vim.opt.number = true -vim.opt.relativenumber = false -vim.opt.mouse = 'a' -vim.opt.showmode = false -vim.opt.clipboard = 'unnamedplus' -vim.opt.breakindent = true -vim.opt.undofile = true -vim.opt.ignorecase = true -vim.opt.smartcase = true -vim.opt.signcolumn = 'yes' -vim.opt.updatetime = 250 -vim.opt.timeoutlen = 300 -vim.opt.splitright = true -vim.opt.splitbelow = true -vim.opt.list = true -vim.opt.listchars = { tab = 'ยป ', trail = 'ยท', nbsp = 'โฃ' } -vim.opt.inccommand = 'split' -vim.opt.cursorline = true -vim.opt.scrolloff = 10 -vim.opt.hlsearch = true --- Lade lazy.nvim -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- neueste stabile Version - lazypath, - }) -end -vim.opt.rtp:prepend(lazypath) +-- Core Einstellungen laden +require('core.options') +require('core.keymaps') +require('core.lazy') --- Lade Plugins -require("lazy").setup({ - -- Grundlegende Plugins - { import = "custom.plugins" }, - - -- Colorscheme - { - "folke/tokyonight.nvim", - lazy = false, - priority = 1000, - config = function() - require("tokyonight").setup({ - style = "storm", - transparent = false, - terminal_colors = true, - }) - vim.cmd.colorscheme "tokyonight" - end, - }, -}) - --- Lade benutzerdefinierte Einstellungen -require("custom.config") - --- Lade Spracheinstellungen -require("custom.lsp") +-- Nach Plugin-Load: LSP und weitere Configs werden automatisch geladen diff --git a/.config/nvim/init.lua.bak b/.config/nvim/init.lua.bak deleted file mode 100644 index cbf9ff6..0000000 --- a/.config/nvim/init.lua.bak +++ /dev/null @@ -1,1033 +0,0 @@ ---[[ - -===================================================================== -==================== READ THIS BEFORE CONTINUING ==================== -===================================================================== -======== .-----. ======== -======== .----------------------. | === | ======== -======== |.-""""""""""""""""""-.| |-----| ======== -======== || || | === | ======== -======== || KICKSTART.NVIM || |-----| ======== -======== || || | === | ======== -======== || || |-----| ======== -======== ||:Tutor || |:::::| ======== -======== |'-..................-'| |____o| ======== -======== `"")----------------(""` ___________ ======== -======== /::::::::::| |::::::::::\ \ no mouse \ ======== -======== /:::========| |==hjkl==:::\ \ required \ ======== -======== '""""""""""""' '""""""""""""' '""""""""""' ======== -======== ======== -===================================================================== -===================================================================== - -What is Kickstart? - - Kickstart.nvim is *not* a distribution. - - Kickstart.nvim is a starting point for your own configuration. - The goal is that you can read every line of code, top-to-bottom, understand - what your configuration is doing, and modify it to suit your needs. - - Once you've done that, you can start exploring, configuring and tinkering to - make Neovim your own! That might mean leaving Kickstart just the way it is for a while - or immediately breaking it into modular pieces. It's up to you! - - If you don't know anything about Lua, I recommend taking some time to read through - a guide. One possible example which will only take 10-15 minutes: - - https://learnxinyminutes.com/docs/lua/ - - After understanding a bit more about Lua, you can use `:help lua-guide` as a - reference for how Neovim integrates Lua. - - :help lua-guide - - (or HTML version): https://neovim.io/doc/user/lua-guide.html - -Kickstart Guide: - - TODO: The very first thing you should do is to run the command `:Tutor` in Neovim. - - If you don't know what this means, type the following: - - - - : - - Tutor - - - - (If you already know the Neovim basics, you can skip this step.) - - Once you've completed that, you can continue working through **AND READING** the rest - of the kickstart init.lua. - - Next, run AND READ `:help`. - This will open up a help window with some basic information - about reading, navigating and searching the builtin help documentation. - - This should be the first place you go to look when you're stuck or confused - with something. It's one of my favorite Neovim features. - - MOST IMPORTANTLY, we provide a keymap "sh" to [s]earch the [h]elp documentation, - which is very useful when you're not exactly sure of what you're looking for. - - I have left several `:help X` comments throughout the init.lua - These are hints about where to find more information about the relevant settings, - plugins or Neovim features used in Kickstart. - - NOTE: Look for lines like this - - Throughout the file. These are for you, the reader, to help you understand what is happening. - Feel free to delete them once you know what you're doing, but they should serve as a guide - for when you are first encountering a few different constructs in your Neovim config. - -If you experience any errors while trying to install kickstart, run `:checkhealth` for more info. - -I hope you enjoy your Neovim journey, -- TJ - -P.S. You can delete this when you're done too. It's your config now! :) ---]] - --- Set as the leader key --- See `:help mapleader` --- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) -vim.g.mapleader = ' ' -vim.g.maplocalleader = ' ' - --- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = false - --- [[ Setting options ]] --- See `:help vim.opt` --- NOTE: You can change these options as you wish! --- For more options, you can see `:help option-list` - --- Make line numbers default -vim.opt.number = true --- You can also add relative line numbers, to help with jumping. --- Experiment for yourself to see if you like it! --- vim.opt.relativenumber = true - --- Enable mouse mode, can be useful for resizing splits for example! -vim.opt.mouse = 'a' - --- Don't show the mode, since it's already in the status line -vim.opt.showmode = false - --- Sync clipboard between OS and Neovim. --- Schedule the setting after `UiEnter` because it can increase startup-time. --- Remove this option if you want your OS clipboard to remain independent. --- See `:help 'clipboard'` -vim.schedule(function() - vim.opt.clipboard = 'unnamedplus' -end) - --- Enable break indent -vim.opt.breakindent = true - --- Save undo history -vim.opt.undofile = true - --- Case-insensitive searching UNLESS \C or one or more capital letters in the search term -vim.opt.ignorecase = true -vim.opt.smartcase = true - --- Keep signcolumn on by default -vim.opt.signcolumn = 'yes' - --- Decrease update time -vim.opt.updatetime = 250 - --- Decrease mapped sequence wait time -vim.opt.timeoutlen = 300 - --- Configure how new splits should be opened -vim.opt.splitright = true -vim.opt.splitbelow = true - --- Sets how neovim will display certain whitespace characters in the editor. --- See `:help 'list'` --- and `:help 'listchars'` -vim.opt.list = true -vim.opt.listchars = { tab = 'ยป ', trail = 'ยท', nbsp = 'โฃ' } - --- Preview substitutions live, as you type! -vim.opt.inccommand = 'split' - --- Show which line your cursor is on -vim.opt.cursorline = true - --- Minimal number of screen lines to keep above and below the cursor. -vim.opt.scrolloff = 10 - --- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`), --- instead raise a dialog asking if you wish to save the current file(s) --- See `:help 'confirm'` -vim.opt.confirm = true - --- [[ Basic Keymaps ]] --- See `:help vim.keymap.set()` - --- Clear highlights on search when pressing in normal mode --- See `:help hlsearch` -vim.keymap.set('n', '', 'nohlsearch') - --- Diagnostic keymaps -vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) - --- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier --- for people to discover. Otherwise, you normally need to press , which --- is not what someone will guess without a bit more experience. --- --- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping --- or just use to exit terminal mode -vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) - --- TIP: Disable arrow keys in normal mode --- vim.keymap.set('n', '', 'echo "Use h to move!!"') --- vim.keymap.set('n', '', 'echo "Use l to move!!"') --- vim.keymap.set('n', '', 'echo "Use k to move!!"') --- vim.keymap.set('n', '', 'echo "Use j to move!!"') - --- Keybinds to make split navigation easier. --- Use CTRL+ to switch between windows --- --- See `:help wincmd` for a list of all window commands -vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) - --- NOTE: Some terminals have coliding keymaps or are not able to send distinct keycodes --- vim.keymap.set("n", "", "H", { desc = "Move window to the left" }) --- vim.keymap.set("n", "", "L", { desc = "Move window to the right" }) --- vim.keymap.set("n", "", "J", { desc = "Move window to the lower" }) --- vim.keymap.set("n", "", "K", { desc = "Move window to the upper" }) - --- [[ Basic Autocommands ]] --- See `:help lua-guide-autocommands` - --- Highlight when yanking (copying) text --- Try it with `yap` in normal mode --- See `:help vim.highlight.on_yank()` -vim.api.nvim_create_autocmd('TextYankPost', { - desc = 'Highlight when yanking (copying) text', - group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), - callback = function() - vim.highlight.on_yank() - end, -}) - --- [[ Install `lazy.nvim` plugin manager ]] --- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info -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 - error('Error cloning lazy.nvim:\n' .. out) - end -end ---@diagnostic disable-next-line: undefined-field -vim.opt.rtp:prepend(lazypath) - --- [[ Configure and install plugins ]] --- --- To check the current status of your plugins, run --- :Lazy --- --- You can press `?` in this menu for help. Use `:q` to close the window --- --- To update plugins you can run --- :Lazy update --- --- NOTE: Here is where you install your plugins. -require('lazy').setup({ - -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). - 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically - - -- NOTE: Plugins can also be added by using a table, - -- with the first argument being the link and the following - -- keys can be used to configure plugin behavior/loading/etc. - -- - -- Use `opts = {}` to automatically pass options to a plugin's `setup()` function, forcing the plugin to be loaded. - -- - - -- Alternatively, use `config = function() ... end` for full control over the configuration. - -- If you prefer to call `setup` explicitly, use: - -- { - -- 'lewis6991/gitsigns.nvim', - -- config = function() - -- require('gitsigns').setup({ - -- -- Your gitsigns configuration here - -- }) - -- end, - -- } - -- - -- Here is a more advanced example where we pass configuration - -- options to `gitsigns.nvim`. - -- - -- See `:help gitsigns` to understand what the configuration keys do - { -- Adds git related signs to the gutter, as well as utilities for managing changes - 'lewis6991/gitsigns.nvim', - opts = { - signs = { - add = { text = '+' }, - change = { text = '~' }, - delete = { text = '_' }, - topdelete = { text = 'โ€พ' }, - changedelete = { text = '~' }, - }, - }, - }, - - -- NOTE: Plugins can also be configured to run Lua code when they are loaded. - -- - -- This is often very useful to both group configuration, as well as handle - -- lazy loading plugins that don't need to be loaded immediately at startup. - -- - -- For example, in the following configuration, we use: - -- event = 'VimEnter' - -- - -- which loads which-key before all the UI elements are loaded. Events can be - -- normal autocommands events (`:help autocmd-events`). - -- - -- Then, because we use the `opts` key (recommended), the configuration runs - -- after the plugin has been loaded as `require(MODULE).setup(opts)`. - - { -- Useful plugin to show you pending keybinds. - 'folke/which-key.nvim', - event = 'VimEnter', -- Sets the loading event to 'VimEnter' - opts = { - -- delay between pressing a key and opening which-key (milliseconds) - -- this setting is independent of vim.opt.timeoutlen - delay = 0, - icons = { - -- set icon mappings to true if you have a Nerd Font - mappings = vim.g.have_nerd_font, - -- If you are using a Nerd Font: set icons.keys to an empty table which will use the - -- default which-key.nvim defined Nerd Font icons, otherwise define a string table - keys = vim.g.have_nerd_font and {} or { - Up = ' ', - Down = ' ', - Left = ' ', - Right = ' ', - C = ' ', - M = ' ', - D = ' ', - S = ' ', - CR = ' ', - Esc = ' ', - ScrollWheelDown = ' ', - ScrollWheelUp = ' ', - NL = ' ', - BS = ' ', - Space = ' ', - Tab = ' ', - F1 = '', - F2 = '', - F3 = '', - F4 = '', - F5 = '', - F6 = '', - F7 = '', - F8 = '', - F9 = '', - F10 = '', - F11 = '', - F12 = '', - }, - }, - - -- Document existing key chains - spec = { - { 'c', group = '[C]ode', mode = { 'n', 'x' } }, - { 'd', group = '[D]ocument' }, - { 'r', group = '[R]ename' }, - { 's', group = '[S]earch' }, - { 'w', group = '[W]orkspace' }, - { 't', group = '[T]oggle' }, - { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, - }, - }, - }, - - -- NOTE: Plugins can specify dependencies. - -- - -- The dependencies are proper plugin specifications as well - anything - -- you do for a plugin at the top level, you can do for a dependency. - -- - -- Use the `dependencies` key to specify the dependencies of a particular plugin - - { -- Fuzzy Finder (files, lsp, etc) - 'nvim-telescope/telescope.nvim', - event = 'VimEnter', - branch = '0.1.x', - dependencies = { - 'nvim-lua/plenary.nvim', - { -- If encountering errors, see telescope-fzf-native README for installation instructions - 'nvim-telescope/telescope-fzf-native.nvim', - - -- `build` is used to run some command when the plugin is installed/updated. - -- This is only run then, not every time Neovim starts up. - build = 'make', - - -- `cond` is a condition used to determine whether this plugin should be - -- installed and loaded. - cond = function() - return vim.fn.executable 'make' == 1 - end, - }, - { 'nvim-telescope/telescope-ui-select.nvim' }, - - -- Useful for getting pretty icons, but requires a Nerd Font. - { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, - }, - config = function() - -- Telescope is a fuzzy finder that comes with a lot of different things that - -- it can fuzzy find! It's more than just a "file finder", it can search - -- many different aspects of Neovim, your workspace, LSP, and more! - -- - -- The easiest way to use Telescope, is to start by doing something like: - -- :Telescope help_tags - -- - -- After running this command, a window will open up and you're able to - -- type in the prompt window. You'll see a list of `help_tags` options and - -- a corresponding preview of the help. - -- - -- Two important keymaps to use while in Telescope are: - -- - Insert mode: - -- - Normal mode: ? - -- - -- This opens a window that shows you all of the keymaps for the current - -- Telescope picker. This is really useful to discover what Telescope can - -- do as well as how to actually do it! - - -- [[ Configure Telescope ]] - -- See `:help telescope` and `:help telescope.setup()` - require('telescope').setup { - -- You can put your default mappings / updates / etc. in here - -- All the info you're looking for is in `:help telescope.setup()` - -- - -- defaults = { - -- mappings = { - -- i = { [''] = 'to_fuzzy_refine' }, - -- }, - -- }, - -- pickers = {} - extensions = { - ['ui-select'] = { - require('telescope.themes').get_dropdown(), - }, - }, - } - - -- Enable Telescope extensions if they are installed - pcall(require('telescope').load_extension, 'fzf') - pcall(require('telescope').load_extension, 'ui-select') - - -- See `:help telescope.builtin` - local builtin = require 'telescope.builtin' - vim.keymap.set('n', 'sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) - vim.keymap.set('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) - vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) - vim.keymap.set('n', 'ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' }) - vim.keymap.set('n', 'sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) - vim.keymap.set('n', 'sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) - vim.keymap.set('n', 'sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) - vim.keymap.set('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) - vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) - vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) - - -- Slightly advanced example of overriding default behavior and theme - vim.keymap.set('n', '/', function() - -- You can pass additional configuration to Telescope to change the theme, layout, etc. - builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { - winblend = 10, - previewer = false, - }) - end, { desc = '[/] Fuzzily search in current buffer' }) - - -- It's also possible to pass additional configuration options. - -- See `:help telescope.builtin.live_grep()` for information about particular keys - vim.keymap.set('n', 's/', function() - builtin.live_grep { - grep_open_files = true, - prompt_title = 'Live Grep in Open Files', - } - end, { desc = '[S]earch [/] in Open Files' }) - - -- Shortcut for searching your Neovim configuration files - vim.keymap.set('n', 'sn', function() - builtin.find_files { cwd = vim.fn.stdpath 'config' } - end, { desc = '[S]earch [N]eovim files' }) - end, - }, - - -- LSP Plugins - { - -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins - -- used for completion, annotations and signatures of Neovim apis - 'folke/lazydev.nvim', - ft = 'lua', - opts = { - library = { - -- Load luvit types when the `vim.uv` word is found - { path = '${3rd}/luv/library', words = { 'vim%.uv' } }, - }, - }, - }, - { - -- Main LSP Configuration - 'neovim/nvim-lspconfig', - dependencies = { - -- Automatically install LSPs and related tools to stdpath for Neovim - -- Mason must be loaded before its dependents so we need to set it up here. - -- NOTE: `opts = {}` is the same as calling `require('mason').setup({})` - { 'williamboman/mason.nvim', opts = {} }, - 'williamboman/mason-lspconfig.nvim', - 'WhoIsSethDaniel/mason-tool-installer.nvim', - - -- Useful status updates for LSP. - { 'j-hui/fidget.nvim', opts = {} }, - - -- Allows extra capabilities provided by nvim-cmp - 'hrsh7th/cmp-nvim-lsp', - }, - config = function() - -- Brief aside: **What is LSP?** - -- - -- LSP is an initialism you've probably heard, but might not understand what it is. - -- - -- LSP stands for Language Server Protocol. It's a protocol that helps editors - -- and language tooling communicate in a standardized fashion. - -- - -- In general, you have a "server" which is some tool built to understand a particular - -- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc.). These Language Servers - -- (sometimes called LSP servers, but that's kind of like ATM Machine) are standalone - -- processes that communicate with some "client" - in this case, Neovim! - -- - -- LSP provides Neovim with features like: - -- - Go to definition - -- - Find references - -- - Autocompletion - -- - Symbol Search - -- - and more! - -- - -- Thus, Language Servers are external tools that must be installed separately from - -- Neovim. This is where `mason` and related plugins come into play. - -- - -- If you're wondering about lsp vs treesitter, you can check out the wonderfully - -- and elegantly composed help section, `:help lsp-vs-treesitter` - - -- This function gets run when an LSP attaches to a particular buffer. - -- That is to say, every time a new file is opened that is associated with - -- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this - -- function will be executed to configure the current buffer - vim.api.nvim_create_autocmd('LspAttach', { - group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }), - callback = function(event) - -- NOTE: Remember that Lua is a real programming language, and as such it is possible - -- to define small helper and utility functions so you don't have to repeat yourself. - -- - -- In this case, we create a function that lets us more easily define mappings specific - -- for LSP related items. It sets the mode, buffer and description for us each time. - local map = function(keys, func, desc, mode) - mode = mode or 'n' - vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) - end - - -- Jump to the definition of the word under your cursor. - -- This is where a variable was first declared, or where a function is defined, etc. - -- To jump back, press . - map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') - - -- Find references for the word under your cursor. - map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') - - -- Jump to the implementation of the word under your cursor. - -- Useful when your language has ways of declaring types without an actual implementation. - map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') - - -- Jump to the type of the word under your cursor. - -- Useful when you're not sure what type a variable is and you want to see - -- the definition of its *type*, not where it was *defined*. - map('D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition') - - -- Fuzzy find all the symbols in your current document. - -- Symbols are things like variables, functions, types, etc. - map('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') - - -- Fuzzy find all the symbols in your current workspace. - -- Similar to document symbols, except searches over your entire project. - map('ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') - - -- Rename the variable under your cursor. - -- Most Language Servers support renaming across files, etc. - map('rn', vim.lsp.buf.rename, '[R]e[n]ame') - - -- Execute a code action, usually your cursor needs to be on top of an error - -- or a suggestion from your LSP for this to activate. - map('ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' }) - - -- WARN: This is not Goto Definition, this is Goto Declaration. - -- For example, in C this would take you to the header. - map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') - - -- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10) - ---@param client vim.lsp.Client - ---@param method vim.lsp.protocol.Method - ---@param bufnr? integer some lsp support methods only in specific files - ---@return boolean - local function client_supports_method(client, method, bufnr) - if vim.fn.has 'nvim-0.11' == 1 then - return client:supports_method(method, bufnr) - else - return client.supports_method(method, { bufnr = bufnr }) - end - end - - -- The following two autocommands are used to highlight references of the - -- word under your cursor when your cursor rests there for a little while. - -- See `:help CursorHold` for information about when this is executed - -- - -- When you move your cursor, the highlights will be cleared (the second autocommand). - local client = vim.lsp.get_client_by_id(event.data.client_id) - if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then - local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false }) - vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { - buffer = event.buf, - group = highlight_augroup, - callback = vim.lsp.buf.document_highlight, - }) - - vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, { - buffer = event.buf, - group = highlight_augroup, - callback = vim.lsp.buf.clear_references, - }) - - vim.api.nvim_create_autocmd('LspDetach', { - group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }), - callback = function(event2) - vim.lsp.buf.clear_references() - vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf } - end, - }) - end - - -- The following code creates a keymap to toggle inlay hints in your - -- code, if the language server you are using supports them - -- - -- This may be unwanted, since they displace some of your code - if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then - map('th', function() - vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) - end, '[T]oggle Inlay [H]ints') - end - end, - }) - - -- Diagnostic Config - -- See :help vim.diagnostic.Opts - vim.diagnostic.config { - severity_sort = true, - float = { border = 'rounded', source = 'if_many' }, - underline = { severity = vim.diagnostic.severity.ERROR }, - signs = vim.g.have_nerd_font and { - text = { - [vim.diagnostic.severity.ERROR] = '๓ฐ…š ', - [vim.diagnostic.severity.WARN] = '๓ฐ€ช ', - [vim.diagnostic.severity.INFO] = '๓ฐ‹ฝ ', - [vim.diagnostic.severity.HINT] = '๓ฐŒถ ', - }, - } or {}, - virtual_text = { - source = 'if_many', - spacing = 2, - format = function(diagnostic) - local diagnostic_message = { - [vim.diagnostic.severity.ERROR] = diagnostic.message, - [vim.diagnostic.severity.WARN] = diagnostic.message, - [vim.diagnostic.severity.INFO] = diagnostic.message, - [vim.diagnostic.severity.HINT] = diagnostic.message, - } - return diagnostic_message[diagnostic.severity] - end, - }, - } - - -- LSP servers and clients are able to communicate to each other what features they support. - -- By default, Neovim doesn't support everything that is in the LSP specification. - -- When you add nvim-cmp, luasnip, etc. Neovim now has *more* capabilities. - -- So, we create new capabilities with nvim cmp, and then broadcast that to the servers. - local capabilities = vim.lsp.protocol.make_client_capabilities() - capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities()) - - -- Enable the following language servers - -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. - -- - -- Add any additional override configuration in the following tables. Available keys are: - -- - cmd (table): Override the default command used to start the server - -- - filetypes (table): Override the default list of associated filetypes for the server - -- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features. - -- - settings (table): Override the default settings passed when initializing the server. - -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ - local servers = { - -- clangd = {}, - -- gopls = {}, - -- pyright = {}, - -- rust_analyzer = {}, - -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs - -- - -- Some languages (like typescript) have entire language plugins that can be useful: - -- https://github.com/pmizio/typescript-tools.nvim - -- - -- But for many setups, the LSP (`ts_ls`) will work just fine - -- ts_ls = {}, - -- - - lua_ls = { - -- cmd = { ... }, - -- filetypes = { ... }, - -- capabilities = {}, - settings = { - Lua = { - completion = { - callSnippet = 'Replace', - }, - -- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings - -- diagnostics = { disable = { 'missing-fields' } }, - }, - }, - }, - } - - -- Ensure the servers and tools above are installed - -- - -- To check the current status of installed tools and/or manually install - -- other tools, you can run - -- :Mason - -- - -- You can press `g?` for help in this menu. - -- - -- `mason` had to be setup earlier: to configure its options see the - -- `dependencies` table for `nvim-lspconfig` above. - -- - -- You can add other tools here that you want Mason to install - -- for you, so that they are available from within Neovim. - local ensure_installed = vim.tbl_keys(servers or {}) - vim.list_extend(ensure_installed, { - 'stylua', -- Used to format Lua code - }) - require('mason-tool-installer').setup { ensure_installed = ensure_installed } - - require('mason-lspconfig').setup { - ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer) - automatic_installation = false, - handlers = { - function(server_name) - local server = servers[server_name] or {} - -- This handles overriding only values explicitly passed - -- by the server configuration above. Useful when disabling - -- certain features of an LSP (for example, turning off formatting for ts_ls) - server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) - require('lspconfig')[server_name].setup(server) - end, - }, - } - end, - }, - - { -- Autoformat - 'stevearc/conform.nvim', - event = { 'BufWritePre' }, - cmd = { 'ConformInfo' }, - keys = { - { - 'f', - function() - require('conform').format { async = true, lsp_format = 'fallback' } - end, - mode = '', - desc = '[F]ormat buffer', - }, - }, - opts = { - notify_on_error = false, - format_on_save = function(bufnr) - -- Disable "format_on_save lsp_fallback" for languages that don't - -- have a well standardized coding style. You can add additional - -- languages here or re-enable it for the disabled ones. - local disable_filetypes = { c = true, cpp = true } - if disable_filetypes[vim.bo[bufnr].filetype] then - return nil - else - return { - timeout_ms = 500, - lsp_format = 'fallback', - } - end - end, - formatters_by_ft = { - lua = { 'stylua' }, - -- Conform can also run multiple formatters sequentially - -- python = { "isort", "black" }, - -- - -- You can use 'stop_after_first' to run the first available formatter from the list - -- javascript = { "prettierd", "prettier", stop_after_first = true }, - }, - }, - }, - - { -- Autocompletion - 'hrsh7th/nvim-cmp', - event = 'InsertEnter', - dependencies = { - -- Snippet Engine & its associated nvim-cmp source - { - 'L3MON4D3/LuaSnip', - build = (function() - -- Build Step is needed for regex support in snippets. - -- This step is not supported in many windows environments. - -- Remove the below condition to re-enable on windows. - if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then - return - end - return 'make install_jsregexp' - end)(), - dependencies = { - -- `friendly-snippets` contains a variety of premade snippets. - -- See the README about individual language/framework/plugin snippets: - -- https://github.com/rafamadriz/friendly-snippets - -- { - -- 'rafamadriz/friendly-snippets', - -- config = function() - -- require('luasnip.loaders.from_vscode').lazy_load() - -- end, - -- }, - }, - }, - 'saadparwaiz1/cmp_luasnip', - - -- Adds other completion capabilities. - -- nvim-cmp does not ship with all sources by default. They are split - -- into multiple repos for maintenance purposes. - 'hrsh7th/cmp-nvim-lsp', - 'hrsh7th/cmp-path', - 'hrsh7th/cmp-nvim-lsp-signature-help', - }, - config = function() - -- See `:help cmp` - local cmp = require 'cmp' - local luasnip = require 'luasnip' - luasnip.config.setup {} - - cmp.setup { - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - completion = { completeopt = 'menu,menuone,noinsert' }, - - -- For an understanding of why these mappings were - -- chosen, you will need to read `:help ins-completion` - -- - -- No, but seriously. Please read `:help ins-completion`, it is really good! - mapping = cmp.mapping.preset.insert { - -- Select the [n]ext item - [''] = cmp.mapping.select_next_item(), - -- Select the [p]revious item - [''] = cmp.mapping.select_prev_item(), - - -- Scroll the documentation window [b]ack / [f]orward - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - - -- Accept ([y]es) the completion. - -- This will auto-import if your LSP supports it. - -- This will expand snippets if the LSP sent a snippet. - [''] = cmp.mapping.confirm { select = true }, - - -- If you prefer more traditional completion keymaps, - -- you can uncomment the following lines - --[''] = cmp.mapping.confirm { select = true }, - --[''] = cmp.mapping.select_next_item(), - --[''] = cmp.mapping.select_prev_item(), - - -- Manually trigger a completion from nvim-cmp. - -- Generally you don't need this, because nvim-cmp will display - -- completions whenever it has completion options available. - [''] = cmp.mapping.complete {}, - - -- Think of as moving to the right of your snippet expansion. - -- So if you have a snippet that's like: - -- function $name($args) - -- $body - -- end - -- - -- will move you to the right of each of the expansion locations. - -- is similar, except moving you backwards. - [''] = cmp.mapping(function() - if luasnip.expand_or_locally_jumpable() then - luasnip.expand_or_jump() - end - end, { 'i', 's' }), - [''] = cmp.mapping(function() - if luasnip.locally_jumpable(-1) then - luasnip.jump(-1) - end - end, { 'i', 's' }), - - -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: - -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps - }, - sources = { - { - name = 'lazydev', - -- set group index to 0 to skip loading LuaLS completions as lazydev recommends it - group_index = 0, - }, - { name = 'nvim_lsp' }, - { name = 'luasnip' }, - { name = 'path' }, - { name = 'nvim_lsp_signature_help' }, - }, - } - end, - }, - - { -- You can easily change to a different colorscheme. - -- Change the name of the colorscheme plugin below, and then - -- change the command in the config to whatever the name of that colorscheme is. - -- - -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. - 'folke/tokyonight.nvim', - priority = 1000, -- Make sure to load this before all the other start plugins. - config = function() - ---@diagnostic disable-next-line: missing-fields - require('tokyonight').setup { - styles = { - comments = { italic = false }, -- Disable italics in comments - }, - } - - -- Load the colorscheme here. - -- Like many other themes, this one has different styles, and you could load - -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. - vim.cmd.colorscheme 'tokyonight-night' - end, - }, - - -- Highlight todo, notes, etc in comments - { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, - - { -- Collection of various small independent plugins/modules - 'echasnovski/mini.nvim', - config = function() - -- Better Around/Inside textobjects - -- - -- Examples: - -- - va) - [V]isually select [A]round [)]paren - -- - yinq - [Y]ank [I]nside [N]ext [Q]uote - -- - ci' - [C]hange [I]nside [']quote - require('mini.ai').setup { n_lines = 500 } - - -- Add/delete/replace surroundings (brackets, quotes, etc.) - -- - -- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren - -- - sd' - [S]urround [D]elete [']quotes - -- - sr)' - [S]urround [R]eplace [)] ['] - require('mini.surround').setup() - - -- Simple and easy statusline. - -- You could remove this setup call if you don't like it, - -- and try some other statusline plugin - local statusline = require 'mini.statusline' - -- set use_icons to true if you have a Nerd Font - statusline.setup { use_icons = vim.g.have_nerd_font } - - -- You can configure sections in the statusline by overriding their - -- default behavior. For example, here we set the section for - -- cursor location to LINE:COLUMN - ---@diagnostic disable-next-line: duplicate-set-field - statusline.section_location = function() - return '%2l:%-2v' - end - - -- ... and there is more! - -- Check out: https://github.com/echasnovski/mini.nvim - end, - }, - { -- Highlight, edit, and navigate code - 'nvim-treesitter/nvim-treesitter', - build = ':TSUpdate', - main = 'nvim-treesitter.configs', -- Sets main module to use for opts - -- [[ Configure Treesitter ]] See `:help nvim-treesitter` - opts = { - ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, - -- Autoinstall languages that are not installed - auto_install = true, - highlight = { - enable = true, - -- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules. - -- If you are experiencing weird indenting issues, add the language to - -- the list of additional_vim_regex_highlighting and disabled languages for indent. - additional_vim_regex_highlighting = { 'ruby' }, - }, - indent = { enable = true, disable = { 'ruby' } }, - }, - -- There are additional nvim-treesitter modules that you can use to interact - -- with nvim-treesitter. You should go explore a few and see what interests you: - -- - -- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod` - -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context - -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects - }, - - -- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the - -- init.lua. If you want these files, they are in the repository, so you can just download them and - -- place them in the correct locations. - - -- NOTE: Next step on your Neovim journey: Add/Configure additional plugins for Kickstart - -- - -- Here are some example plugins that I've included in the Kickstart repository. - -- Uncomment any of the lines below to enable them (you will need to restart nvim). - -- - -- require 'kickstart.plugins.debug', - -- require 'kickstart.plugins.indent_line', - -- require 'kickstart.plugins.lint', - -- require 'kickstart.plugins.autopairs', - -- require 'kickstart.plugins.neo-tree', - -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps - - -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` - -- This is the easiest way to modularize your config. - -- - -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- { import = 'custom.plugins' }, - -- - -- For additional information with loading, sourcing and examples see `:help lazy.nvim-๐Ÿ”Œ-plugin-spec` - -- Or use telescope! - -- In normal mode type `sh` then write `lazy.nvim-plugin` - -- you can continue same window with `sr` which resumes last telescope search -}, { - ui = { - -- If you are using a Nerd Font: set icons to an empty table which will use the - -- default lazy.nvim defined Nerd Font icons, otherwise define a unicode icons table - icons = vim.g.have_nerd_font and {} or { - cmd = 'โŒ˜', - config = '๐Ÿ› ', - event = '๐Ÿ“…', - ft = '๐Ÿ“‚', - init = 'โš™', - keys = '๐Ÿ—', - plugin = '๐Ÿ”Œ', - runtime = '๐Ÿ’ป', - require = '๐ŸŒ™', - source = '๐Ÿ“„', - start = '๐Ÿš€', - task = '๐Ÿ“Œ', - lazy = '๐Ÿ’ค ', - }, - }, -}) - --- The line beneath this is called `modeline`. See `:help modeline` --- vim: ts=2 sts=2 sw=2 et diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 38d7f09..b370d5c 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,39 +1,38 @@ { - "LuaSnip": { "branch": "master", "commit": "776a29c3e1ac61029ac3f57ac6b5937df2340162" }, + "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, + "LuaSnip": { "branch": "master", "commit": "73813308abc2eaeff2bc0d3f2f79270c491be9d7" }, + "better-escape.nvim": { "branch": "master", "commit": "19a38aab94961016430905ebec30d272a01e9742" }, "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" }, - "cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" }, + "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "conform.nvim": { "branch": "master", "commit": "b529dd4897c85c3188cc787084089a9d55843093" }, - "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, - "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, + "conform.nvim": { "branch": "master", "commit": "fbcb4fa7f34bfea9be702ffff481a8e336ebf6ed" }, + "fidget.nvim": { "branch": "main", "commit": "3f5475949679953af6d78654db29b944fa826e6a" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, - "gitsigns.nvim": { "branch": "main", "commit": "d0f90ef51d4be86b824b012ec52ed715b5622e51" }, - "harpoon": { "branch": "master", "commit": "1bc17e3e42ea3c46b33c0bbad6a880792692a1b3" }, - "hydra.nvim": { "branch": "master", "commit": "3ced42c0b6a6c85583ff0f221635a7f4c1ab0dd0" }, - "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, - "leap.nvim": { "branch": "main", "commit": "08ca7ec9e859856251d56c22ea107f82f563ff3c" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "c2682b0d9732bf52cbc34862056f143e71dc4a6d" }, - "mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" }, - "neo-tree.nvim": { "branch": "main", "commit": "f3e8633f06007e015f855d3c1ec0cee23af14d8e" }, - "neogit": { "branch": "master", "commit": "00038cca54436b6fecc064bba00bf42b77189041" }, - "nui.nvim": { "branch": "main", "commit": "7cd18e73cfbd70e1546931b7268b3eebaeff9391" }, + "gitsigns.nvim": { "branch": "main", "commit": "1ee5c1fd068c81f9dd06483e639c2aa4587dc197" }, + "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" }, + "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, + "lazy.nvim": { "branch": "main", "commit": "1ea3c4085785f460fb0e46d2fe1ee895f5f9e7c1" }, + "lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "6bdb14f230de0904229ec367b410fb817e59b072" }, + "mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" }, + "neo-tree.nvim": { "branch": "main", "commit": "4c60a198e3f92098778a32a1c76d2bd7ba46a3b5" }, + "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-autopairs": { "branch": "master", "commit": "7a2c97cccd60abc559344042fefb1d5a85b3e33b" }, "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, - "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-dap": { "branch": "master", "commit": "61643680dcb771a29073cd432894e2f81a7c2ae3" }, - "nvim-dap-python": { "branch": "master", "commit": "261ce649d05bc455a29f9636dc03f8cdaa7e0e2c" }, - "nvim-dap-ui": { "branch": "master", "commit": "73a26abf4941aa27da59820fd6b028ebcdbcf932" }, - "nvim-lspconfig": { "branch": "master", "commit": "8adb3b5938f6074a1bcc36d3c3916f497d2e8ec4" }, + "nvim-lspconfig": { "branch": "master", "commit": "ac98db2f9f06a56498ec890a96928774eae412c3" }, + "nvim-surround": { "branch": "main", "commit": "a868c256c861044beb9794b4dd126480dcdfbdad" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "0f051e9813a36481f48ca1f833897210dbcfffde" }, - "nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" }, - "nvim-window-picker": { "branch": "main", "commit": "6382540b2ae5de6c793d4aa2e3fe6dbb518505ec" }, - "phpactor": { "branch": "master", "commit": "53741d8eb3d878d5b22e39f9255efa08c88d5dfc" }, - "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, - "schemastore.nvim": { "branch": "main", "commit": "9c4dbc346c0be7016cf56220bafb964fd8ef87d3" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "71385f191ec06ffc60e80e6b0c9a9d5daed4824c" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" }, + "nvim-web-devicons": { "branch": "master", "commit": "b8221e42cf7287c4dcde81f232f58d7b947c210d" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "schemastore.nvim": { "branch": "main", "commit": "caad5439cc80809be7475b625a5e36d1bb06cc7e" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, - "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, - "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, - "typescript-tools.nvim": { "branch": "master", "commit": "3c501d7c7f79457932a8750a2a1476a004c5c1a9" }, - "zen-mode.nvim": { "branch": "main", "commit": "863f150ca321b3dd8aa1a2b69b5f411a220e144f" } + "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, + "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, + "tokyonight.nvim": { "branch": "main", "commit": "d14614cbfc63b6037bfccd48bb982d2ad2003352" }, + "vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" }, + "which-key.nvim": { "branch": "main", "commit": "b4177e3eaf15fe5eb8357ebac2286d488be1ed00" } } diff --git a/.config/nvim/lua/core/keymaps.lua b/.config/nvim/lua/core/keymaps.lua new file mode 100644 index 0000000..847271c --- /dev/null +++ b/.config/nvim/lua/core/keymaps.lua @@ -0,0 +1,50 @@ +-- ============================================================================ +-- Keymaps - Tastenkombinationen +-- ============================================================================ + +local keymap = vim.keymap.set + +-- ESC clear search highlighting +keymap('n', '', 'nohlsearch', { desc = 'Clear search highlighting' }) + +-- Better window navigation +keymap('n', '', 'h', { desc = 'Navigate to left window' }) +keymap('n', '', 'j', { desc = 'Navigate to bottom window' }) +keymap('n', '', 'k', { desc = 'Navigate to top window' }) +keymap('n', '', 'l', { desc = 'Navigate to right window' }) + +-- Resize windows +keymap('n', '', ':resize +2', { desc = 'Increase window height' }) +keymap('n', '', ':resize -2', { desc = 'Decrease window height' }) +keymap('n', '', ':vertical resize -2', { desc = 'Decrease window width' }) +keymap('n', '', ':vertical resize +2', { desc = 'Increase window width' }) + +-- Buffer navigation +keymap('n', '', 'bprevious', { desc = 'Previous buffer' }) +keymap('n', '', 'bnext', { desc = 'Next buffer' }) +keymap('n', 'bd', 'bdelete', { desc = 'Delete buffer' }) + +-- Better indenting (bleibt in visual mode) +keymap('v', '<', '', '>gv', { desc = 'Indent right' }) + +-- Move lines up/down +keymap('n', '', ':m .+1==', { desc = 'Move line down' }) +keymap('n', '', ':m .-2==', { desc = 'Move line up' }) +keymap('v', '', ":m '>+1gv=gv", { desc = 'Move selection down' }) +keymap('v', '', ":m '<-2gv=gv", { desc = 'Move selection up' }) + +-- Go error handling (dein Shortcut!) +keymap('n', 'ee', 'oif err != nil {}Oreturn err', { desc = 'Go error handling' }) + +-- Quick save +keymap('n', 'w', 'w', { desc = 'Save file' }) + +-- Diagnostic keymaps (LSP errors) +keymap('n', '[d', vim.diagnostic.goto_prev, { desc = 'Previous diagnostic' }) +keymap('n', ']d', vim.diagnostic.goto_next, { desc = 'Next diagnostic' }) +keymap('n', 'cd', vim.diagnostic.open_float, { desc = 'Show diagnostic' }) +keymap('n', 'q', vim.diagnostic.setloclist, { desc = 'Diagnostic list' }) + +-- Terminal +keymap('t', '', '', { desc = 'Exit terminal mode' }) diff --git a/.config/nvim/lua/core/lazy.lua b/.config/nvim/lua/core/lazy.lua new file mode 100644 index 0000000..f9d8d60 --- /dev/null +++ b/.config/nvim/lua/core/lazy.lua @@ -0,0 +1,45 @@ +-- ============================================================================ +-- Lazy.nvim - Plugin Manager Setup +-- ============================================================================ + +-- lazy.nvim automatisch installieren wenn nicht vorhanden +local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim' +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + 'git', + 'clone', + '--filter=blob:none', + 'https://github.com/folke/lazy.nvim.git', + '--branch=stable', + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +-- Plugins laden +require('lazy').setup({ + -- Import alle Plugin-Specs aus lua/plugins/ + { import = 'plugins' }, +}, { + -- Lazy.nvim UI Konfiguration + ui = { + border = 'rounded', + }, + -- Performance + performance = { + rtp = { + disabled_plugins = { + 'gzip', + 'tarPlugin', + 'tohtml', + 'tutor', + 'zipPlugin', + }, + }, + }, + -- Check for updates aber nicht nerven + checker = { + enabled = true, + notify = false, + }, +}) diff --git a/.config/nvim/lua/core/options.lua b/.config/nvim/lua/core/options.lua new file mode 100644 index 0000000..ccb8d57 --- /dev/null +++ b/.config/nvim/lua/core/options.lua @@ -0,0 +1,61 @@ +-- ============================================================================ +-- Neovim Options - Grundlegende Einstellungen +-- ============================================================================ + +local opt = vim.opt + +-- Zeilennummern +opt.number = true +opt.relativenumber = false -- Absolute Nummern fรผr QA-Arbeit + +-- Maus +opt.mouse = 'a' + +-- Clipboard (System Clipboard nutzen) +opt.clipboard = 'unnamedplus' + +-- Tabs & Indentation +opt.tabstop = 2 +opt.shiftwidth = 2 +opt.expandtab = true +opt.autoindent = true +opt.breakindent = true + +-- Suche +opt.ignorecase = true +opt.smartcase = true +opt.hlsearch = true +opt.incsearch = true + +-- Aussehen +opt.termguicolors = true +opt.signcolumn = 'yes' +opt.cursorline = true +opt.scrolloff = 10 +opt.sidescrolloff = 8 + +-- Split windows +opt.splitright = true +opt.splitbelow = true + +-- Undo & Backup +opt.undofile = true +opt.backup = false +opt.swapfile = false + +-- Performance +opt.updatetime = 250 +opt.timeoutlen = 300 + +-- Whitespace characters +opt.list = true +opt.listchars = { tab = 'ยป ', trail = 'ยท', nbsp = 'โฃ' } + +-- Command line +opt.showmode = false -- Statusline zeigt mode schon + +-- Completion +opt.completeopt = 'menu,menuone,noselect' + +-- Fold (erstmal aus) +opt.foldenable = false diff --git a/.config/nvim/lua/custom/config.lua b/.config/nvim/lua/custom/config.lua deleted file mode 100644 index 5056805..0000000 --- a/.config/nvim/lua/custom/config.lua +++ /dev/null @@ -1,94 +0,0 @@ --- Explorer-Konfiguration (Neo-tree) -require('neo-tree').setup({ - close_if_last_window = false, - popup_border_style = "rounded", - enable_git_status = true, - enable_diagnostics = true, - sources = { - "filesystem", - "buffers", - "git_status", - }, - source_selector = { - winbar = true, - content_layout = "center", - tabs_layout = "equal", - }, - filesystem = { - filtered_items = { - visible = true, - hide_dotfiles = false, - hide_gitignored = false, - }, - follow_current_file = { - enabled = true, - }, - use_libuv_file_watcher = true, - }, - window = { - position = "right", - width = 35, - mapping_options = { - noremap = true, - nowait = true, - }, - }, - git_status = { - symbols = { - added = "โœš", - modified = "", - deleted = "โœ–", - renamed = "โžœ", - untracked = "โ˜…", - ignored = "โ—Œ", - unstaged = "โœ—", - staged = "โœ“", - conflict = "", - }, - }, -}) - --- Harpoon (Schnellwechsel zwischen Dateien) -local mark = require("harpoon.mark") -local ui = require("harpoon.ui") - -vim.keymap.set("n", "a", mark.add_file, { desc = "Datei zu Harpoon hinzufรผgen" }) -vim.keymap.set("n", "h", ui.toggle_quick_menu, { desc = "Harpoon-Menรผ anzeigen" }) - --- Schnellzugriff auf die ersten 4 Dateien -vim.keymap.set("n", "1", function() ui.nav_file(1) end, { desc = "Harpoon Datei 1" }) -vim.keymap.set("n", "2", function() ui.nav_file(2) end, { desc = "Harpoon Datei 2" }) -vim.keymap.set("n", "3", function() ui.nav_file(3) end, { desc = "Harpoon Datei 3" }) -vim.keymap.set("n", "4", function() ui.nav_file(4) end, { desc = "Harpoon Datei 4" }) - --- Tastenkombinationen fรผr Neo-tree -vim.keymap.set("n", "e", ":Neotree toggle right", { silent = true, desc = "Explorer รถffnen" }) - --- Git Signs -require('gitsigns').setup({ - signs = { - add = { text = '+' }, - change = { text = '~' }, - delete = { text = '_' }, - topdelete = { text = 'โ€พ' }, - changedelete = { text = '~' }, - untracked = { text = 'โ”†' }, - }, - signcolumn = true, - on_attach = function(bufnr) - local gs = package.loaded.gitsigns - - -- Navigation zwischen ร„nderungen - vim.keymap.set('n', ']c', function() - if vim.wo.diff then return ']c' end - vim.schedule(function() gs.next_hunk() end) - return '' - end, { expr = true, buffer = bufnr }) - - vim.keymap.set('n', '[c', function() - if vim.wo.diff then return '[c' end - vim.schedule(function() gs.prev_hunk() end) - return '' - end, { expr = true, buffer = bufnr }) - end -}) diff --git a/.config/nvim/lua/custom/hydra.lua b/.config/nvim/lua/custom/hydra.lua deleted file mode 100644 index 13c6031..0000000 --- a/.config/nvim/lua/custom/hydra.lua +++ /dev/null @@ -1,183 +0,0 @@ --- ~/.config/nvim/lua/custom/hydra.lua -local Hydra = require('hydra') - --- Fenster-Management Hydra -Hydra({ - name = 'Fenster', - mode = 'n', - body = '', - heads = { - -- Navigieren zwischen Fenstern - { 'h', 'h', { desc = 'links' } }, - { 'j', 'j', { desc = 'unten' } }, - { 'k', 'k', { desc = 'oben' } }, - { 'l', 'l', { desc = 'rechts' } }, - - -- Fenster verschieben - { 'H', 'H', { desc = 'nach links verschieben' } }, - { 'J', 'J', { desc = 'nach unten verschieben' } }, - { 'K', 'K', { desc = 'nach oben verschieben' } }, - { 'L', 'L', { desc = 'nach rechts verschieben' } }, - - -- GrรถรŸe รคndern - { '>', '>', { desc = 'breiter' } }, - { '<', '<', { desc = 'schmaler' } }, - { '+', '+', { desc = 'hรถher' } }, - { '-', '-', { desc = 'niedriger' } }, - { '=', '=', { desc = 'gleiche GrรถรŸe' } }, - - -- Neue Fenster - { 's', 's', { desc = 'horizontal teilen' } }, - { 'v', 'v', { desc = 'vertikal teilen' } }, - { 'n', 'new', { desc = 'neue horizontale Teilung' } }, - { 'N', 'vnew', { desc = 'neue vertikale Teilung' } }, - - -- Fenster schlieรŸen - { 'c', 'c', { desc = 'schlieรŸen' } }, - { 'o', 'o', { desc = 'andere schlieรŸen' } }, - - -- Beenden - { 'q', nil, { desc = 'beenden', exit = true } }, - { '', nil, { desc = 'beenden', exit = true } }, - } -}) - --- Harpoon Hydra -Hydra({ - name = 'Harpoon', - mode = 'n', - body = 'h', - heads = { - { 'a', function() require("harpoon.mark").add_file() end, { desc = 'Datei hinzufรผgen' } }, - { 'h', function() require("harpoon.ui").toggle_quick_menu() end, { desc = 'Menรผ anzeigen' } }, - { 'n', function() require("harpoon.ui").nav_next() end, { desc = 'Nรคchste Datei' } }, - { 'p', function() require("harpoon.ui").nav_prev() end, { desc = 'Vorherige Datei' } }, - { '1', function() require("harpoon.ui").nav_file(1) end, { desc = 'Datei 1' } }, - { '2', function() require("harpoon.ui").nav_file(2) end, { desc = 'Datei 2' } }, - { '3', function() require("harpoon.ui").nav_file(3) end, { desc = 'Datei 3' } }, - { '4', function() require("harpoon.ui").nav_file(4) end, { desc = 'Datei 4' } }, - { '5', function() require("harpoon.ui").nav_file(5) end, { desc = 'Datei 5' } }, - { 'q', nil, { desc = 'beenden', exit = true } }, - { '', nil, { desc = 'beenden', exit = true } }, - } -}) - --- Git-Operationen Hydra (funktioniert mit Gitsigns und Neogit) -Hydra({ - name = 'Git', - mode = 'n', - body = 'g', - heads = { - -- Gitsigns - { 'h', function() require("gitsigns").preview_hunk() end, { desc = 'ร„nderung anzeigen' } }, - { 'n', function() require("gitsigns").next_hunk() end, { desc = 'Nรคchste ร„nderung' } }, - { 'p', function() require("gitsigns").prev_hunk() end, { desc = 'Vorherige ร„nderung' } }, - { 's', function() require("gitsigns").stage_hunk() end, { desc = 'ร„nderung stagen' } }, - { 'u', function() require("gitsigns").undo_stage_hunk() end, { desc = 'Stagen rรผckgรคngig' } }, - { 'r', function() require("gitsigns").reset_hunk() end, { desc = 'ร„nderung zurรผcksetzen' } }, - - -- Neogit - { 'g', function() require("neogit").open() end, { desc = 'Neogit รถffnen', exit = true } }, - { 'c', function() require("neogit").open({ "commit" }) end, { desc = 'Commit', exit = true } }, - { 'P', function() require("neogit").open({ "push" }) end, { desc = 'Push', exit = true } }, - { 'l', function() require("neogit").open({ "log" }) end, { desc = 'Log', exit = true } }, - - -- Diffview - { 'd', 'DiffviewOpen', { desc = 'Diff anzeigen', exit = true } }, - - -- Beenden - { 'q', nil, { desc = 'beenden', exit = true } }, - { '', nil, { desc = 'beenden', exit = true } }, - } -}) - --- Neo-tree Hydra -Hydra({ - name = 'Explorer', - mode = 'n', - body = 'E', - heads = { - { 'e', 'Neotree toggle right', { desc = 'Explorer ein/aus', exit = true } }, - { 'f', 'Neotree focus filesystem right', { desc = 'Dateisystem', exit = true } }, - { 'b', 'Neotree focus buffers right', { desc = 'Buffer', exit = true } }, - { 'g', 'Neotree focus git_status right', { desc = 'Git-Status', exit = true } }, - - -- Leap Integration - { 's', function() - -- ร–ffne Neo-tree und springe mit Leap - vim.cmd('Neotree focus filesystem right') - -- Eine kleine Verzรถgerung, damit Neo-tree Zeit hat, zu รถffnen - vim.defer_fn(function() - require('leap').leap { target_windows = { vim.api.nvim_get_current_win() } } - end, 100) - end, - { desc = 'Suchen mit Leap', exit = true } - }, - - -- Beenden - { 'q', nil, { desc = 'beenden', exit = true } }, - { '', nil, { desc = 'beenden', exit = true } }, - } -}) - --- LSP und Coding-Hydra -Hydra({ - name = 'Code', - mode = 'n', - body = 'c', - heads = { - -- LSP Aktionen - { 'a', vim.lsp.buf.code_action, { desc = 'Code-Aktion' } }, - { 'r', vim.lsp.buf.rename, { desc = 'Umbenennen' } }, - { 'd', vim.lsp.buf.definition, { desc = 'Definition', exit = true } }, - { 'D', vim.lsp.buf.declaration, { desc = 'Deklaration', exit = true } }, - { 'i', vim.lsp.buf.implementation, { desc = 'Implementation', exit = true } }, - { 'h', vim.lsp.buf.hover, { desc = 'Hover Info' } }, - { 'f', function() require('conform').format() end, { desc = 'Formatieren' } }, - - -- Diagnostik - { 'n', vim.diagnostic.goto_next, { desc = 'Nรคchster Fehler' } }, - { 'p', vim.diagnostic.goto_prev, { desc = 'Vorheriger Fehler' } }, - { 'l', vim.diagnostic.open_float, { desc = 'Fehler anzeigen' } }, - - -- Beenden - { 'q', nil, { desc = 'beenden', exit = true } }, - { '', nil, { desc = 'beenden', exit = true } }, - } -}) - --- Erweiterte Navigation mit Leap und Harpoon -Hydra({ - name = 'Navigation', - mode = 'n', - body = 'n', - heads = { - -- Leap - { 'f', function() require('leap').leap { target_windows = { vim.api.nvim_get_current_win() } } end, - { desc = 'Leap vorwรคrts', exit = true } }, - { 'F', function() require('leap').leap { backward = true, target_windows = { vim.api.nvim_get_current_win() } } end, - { desc = 'Leap rรผckwรคrts', exit = true } }, - { 'w', function() - require('leap').leap { target_windows = vim.tbl_filter( - function(win) return vim.api.nvim_win_get_config(win).relative == '' end, - vim.api.nvim_list_wins() - ) } - end, { desc = 'Leap alle Fenster', exit = true } }, - - -- Harpoon - { 'h', function() require("harpoon.ui").toggle_quick_menu() end, { desc = 'Harpoon-Menรผ', exit = true } }, - { '1', function() require("harpoon.ui").nav_file(1) end, { desc = 'Harpoon 1', exit = true } }, - { '2', function() require("harpoon.ui").nav_file(2) end, { desc = 'Harpoon 2', exit = true } }, - { '3', function() require("harpoon.ui").nav_file(3) end, { desc = 'Harpoon 3', exit = true } }, - { '4', function() require("harpoon.ui").nav_file(4) end, { desc = 'Harpoon 4', exit = true } }, - - -- Dateiexploration - { 'e', 'Neotree toggle right', { desc = 'Explorer', exit = true } }, - { 't', 'Telescope find_files', { desc = 'Dateien suchen', exit = true } }, - { 'g', 'Telescope live_grep', { desc = 'Inhalte suchen', exit = true } }, - - -- Beenden - { 'q', nil, { desc = 'beenden', exit = true } }, - { '', nil, { desc = 'beenden', exit = true } }, - } -}) diff --git a/.config/nvim/lua/custom/lsp.lua b/.config/nvim/lua/custom/lsp.lua deleted file mode 100644 index 84fe8f3..0000000 --- a/.config/nvim/lua/custom/lsp.lua +++ /dev/null @@ -1,280 +0,0 @@ --- LSP und Treesitter Konfiguration -local capabilities = vim.lsp.protocol.make_client_capabilities() -capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) - --- Mason fรผr einfache LSP-Installation -require('mason').setup() -require('mason-lspconfig').setup({ - ensure_installed = { - -- Sprachen - 'lua_ls', -- Lua - 'pyright', -- Python - 'ruff', -- Python Linter - 'ts_ls', -- TypeScript/JavaScript - -- 'vue-language-server', -- Vue - 'intelephense', -- PHP - 'html', -- HTML - 'cssls', -- CSS - 'yamlls', -- YAML - 'jsonls', -- JSON - 'docker_compose_language_service', -- Docker Compose - 'dockerls', -- Dockerfile - 'gopls', - }, -}) - --- LSP-Server konfigurieren -local lspconfig = require('lspconfig') - --- Lua -lspconfig.lua_ls.setup({ - capabilities = capabilities, -}) - --- TypeScript (inkl. React) -lspconfig.ts_ls.setup({ - capabilities = capabilities, -}) - --- Typescript-Tools fรผr bessere TS/JS Unterstรผtzung -require("typescript-tools").setup({ - settings = { - -- Fรผr NestJS, React und andere TS-Frameworks - tsserver_file_preferences = { - importModuleSpecifierPreference = "relative", - }, - }, -}) - --- Python -lspconfig.pyright.setup({ - capabilities = capabilities, -}) - --- PHP/Symfony -lspconfig.intelephense.setup({ - capabilities = capabilities, - settings = { - intelephense = { - stubs = { - "apache", "bcmath", "bz2", "calendar", "Core", "curl", "date", "dba", - "dom", "fileinfo", "filter", "ftp", "gd", "gettext", "hash", "iconv", - "imap", "intl", "json", "ldap", "libxml", "mbstring", "mysqli", "mysqlnd", - "oci8", "openssl", "pcntl", "pcre", "PDO", "pdo_mysql", "pdo_pgsql", - "pdo_sqlite", "pgsql", "Phar", "posix", "pspell", "readline", "Reflection", - "session", "shmop", "SimpleXML", "snmp", "soap", "sockets", "sodium", "SPL", - "sqlite3", "standard", "superglobals", "sysvmsg", "sysvsem", "sysvshm", - "tidy", "tokenizer", "xml", "xmlreader", "xmlrpc", "xmlwriter", "xsl", "Zend OPcache", - "zip", "zlib", "wordpress", "symfony" - }, - }, - }, -}) - --- Go -lspconfig.gopls.setup({ - capabilities = capabilities, - settings = { - gopls = { - analyses = { - unusedparams = true, - }, - staticcheck = true, - gofumpt = true, -- Strengere Formatierung als gofmt - usePlaceholders = true, - completeUnimported = true, - experimentalPostfixCompletions = true, - }, - }, -}) - --- YAML mit Schema-Unterstรผtzung -lspconfig.yamlls.setup({ - capabilities = capabilities, - settings = { - yaml = { - schemas = require('schemastore').yaml.schemas(), - }, - }, -}) - --- JSON mit Schema-Unterstรผtzung -lspconfig.jsonls.setup({ - capabilities = capabilities, - settings = { - json = { - schemas = require('schemastore').json.schemas(), - validate = { enable = true }, - }, - }, -}) - --- Treesitter-Konfiguration fรผr Syntax-Highlighting -require('nvim-treesitter.configs').setup({ - ensure_installed = { - "lua", "vim", "vimdoc", "json", "yaml", "html", "css", - "javascript", "typescript", "tsx", "php", "python", "vue", - "dockerfile", "markdown", "regex", "bash", "go", - }, - highlight = { enable = true }, - indent = { enable = true }, -}) - --- Autocomplete-Konfiguration -local cmp = require('cmp') -local luasnip = require('luasnip') - -cmp.setup({ - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.confirm({ select = true }), - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - else - fallback() - end - end, { 'i', 's' }), - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { 'i', 's' }), - }), - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = 'luasnip' }, - { name = 'buffer' }, - { name = 'path' }, - }), -}) - --- Einfache benutzerdefinierte Snippets (optional) --- Hier ein Beispiel fรผr ein paar einfache Snippets -local snippets_path = vim.fn.stdpath("config") .. "/snippets" -if vim.fn.isdirectory(snippets_path) == 0 then - vim.fn.mkdir(snippets_path, "p") -end - --- Fรผge einige nรผtzliche Snippets hinzu -luasnip.add_snippets("python", { - luasnip.snippet("def", { - luasnip.text_node("def "), - luasnip.insert_node(1, "function_name"), - luasnip.text_node("("), - luasnip.insert_node(2, "args"), - luasnip.text_node("):\n\t"), - luasnip.insert_node(0), - }), -}) - -luasnip.add_snippets("typescript", { - luasnip.snippet("fn", { - luasnip.text_node("function "), - luasnip.insert_node(1, "name"), - luasnip.text_node("("), - luasnip.insert_node(2, "params"), - luasnip.text_node(") {\n\t"), - luasnip.insert_node(0), - luasnip.text_node("\n}"), - }), -}) - -luasnip.add_snippets("go", { - luasnip.snippet("func", { - luasnip.text_node("func "), - luasnip.insert_node(1, "name"), - luasnip.text_node("("), - luasnip.insert_node(2, "params"), - luasnip.text_node(") "), - luasnip.insert_node(3, "returnType"), - luasnip.text_node(" {\n\t"), - luasnip.insert_node(0), - luasnip.text_node("\n}"), - }), - luasnip.snippet("if", { - luasnip.text_node("if "), - luasnip.insert_node(1, "condition"), - luasnip.text_node(" {\n\t"), - luasnip.insert_node(0), - luasnip.text_node("\n}"), - }), -}) - --- Code-Formatierung -require("conform").setup({ - formatters_by_ft = { - javascript = { "prettier" }, - typescript = { "prettier" }, - javascriptreact = { "prettier" }, - typescriptreact = { "prettier" }, - vue = { "prettier" }, - json = { "prettier" }, - yaml = { "prettier" }, - html = { "prettier" }, - css = { "prettier" }, - php = { "php_cs_fixer" }, - python = { "black" }, - lua = { "stylua" }, - go = { "gofumpt" }, - }, -}) - --- Formatierung beim Speichern -vim.api.nvim_create_autocmd("BufWritePre", { - pattern = "*", - callback = function() - require("conform").format({ async = false, lsp_fallback = true }) - end, -}) - - --- Einstellungen fรผr die Diagnostik (Fehleranzeige) -vim.diagnostic.config({ - virtual_text = { - format = function(diagnostic) - local icon = "โ†’ " - if diagnostic.severity == vim.diagnostic.severity.ERROR then - icon = "โœ— " - elseif diagnostic.severity == vim.diagnostic.severity.WARN then - icon = "โš  " - elseif diagnostic.severity == vim.diagnostic.severity.INFO then - icon = "โ„น " - elseif diagnostic.severity == vim.diagnostic.severity.HINT then - icon = "โžค " - end - return icon .. diagnostic.message - end - }, - signs = true, -- Symbole in der Randspalte anzeigen - underline = true, -- Problematischen Code unterstreichen - update_in_insert = false, - severity_sort = true, - float = { - border = "rounded", - source = "always", - }, -}) - --- Tastenkombinationen fรผr Diagnostik -vim.keymap.set('n', 'cd', vim.diagnostic.open_float, { desc = 'Fehlerdetails anzeigen' }) -vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Vorheriger Fehler' }) -vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Nรคchster Fehler' }) -vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Fehler in Liste anzeigen' }) diff --git a/.config/nvim/lua/custom/plugins.lua b/.config/nvim/lua/custom/plugins.lua deleted file mode 100644 index ec9a395..0000000 --- a/.config/nvim/lua/custom/plugins.lua +++ /dev/null @@ -1,449 +0,0 @@ -return { - -- Fuzzy Finder - { - 'nvim-telescope/telescope.nvim', - dependencies = { - 'nvim-lua/plenary.nvim', - 'nvim-telescope/telescope-fzf-native.nvim', - }, - }, - - -- LSP & Completion - { - 'neovim/nvim-lspconfig', - dependencies = { - 'williamboman/mason.nvim', - 'williamboman/mason-lspconfig.nvim', - 'hrsh7th/nvim-cmp', - 'hrsh7th/cmp-nvim-lsp', - 'hrsh7th/cmp-buffer', - 'hrsh7th/cmp-path', - 'L3MON4D3/LuaSnip', - 'saadparwaiz1/cmp_luasnip', - 'j-hui/fidget.nvim', - }, - config = function() - -- Nichts hier definieren - wir laden die Konfiguration aus der lsp.lua - require("custom.lsp") - end, - }, - - -- Snipped - { - "rafamadriz/friendly-snippets", - dependencies = { - "L3MON4D3/LuaSnip", - }, - config = function() - require("luasnip.loaders.from_vscode").lazy_load() - end, - }, - - -- Syntax Highlighting - { - 'nvim-treesitter/nvim-treesitter', - build = ':TSUpdate', - dependencies = { - 'nvim-treesitter/nvim-treesitter-textobjects', - }, - }, - - -- Datei-Explorer - { - "nvim-neo-tree/neo-tree.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", -- Fรผr Datei-Icons - "MunifTanjim/nui.nvim", -- UI-Komponenten-Bibliothek - }, - config = function() - -- Standardkonfiguration deaktivieren - vim.g.neo_tree_remove_legacy_commands = 1 - - require("neo-tree").setup({ - close_if_last_window = false, -- Neovim schlieรŸen, wenn nur noch Neo-tree offen ist? - popup_border_style = "rounded", -- Stil fรผr Popup-Fenster - enable_git_status = true, -- Git-Integration aktivieren - enable_diagnostics = true, -- Zeige Diagnostik-Informationen (LSP) - - default_component_configs = { - container = { - enable_character_fade = true, -- Schรถne รœbergรคnge bei Textlรคngen - width = "100%", - right_padding = 0, - }, - indent = { - indent_size = 2, - padding = 1, - with_markers = true, - indent_marker = "โ”‚", - last_indent_marker = "โ””", - highlight = "NeoTreeIndentMarker", - with_expanders = true, -- Klick-/Tastatur-expandierbare Ordner - expander_collapsed = "", - expander_expanded = "", - expander_highlight = "NeoTreeExpander", - }, - icon = { - folder_closed = "", - folder_open = "", - folder_empty = "๓ฐœŒ", - default = "*", - highlight = "NeoTreeFileIcon" - }, - modified = { - symbol = "[+]", - highlight = "NeoTreeModified", - }, - name = { - trailing_slash = false, - use_git_status_colors = true, - highlight = "NeoTreeFileName", - }, - git_status = { - symbols = { - -- Symbole fรผr Git-Status - added = "โœš", -- oder "โœš" - modified = "", -- oder "โœน" - deleted = "โœ–", -- oder "" - renamed = "โžœ", -- oder "" - untracked = "โ˜…", -- oder "โœญ" - ignored = "โ—Œ", -- oder "โ—Œ" - unstaged = "โœ—", -- oder "โœ—" - staged = "โœ“", -- oder "โœ“" - conflict = "", -- oder "โ‰ " - } - }, - }, - - -- Welche Ansichten verfรผgbar sein sollen - source_selector = { - winbar = true, -- Zeige Auswahl in der Fensterleiste - statusline = false, -- Nicht in der Statuszeile anzeigen - content_layout = "center", - sources = { -- Verfรผgbare Quellen - { source = "filesystem", display_name = " Dateien " }, - { source = "buffers", display_name = " Buffer " }, - { source = "git_status", display_name = " Git " }, - }, - tabs_layout = "equal", -- "equal", "focus" - }, - - -- Dateisystemansicht - filesystem = { - filtered_items = { - visible = true, -- Gefilterte Elemente mit anderen Stil anzeigen - hide_dotfiles = false, -- Versteckte Dateien anzeigen - hide_gitignored = false, -- Git-ignorierte Dateien anzeigen - hide_hidden = false, -- Versteckte Dateien unter Windows anzeigen - hide_by_name = { - -- "node_modules", -- Auskommentieren, um zu verstecken - }, - hide_by_pattern = { - -- "*.meta", -- Auskommentieren, um zu verstecken - }, - always_show = { -- Immer anzeigen, auch wenn sie sonst gefiltert wรผrden - ".gitignored", - ".env", - }, - never_show = { -- Dateien, die immer ausgeblendet werden - ".DS_Store", - }, - never_show_by_pattern = { -- Regex-Muster fรผr Dateien, die nie angezeigt werden - -- ".*\\.meta$", - }, - }, - follow_current_file = { - enabled = true, -- Hervorheben der aktuellen Datei im Explorer - leave_dirs_open = false, -- Ordner รถffnen, wenn Datei darin - }, - group_empty_dirs = false, -- Leere Unterordner unter Elternordner gruppieren - hijack_netrw_behavior = "open_default", -- Netrw ersetzen - use_libuv_file_watcher = true, -- Effiziente Dateiรผberwachung (bemerkt ร„nderungen) - - window = { - mappings = { - -- Tastenkombinationen im Dateisystem-Fenster - [""] = "none", -- Space fรผr andere Funktionen freigeben - ["<2-LeftMouse>"] = "open", - [""] = "open", - ["S"] = "open_split", -- In horizontales Split รถffnen - ["s"] = "open_vsplit", -- In vertikales Split รถffnen - ["t"] = "open_tabnew", -- In neuem Tab รถffnen - ["C"] = "close_node", -- Knoten schlieรŸen - ["z"] = "close_all_nodes", -- Alle Knoten schlieรŸen - ["R"] = "refresh", -- Aktualisieren - ["a"] = { - "add", -- Neue Datei/Ordner erstellen - config = { - show_path = - "relative" -- Relativen Pfad beim Erstellen anzeigen - } - }, - ["d"] = "delete", -- Lรถschen - ["r"] = "rename", -- Umbenennen - ["y"] = "copy_to_clipboard", -- In Zwischenablage kopieren - ["x"] = "cut_to_clipboard", -- Ausschneiden - ["p"] = "paste_from_clipboard", -- Einfรผgen - ["c"] = "copy", -- Kopieren (mit Ziel-Auswahl) - ["m"] = "move", -- Verschieben (mit Ziel-Auswahl) - ["/"] = "filter_on_submit", -- Filtern - [""] = "clear_filter", -- Filter lรถschen - ["f"] = "filter_on_submit", -- Filtern (Alternative) - [""] = "clear_filter", -- Filter lรถschen (Alternative) - ["?"] = "show_help", -- Hilfe anzeigen - } - }, - }, - - -- Buffer-Ansicht (Geรถffnete Dateien) - buffers = { - follow_current_file = { - enabled = true, -- Aktuelle Datei hervorheben - }, - group_empty_dirs = true, -- Leere Ordner gruppieren - show_unloaded = true, -- Auch nicht geladene Buffer anzeigen - }, - - -- Git-Status-Ansicht - git_status = { - window = { - mappings = { - ["A"] = "git_add_all", -- Alle ร„nderungen stagen - ["u"] = "git_unstage_file", -- Datei unstagen - ["a"] = "git_add_file", -- Datei stagen - ["r"] = "git_revert_file", -- ร„nderungen zurรผcksetzen - ["c"] = "git_commit", -- Commit erstellen - ["p"] = "git_push", -- Push - ["gg"] = "git_commit_and_push", -- Commit und Push - } - } - }, - - -- Hauptfenster-Konfiguration - window = { - position = "right", -- Explorer auf der rechten Seite - width = 35, -- Breite des Explorers - mapping_options = { - noremap = true, - nowait = true, - }, - mappings = { - [""] = "none", -- Space fรผr andere Funktionen freigeben - ["<2-LeftMouse>"] = "open", - [""] = "open", - ["S"] = "open_split", - ["s"] = "open_vsplit", - ["t"] = "open_tabnew", - ["w"] = "open_with_window_picker", -- Mit Fensterauswahl รถffnen - ["C"] = "close_node", - ["z"] = "close_all_nodes", - ["R"] = "refresh", - ["a"] = { - "add", - config = { - show_path = "relative" - } - }, - ["d"] = "delete", - ["r"] = "rename", - ["y"] = "copy_to_clipboard", - ["x"] = "cut_to_clipboard", - ["p"] = "paste_from_clipboard", - ["c"] = "copy", - ["m"] = "move", - ["q"] = "close_window", -- Fenster schlieรŸen - ["?"] = "show_help", - } - } - }) - - -- Tastenkombination zum ร–ffnen des Explorers - vim.keymap.set("n", "e", ":Neotree toggle right", - { silent = true, desc = "Explorer ein/aus" }) - -- Tastenkombination fรผr Dateiansicht - vim.keymap.set("n", "ef", ":Neotree focus filesystem right", - { silent = true, desc = "Datei-Explorer" }) - -- Tastenkombination fรผr Buffer-Liste - vim.keymap.set("n", "eb", ":Neotree focus buffers right", - { silent = true, desc = "Buffer-Liste" }) - -- Tastenkombination fรผr Git-Status - vim.keymap.set("n", "eg", ":Neotree focus git_status right", - { silent = true, desc = "Git-Status" }) - end, - }, - - -- Schnellwechsel zwischen Dateien (wie Harpoon) - { - 'ThePrimeagen/harpoon', - dependencies = { - 'nvim-lua/plenary.nvim', - }, - config = function() - -- Basiseinstellungen fรผr Harpoon - require("harpoon").setup() - - -- Einfache, direkte Keybindings - vim.keymap.set("n", "a", require("harpoon.mark").add_file, { desc = "Datei markieren" }) - vim.keymap.set("n", "h", require("harpoon.ui").toggle_quick_menu, - { desc = "Harpoon-Menรผ" }) - vim.keymap.set("n", "", function() require("harpoon.ui").nav_file(1) end) - vim.keymap.set("n", "", function() require("harpoon.ui").nav_file(2) end) - vim.keymap.set("n", "", function() require("harpoon.ui").nav_file(3) end) - vim.keymap.set("n", "", function() require("harpoon.ui").nav_file(4) end) - end, - }, - - -- Git-Integration - { - 'lewis6991/gitsigns.nvim', - config = true, - }, - - -- Formatierung - { - 'stevearc/conform.nvim', - }, - - -- Framework-Unterstรผtzung - - -- PHP/Symfony - { - 'phpactor/phpactor', - ft = 'php', - build = 'composer install --no-dev -o', - }, - - -- TypeScript/JavaScript/React/Vue/NestJS - { - 'pmizio/typescript-tools.nvim', - dependencies = { - 'nvim-lua/plenary.nvim', - 'neovim/nvim-lspconfig', - }, - config = function() - require("typescript-tools").setup({ - settings = { - tsserver_file_preferences = { - importModuleSpecifierPreference = "relative", - }, - }, - }) - end, - }, - - -- Vue.js - -- { - -- 'neovim/nvim-lspconfig', - -- opts = function(_, opts) - -- -- Fรผge Volar als Server hinzu - -- opts.servers = opts.servers or {} - -- opts.servers.volar = { - -- filetypes = { 'vue', 'typescript', 'javascript' } - -- } - -- end, - -- }, - - -- Playwright Testing - { - 'mxsdev/nvim-dap', - dependencies = { - 'rcarriga/nvim-dap-ui', - 'mfussenegger/nvim-dap-python', - }, - }, - - -- YAML und JSON Unterstรผtzung - 'b0o/schemastore.nvim', - - -- Fรผr Zen-Modus - { - "folke/zen-mode.nvim", - cmd = "ZenMode", - opts = { - window = { - width = 90, - options = { - number = false, - relativenumber = false, - }, - }, - }, - }, - - -- Fรผr Git-Integration - { - "sindrets/diffview.nvim", - dependencies = { "nvim-lua/plenary.nvim" }, - }, - - -- Fรผr Neogit - { - "NeogitOrg/neogit", - dependencies = { - "nvim-lua/plenary.nvim", - "sindrets/diffview.nvim", - }, - cmd = "Neogit", - }, - - -- Fรผr Farbvorschau in Code - { - "norcalli/nvim-colorizer.lua", - cmd = "ColorizerToggle", - config = true, - }, - - -- Leap/Lightspeed - { - "ggandor/leap.nvim", - config = function() - require('leap').add_default_mappings() - end, - }, - - -- Hydra fรผr kontextbezogene Tastaturmodi - { - "anuvyklack/hydra.nvim", - event = "VeryLazy", - config = function() - -- Die Konfigurationen folgen im nรคchsten Schritt - require("custom.hydra") - end, - }, - - -- Window-Picker - { - "s1n7ax/nvim-window-picker", - version = "v2.*", - config = function() - require("window-picker").setup({ - filter_rules = { - -- Filtere diese Fenstertypen aus - bo = { - filetype = { "neo-tree", "neo-tree-popup", "notify", "quickfix" }, - buftype = { "terminal" }, - }, - }, - highlights = { - statusline = { - focused = { - fg = "#000000", - bg = "#E35E4F", - }, - unfocused = { - fg = "#000000", - bg = "#44CC41", - }, - }, - }, - picker_config = { - statusline_winbar_picker = { - -- Verwende Buchstaben des Alphabets fรผr die Fensterauswahl - selection_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ", - }, - }, - }) - end, - } -} diff --git a/.config/nvim/lua/custom/plugins/init.lua b/.config/nvim/lua/custom/plugins/init.lua deleted file mode 100644 index be0eb9d..0000000 --- a/.config/nvim/lua/custom/plugins/init.lua +++ /dev/null @@ -1,5 +0,0 @@ --- You can add your own plugins here or in other files in this directory! --- I promise not to create any merge conflicts in this directory :) --- --- See the kickstart.nvim README for more information -return {} diff --git a/.config/nvim/lua/kickstart/health.lua b/.config/nvim/lua/kickstart/health.lua deleted file mode 100644 index b59d086..0000000 --- a/.config/nvim/lua/kickstart/health.lua +++ /dev/null @@ -1,52 +0,0 @@ ---[[ --- --- This file is not required for your own configuration, --- but helps people determine if their system is setup correctly. --- ---]] - -local check_version = function() - local verstr = tostring(vim.version()) - if not vim.version.ge then - vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr)) - return - end - - if vim.version.ge(vim.version(), '0.10-dev') then - vim.health.ok(string.format("Neovim version is: '%s'", verstr)) - else - vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr)) - end -end - -local check_external_reqs = function() - -- Basic utils: `git`, `make`, `unzip` - for _, exe in ipairs { 'git', 'make', 'unzip', 'rg' } do - local is_executable = vim.fn.executable(exe) == 1 - if is_executable then - vim.health.ok(string.format("Found executable: '%s'", exe)) - else - vim.health.warn(string.format("Could not find executable: '%s'", exe)) - end - end - - return true -end - -return { - check = function() - vim.health.start 'kickstart.nvim' - - vim.health.info [[NOTE: Not every warning is a 'must-fix' in `:checkhealth` - - Fix only warnings for plugins and languages you intend to use. - Mason will give warnings for languages that are not installed. - You do not need to install, unless you want to use those languages!]] - - local uv = vim.uv or vim.loop - vim.health.info('System Information: ' .. vim.inspect(uv.os_uname())) - - check_version() - check_external_reqs() - end, -} diff --git a/.config/nvim/lua/kickstart/plugins/autopairs.lua b/.config/nvim/lua/kickstart/plugins/autopairs.lua deleted file mode 100644 index 87a7e5f..0000000 --- a/.config/nvim/lua/kickstart/plugins/autopairs.lua +++ /dev/null @@ -1,16 +0,0 @@ --- autopairs --- https://github.com/windwp/nvim-autopairs - -return { - 'windwp/nvim-autopairs', - event = 'InsertEnter', - -- Optional dependency - dependencies = { 'hrsh7th/nvim-cmp' }, - config = function() - require('nvim-autopairs').setup {} - -- If you want to automatically add `(` after selecting a function or method - local cmp_autopairs = require 'nvim-autopairs.completion.cmp' - local cmp = require 'cmp' - cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done()) - end, -} diff --git a/.config/nvim/lua/kickstart/plugins/debug.lua b/.config/nvim/lua/kickstart/plugins/debug.lua deleted file mode 100644 index 753cb0c..0000000 --- a/.config/nvim/lua/kickstart/plugins/debug.lua +++ /dev/null @@ -1,148 +0,0 @@ --- debug.lua --- --- Shows how to use the DAP plugin to debug your code. --- --- Primarily focused on configuring the debugger for Go, but can --- be extended to other languages as well. That's why it's called --- kickstart.nvim and not kitchen-sink.nvim ;) - -return { - -- NOTE: Yes, you can install new plugins here! - 'mfussenegger/nvim-dap', - -- NOTE: And you can specify dependencies as well - dependencies = { - -- Creates a beautiful debugger UI - 'rcarriga/nvim-dap-ui', - - -- Required dependency for nvim-dap-ui - 'nvim-neotest/nvim-nio', - - -- Installs the debug adapters for you - 'williamboman/mason.nvim', - 'jay-babu/mason-nvim-dap.nvim', - - -- Add your own debuggers here - 'leoluz/nvim-dap-go', - }, - keys = { - -- Basic debugging keymaps, feel free to change to your liking! - { - '', - function() - require('dap').continue() - end, - desc = 'Debug: Start/Continue', - }, - { - '', - function() - require('dap').step_into() - end, - desc = 'Debug: Step Into', - }, - { - '', - function() - require('dap').step_over() - end, - desc = 'Debug: Step Over', - }, - { - '', - function() - require('dap').step_out() - end, - desc = 'Debug: Step Out', - }, - { - 'b', - function() - require('dap').toggle_breakpoint() - end, - desc = 'Debug: Toggle Breakpoint', - }, - { - 'B', - function() - require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') - end, - desc = 'Debug: Set Breakpoint', - }, - -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. - { - '', - function() - require('dapui').toggle() - end, - desc = 'Debug: See last session result.', - }, - }, - config = function() - local dap = require 'dap' - local dapui = require 'dapui' - - require('mason-nvim-dap').setup { - -- Makes a best effort to setup the various debuggers with - -- reasonable debug configurations - automatic_installation = true, - - -- You can provide additional configuration to the handlers, - -- see mason-nvim-dap README for more information - handlers = {}, - - -- You'll need to check that you have the required things installed - -- online, please don't ask me how to install them :) - ensure_installed = { - -- Update this to ensure that you have the debuggers for the langs you want - 'delve', - }, - } - - -- Dap UI setup - -- For more information, see |:help nvim-dap-ui| - dapui.setup { - -- Set icons to characters that are more likely to work in every terminal. - -- Feel free to remove or use ones that you like more! :) - -- Don't feel like these are good choices. - icons = { expanded = 'โ–พ', collapsed = 'โ–ธ', current_frame = '*' }, - controls = { - icons = { - pause = 'โธ', - play = 'โ–ถ', - step_into = 'โŽ', - step_over = 'โญ', - step_out = 'โฎ', - step_back = 'b', - run_last = 'โ–ถโ–ถ', - terminate = 'โน', - disconnect = 'โ', - }, - }, - } - - -- Change breakpoint icons - -- vim.api.nvim_set_hl(0, 'DapBreak', { fg = '#e51400' }) - -- vim.api.nvim_set_hl(0, 'DapStop', { fg = '#ffcc00' }) - -- local breakpoint_icons = vim.g.have_nerd_font - -- and { Breakpoint = '๎ฉฑ', BreakpointCondition = '๎ชง', BreakpointRejected = '๎ฎŒ', LogPoint = '๎ชซ', Stopped = '๎ฎ‹' } - -- or { Breakpoint = 'โ—', BreakpointCondition = 'โŠœ', BreakpointRejected = 'โŠ˜', LogPoint = 'โ—†', Stopped = 'โญ”' } - -- for type, icon in pairs(breakpoint_icons) do - -- local tp = 'Dap' .. type - -- local hl = (type == 'Stopped') and 'DapStop' or 'DapBreak' - -- vim.fn.sign_define(tp, { text = icon, texthl = hl, numhl = hl }) - -- end - - dap.listeners.after.event_initialized['dapui_config'] = dapui.open - dap.listeners.before.event_terminated['dapui_config'] = dapui.close - dap.listeners.before.event_exited['dapui_config'] = dapui.close - - -- Install golang specific config - require('dap-go').setup { - delve = { - -- On Windows delve must be run attached or it crashes. - -- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring - detached = vim.fn.has 'win32' == 0, - }, - } - end, -} diff --git a/.config/nvim/lua/kickstart/plugins/gitsigns.lua b/.config/nvim/lua/kickstart/plugins/gitsigns.lua deleted file mode 100644 index cbbd22d..0000000 --- a/.config/nvim/lua/kickstart/plugins/gitsigns.lua +++ /dev/null @@ -1,61 +0,0 @@ --- Adds git related signs to the gutter, as well as utilities for managing changes --- NOTE: gitsigns is already included in init.lua but contains only the base --- config. This will add also the recommended keymaps. - -return { - { - 'lewis6991/gitsigns.nvim', - opts = { - on_attach = function(bufnr) - local gitsigns = require 'gitsigns' - - local function map(mode, l, r, opts) - opts = opts or {} - opts.buffer = bufnr - vim.keymap.set(mode, l, r, opts) - end - - -- Navigation - map('n', ']c', function() - if vim.wo.diff then - vim.cmd.normal { ']c', bang = true } - else - gitsigns.nav_hunk 'next' - end - end, { desc = 'Jump to next git [c]hange' }) - - map('n', '[c', function() - if vim.wo.diff then - vim.cmd.normal { '[c', bang = true } - else - gitsigns.nav_hunk 'prev' - end - end, { desc = 'Jump to previous git [c]hange' }) - - -- Actions - -- visual mode - map('v', 'hs', function() - gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } - end, { desc = 'git [s]tage hunk' }) - map('v', 'hr', function() - gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } - end, { desc = 'git [r]eset hunk' }) - -- normal mode - map('n', 'hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' }) - map('n', 'hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' }) - map('n', 'hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' }) - map('n', 'hu', gitsigns.stage_hunk, { desc = 'git [u]ndo stage hunk' }) - map('n', 'hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' }) - map('n', 'hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' }) - map('n', 'hb', gitsigns.blame_line, { desc = 'git [b]lame line' }) - map('n', 'hd', gitsigns.diffthis, { desc = 'git [d]iff against index' }) - map('n', 'hD', function() - gitsigns.diffthis '@' - end, { desc = 'git [D]iff against last commit' }) - -- Toggles - map('n', 'tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' }) - map('n', 'tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' }) - end, - }, - }, -} diff --git a/.config/nvim/lua/kickstart/plugins/indent_line.lua b/.config/nvim/lua/kickstart/plugins/indent_line.lua deleted file mode 100644 index ed7f269..0000000 --- a/.config/nvim/lua/kickstart/plugins/indent_line.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - { -- Add indentation guides even on blank lines - 'lukas-reineke/indent-blankline.nvim', - -- Enable `lukas-reineke/indent-blankline.nvim` - -- See `:help ibl` - main = 'ibl', - opts = {}, - }, -} diff --git a/.config/nvim/lua/kickstart/plugins/lint.lua b/.config/nvim/lua/kickstart/plugins/lint.lua deleted file mode 100644 index 907c6bf..0000000 --- a/.config/nvim/lua/kickstart/plugins/lint.lua +++ /dev/null @@ -1,60 +0,0 @@ -return { - - { -- Linting - 'mfussenegger/nvim-lint', - event = { 'BufReadPre', 'BufNewFile' }, - config = function() - local lint = require 'lint' - lint.linters_by_ft = { - markdown = { 'markdownlint' }, - } - - -- To allow other plugins to add linters to require('lint').linters_by_ft, - -- instead set linters_by_ft like this: - -- lint.linters_by_ft = lint.linters_by_ft or {} - -- lint.linters_by_ft['markdown'] = { 'markdownlint' } - -- - -- However, note that this will enable a set of default linters, - -- which will cause errors unless these tools are available: - -- { - -- clojure = { "clj-kondo" }, - -- dockerfile = { "hadolint" }, - -- inko = { "inko" }, - -- janet = { "janet" }, - -- json = { "jsonlint" }, - -- markdown = { "vale" }, - -- rst = { "vale" }, - -- ruby = { "ruby" }, - -- terraform = { "tflint" }, - -- text = { "vale" } - -- } - -- - -- You can disable the default linters by setting their filetypes to nil: - -- lint.linters_by_ft['clojure'] = nil - -- lint.linters_by_ft['dockerfile'] = nil - -- lint.linters_by_ft['inko'] = nil - -- lint.linters_by_ft['janet'] = nil - -- lint.linters_by_ft['json'] = nil - -- lint.linters_by_ft['markdown'] = nil - -- lint.linters_by_ft['rst'] = nil - -- lint.linters_by_ft['ruby'] = nil - -- lint.linters_by_ft['terraform'] = nil - -- lint.linters_by_ft['text'] = nil - - -- Create autocommand which carries out the actual linting - -- on the specified events. - local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true }) - vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, { - group = lint_augroup, - callback = function() - -- Only run the linter in buffers that you can modify in order to - -- avoid superfluous noise, notably within the handy LSP pop-ups that - -- describe the hovered symbol using Markdown. - if vim.opt_local.modifiable:get() then - lint.try_lint() - end - end, - }) - end, - }, -} diff --git a/.config/nvim/lua/kickstart/plugins/neo-tree.lua b/.config/nvim/lua/kickstart/plugins/neo-tree.lua deleted file mode 100644 index bd44226..0000000 --- a/.config/nvim/lua/kickstart/plugins/neo-tree.lua +++ /dev/null @@ -1,25 +0,0 @@ --- Neo-tree is a Neovim plugin to browse the file system --- https://github.com/nvim-neo-tree/neo-tree.nvim - -return { - 'nvim-neo-tree/neo-tree.nvim', - version = '*', - dependencies = { - 'nvim-lua/plenary.nvim', - 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended - 'MunifTanjim/nui.nvim', - }, - cmd = 'Neotree', - keys = { - { '\\', ':Neotree reveal', desc = 'NeoTree reveal', silent = true }, - }, - opts = { - filesystem = { - window = { - mappings = { - ['\\'] = 'close_window', - }, - }, - }, - }, -} diff --git a/.config/nvim/lua/plugins/completion.lua b/.config/nvim/lua/plugins/completion.lua new file mode 100644 index 0000000..f1bab91 --- /dev/null +++ b/.config/nvim/lua/plugins/completion.lua @@ -0,0 +1,147 @@ +-- ============================================================================ +-- Completion - nvim-cmp Configuration +-- ============================================================================ + +return { + { + 'hrsh7th/nvim-cmp', + event = 'InsertEnter', + dependencies = { + -- Snippet Engine + { + 'L3MON4D3/LuaSnip', + build = (function() + return 'make install_jsregexp' + end)(), + dependencies = { + 'rafamadriz/friendly-snippets', + }, + }, + 'saadparwaiz1/cmp_luasnip', + + -- Completion Sources + 'hrsh7th/cmp-nvim-lsp', + 'hrsh7th/cmp-buffer', + 'hrsh7th/cmp-path', + }, + config = function() + local cmp = require('cmp') + local luasnip = require('luasnip') + + -- Friendly snippets laden + require('luasnip.loaders.from_vscode').lazy_load() + + -- Custom Snippets fรผr Go + luasnip.add_snippets('go', { + luasnip.snippet('iferr', { + luasnip.text_node('if err != nil {'), + luasnip.text_node({ '', '\treturn err' }), + luasnip.text_node({ '', '}' }), + }), + }) + + cmp.setup({ + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + completion = { completeopt = 'menu,menuone,noinsert' }, + + -- Keymaps + mapping = cmp.mapping.preset.insert({ + -- Select next/prev item + [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.select_prev_item(), + + -- Scroll docs + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + + -- Confirm completion + [''] = cmp.mapping.confirm({ select = true }), + + -- Manual trigger + [''] = cmp.mapping.complete({}), + + -- Tab fรผr Snippet forward/backward + completion + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_locally_jumpable() then + luasnip.expand_or_jump() + else + fallback() + end + end, { 'i', 's' }), + + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.locally_jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { 'i', 's' }), + }), + + -- Sources (Prioritรคt von oben nach unten) + sources = { + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + { name = 'buffer' }, + { name = 'path' }, + }, + + -- Window styling + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + + -- Formatting + formatting = { + fields = { 'kind', 'abbr', 'menu' }, + format = function(entry, item) + local icons = { + Text = '', + Method = '๓ฐ†ง', + Function = '๓ฐŠ•', + Constructor = '', + Field = '๓ฐ‡ฝ', + Variable = '๓ฐ‚ก', + Class = '๓ฐ ฑ', + Interface = '', + Module = '', + Property = '๓ฐœข', + Unit = '', + Value = '๓ฐŽ ', + Enum = '', + Keyword = '๓ฐŒ‹', + Snippet = '', + Color = '๓ฐ˜', + File = '๓ฐˆ™', + Reference = '', + Folder = '๓ฐ‰‹', + EnumMember = '', + Constant = '๓ฐฟ', + Struct = '', + Event = '', + Operator = '๓ฐ†•', + TypeParameter = '๓ฐ…ฒ', + } + item.kind = string.format('%s %s', icons[item.kind] or '', item.kind) + item.menu = ({ + nvim_lsp = '[LSP]', + luasnip = '[Snippet]', + buffer = '[Buffer]', + path = '[Path]', + })[entry.source.name] + return item + end, + }, + }) + end, + }, +} diff --git a/.config/nvim/lua/plugins/editor.lua b/.config/nvim/lua/plugins/editor.lua new file mode 100644 index 0000000..e21933d --- /dev/null +++ b/.config/nvim/lua/plugins/editor.lua @@ -0,0 +1,67 @@ +-- ============================================================================ +-- Editor - Quality of Life Plugins +-- ============================================================================ + +return { + -- Auto pairs + { + 'windwp/nvim-autopairs', + event = 'InsertEnter', + config = true, + }, + + -- Comment.nvim + { + 'numToStr/Comment.nvim', + event = { 'BufReadPost', 'BufNewFile' }, + dependencies = { + 'JoosepAlviste/nvim-ts-context-commentstring', + }, + config = function() + require('Comment').setup({ + pre_hook = require('ts_context_commentstring.integrations.comment_nvim').create_pre_hook(), + }) + end, + }, + + -- Surround + { + 'kylechui/nvim-surround', + version = '*', + event = 'VeryLazy', + config = true, + }, + + -- Better escape + { + 'max397574/better-escape.nvim', + event = 'InsertEnter', + config = function() + require('better_escape').setup({ + mapping = { 'jk', 'jj' }, + timeout = 200, + }) + end, + }, + + -- Which-key (zeigt Keybindings) + { + 'folke/which-key.nvim', + event = 'VeryLazy', + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 300 + end, + opts = { + -- Deine Leader-Gruppen + spec = { + { 'f', group = 'Find' }, + { 'g', group = 'Git' }, + { 'h', group = 'Hunk' }, + { 't', group = 'Toggle' }, + { 'c', group = 'Code' }, + { 'w', group = 'Workspace' }, + }, + }, + }, +} diff --git a/.config/nvim/lua/plugins/formatting.lua b/.config/nvim/lua/plugins/formatting.lua new file mode 100644 index 0000000..1e06a16 --- /dev/null +++ b/.config/nvim/lua/plugins/formatting.lua @@ -0,0 +1,77 @@ +-- ============================================================================ +-- Formatting - conform.nvim +-- ============================================================================ + +return { + { + 'stevearc/conform.nvim', + event = { 'BufWritePre' }, + cmd = { 'ConformInfo' }, + keys = { + { + 'cf', + function() + require('conform').format({ async = true, lsp_fallback = true }) + end, + mode = '', + desc = 'Format buffer', + }, + }, + opts = { + notify_on_error = false, + format_on_save = function(bufnr) + -- Disable with a global or buffer-local variable + if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then + return + end + return { + timeout_ms = 500, + lsp_fallback = true, + } + end, + formatters_by_ft = { + -- TypeScript/JavaScript + javascript = { 'prettier' }, + typescript = { 'prettier' }, + javascriptreact = { 'prettier' }, + typescriptreact = { 'prettier' }, + + -- Go + go = { 'gofumpt', 'goimports' }, + + -- Web + html = { 'prettier' }, + css = { 'prettier' }, + json = { 'prettier' }, + yaml = { 'prettier' }, + markdown = { 'prettier' }, + + -- Lua + lua = { 'stylua' }, + + -- Shell + sh = { 'shfmt' }, + }, + }, + init = function() + -- Autoformat toggle commands + vim.api.nvim_create_user_command('FormatDisable', function(args) + if args.bang then + vim.b.disable_autoformat = true + else + vim.g.disable_autoformat = true + end + end, { + desc = 'Disable autoformat-on-save', + bang = true, + }) + + vim.api.nvim_create_user_command('FormatEnable', function() + vim.b.disable_autoformat = false + vim.g.disable_autoformat = false + end, { + desc = 'Re-enable autoformat-on-save', + }) + end, + }, +} diff --git a/.config/nvim/lua/plugins/git.lua b/.config/nvim/lua/plugins/git.lua new file mode 100644 index 0000000..da1698e --- /dev/null +++ b/.config/nvim/lua/plugins/git.lua @@ -0,0 +1,72 @@ +-- ============================================================================ +-- Git Integration +-- ============================================================================ + +return { + -- Gitsigns - Git gutter signs + { + 'lewis6991/gitsigns.nvim', + event = { 'BufReadPre', 'BufNewFile' }, + opts = { + signs = { + add = { text = 'โ”‚' }, + change = { text = 'โ”‚' }, + delete = { text = '_' }, + topdelete = { text = 'โ€พ' }, + changedelete = { text = '~' }, + untracked = { text = 'โ”†' }, + }, + on_attach = function(bufnr) + local gs = package.loaded.gitsigns + + local function map(mode, l, r, opts) + opts = opts or {} + opts.buffer = bufnr + vim.keymap.set(mode, l, r, opts) + end + + -- Navigation + map('n', ']c', function() + if vim.wo.diff then return ']c' end + vim.schedule(function() gs.next_hunk() end) + return '' + end, { expr = true, desc = 'Next git hunk' }) + + map('n', '[c', function() + if vim.wo.diff then return '[c' end + vim.schedule(function() gs.prev_hunk() end) + return '' + end, { expr = true, desc = 'Previous git hunk' }) + + -- Actions + map('n', 'hs', gs.stage_hunk, { desc = 'Stage hunk' }) + map('n', 'hr', gs.reset_hunk, { desc = 'Reset hunk' }) + map('v', 'hs', function() gs.stage_hunk({ vim.fn.line('.'), vim.fn.line('v') }) end, { desc = 'Stage hunk' }) + map('v', 'hr', function() gs.reset_hunk({ vim.fn.line('.'), vim.fn.line('v') }) end, { desc = 'Reset hunk' }) + map('n', 'hS', gs.stage_buffer, { desc = 'Stage buffer' }) + map('n', 'hu', gs.undo_stage_hunk, { desc = 'Undo stage hunk' }) + map('n', 'hR', gs.reset_buffer, { desc = 'Reset buffer' }) + map('n', 'hp', gs.preview_hunk, { desc = 'Preview hunk' }) + map('n', 'hb', function() gs.blame_line({ full = true }) end, { desc = 'Blame line' }) + map('n', 'tb', gs.toggle_current_line_blame, { desc = 'Toggle blame line' }) + map('n', 'hd', gs.diffthis, { desc = 'Diff this' }) + map('n', 'hD', function() gs.diffthis('~') end, { desc = 'Diff this ~' }) + map('n', 'td', gs.toggle_deleted, { desc = 'Toggle deleted' }) + end, + }, + }, + + -- Fugitive - Git commands + { + 'tpope/vim-fugitive', + cmd = { 'Git', 'G', 'Gdiffsplit', 'Gread', 'Gwrite', 'Ggrep', 'GMove', 'GDelete', 'GBrowse', 'GRemove', 'GRename', 'Glgrep', 'Gedit' }, + keys = { + { 'gs', 'Git', desc = 'Git status' }, + { 'gc', 'Git commit', desc = 'Git commit' }, + { 'gp', 'Git push', desc = 'Git push' }, + { 'gl', 'Git log', desc = 'Git log' }, + { 'gb', 'Git blame', desc = 'Git blame' }, + { 'gd', 'Gdiffsplit', desc = 'Git diff' }, + }, + }, +} diff --git a/.config/nvim/lua/plugins/harpoon.lua b/.config/nvim/lua/plugins/harpoon.lua new file mode 100644 index 0000000..751cc8e --- /dev/null +++ b/.config/nvim/lua/plugins/harpoon.lua @@ -0,0 +1,31 @@ +-- ============================================================================ +-- Harpoon - Schneller File Wechsel +-- ============================================================================ + +return { + { + 'ThePrimeagen/harpoon', + branch = 'harpoon2', + dependencies = { 'nvim-lua/plenary.nvim' }, + config = function() + local harpoon = require('harpoon') + + -- REQUIRED: Setup + harpoon:setup() + + -- Basic Keymaps + vim.keymap.set('n', 'a', function() harpoon:list():add() end, { desc = 'Harpoon: Add file' }) + vim.keymap.set('n', 'h', function() harpoon.ui:toggle_quick_menu(harpoon:list()) end, { desc = 'Harpoon: Menu' }) + + -- Quick file navigation (1-4) + vim.keymap.set('n', '', function() harpoon:list():select(1) end, { desc = 'Harpoon: File 1' }) + vim.keymap.set('n', '', function() harpoon:list():select(2) end, { desc = 'Harpoon: File 2' }) + vim.keymap.set('n', '', function() harpoon:list():select(3) end, { desc = 'Harpoon: File 3' }) + vim.keymap.set('n', '', function() harpoon:list():select(4) end, { desc = 'Harpoon: File 4' }) + + -- Toggle previous & next buffers stored within Harpoon list + vim.keymap.set('n', '', function() harpoon:list():prev() end, { desc = 'Harpoon: Previous' }) + vim.keymap.set('n', '', function() harpoon:list():next() end, { desc = 'Harpoon: Next' }) + end, + }, +} diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua new file mode 100644 index 0000000..07e574b --- /dev/null +++ b/.config/nvim/lua/plugins/lsp.lua @@ -0,0 +1,276 @@ +-- ============================================================================ +-- LSP Configuration - TypeScript/Playwright & Go optimiert +-- ============================================================================ + +return { + { + 'neovim/nvim-lspconfig', + event = { 'BufReadPre', 'BufNewFile' }, + dependencies = { + -- Mason: LSP Server installer + 'williamboman/mason.nvim', + 'williamboman/mason-lspconfig.nvim', + + -- Status updates fรผr LSP + { 'j-hui/fidget.nvim', opts = {} }, + + -- Neodev fรผr Neovim config entwicklung + { 'folke/neodev.nvim', opts = {} }, + }, + config = function() + -- LSP Capabilities fรผr completion + local capabilities = vim.lsp.protocol.make_client_capabilities() + capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) + + -- Mason Setup + require('mason').setup({ + ui = { + border = 'rounded', + icons = { + package_installed = 'โœ“', + package_pending = 'โžœ', + package_uninstalled = 'โœ—' + } + } + }) + + -- Mason-LSPConfig: Automatische Server Installation + require('mason-lspconfig').setup({ + ensure_installed = { + -- Primary (TypeScript/Playwright) + 'ts_ls', -- TypeScript/JavaScript + + -- Secondary (Go) + 'gopls', -- Go + + -- Supporting + 'lua_ls', -- Lua (fรผr Neovim config) + 'html', -- HTML + 'cssls', -- CSS + 'jsonls', -- JSON + 'yamlls', -- YAML + 'dockerls', -- Dockerfile + 'docker_compose_language_service', -- Docker Compose + }, + }) + + -- LSP Keybindings (nur wenn LSP attached) + vim.api.nvim_create_autocmd('LspAttach', { + group = vim.api.nvim_create_augroup('lsp-attach', { clear = true }), + callback = function(event) + local map = function(keys, func, desc) + vim.keymap.set('n', keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) + end + + -- Navigation + map('gd', require('telescope.builtin').lsp_definitions, 'Goto Definition') + map('gr', require('telescope.builtin').lsp_references, 'Goto References') + map('gI', require('telescope.builtin').lsp_implementations, 'Goto Implementation') + map('gD', vim.lsp.buf.declaration, 'Goto Declaration') + map('D', require('telescope.builtin').lsp_type_definitions, 'Type Definition') + + -- Documentation + map('K', vim.lsp.buf.hover, 'Hover Documentation') + map('', vim.lsp.buf.signature_help, 'Signature Help') + + -- Actions + map('ca', vim.lsp.buf.code_action, 'Code Action') + map('rn', vim.lsp.buf.rename, 'Rename') + + -- Workspace + map('ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, 'Workspace Symbols') + + -- Highlight references unter cursor + local client = vim.lsp.get_client_by_id(event.data.client_id) + if client and client.server_capabilities.documentHighlightProvider then + local highlight_augroup = vim.api.nvim_create_augroup('lsp-highlight', { clear = false }) + vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { + buffer = event.buf, + group = highlight_augroup, + callback = vim.lsp.buf.document_highlight, + }) + vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, { + buffer = event.buf, + group = highlight_augroup, + callback = vim.lsp.buf.clear_references, + }) + end + end, + }) + + -- ========== Server Configurations ========== + + -- TypeScript/JavaScript (ts_ls) + vim.lsp.config('ts_ls', { + capabilities = capabilities, + settings = { + typescript = { + inlayHints = { + includeInlayParameterNameHints = 'all', + includeInlayParameterNameHintsWhenArgumentMatchesName = false, + includeInlayFunctionParameterTypeHints = true, + includeInlayVariableTypeHints = true, + includeInlayPropertyDeclarationTypeHints = true, + includeInlayFunctionLikeReturnTypeHints = true, + includeInlayEnumMemberValueHints = true, + }, + }, + javascript = { + inlayHints = { + includeInlayParameterNameHints = 'all', + includeInlayParameterNameHintsWhenArgumentMatchesName = false, + includeInlayFunctionParameterTypeHints = true, + includeInlayVariableTypeHints = true, + includeInlayPropertyDeclarationTypeHints = true, + includeInlayFunctionLikeReturnTypeHints = true, + includeInlayEnumMemberValueHints = true, + }, + }, + }, + }) + + -- Go (gopls) + vim.lsp.config('gopls', { + capabilities = capabilities, + settings = { + gopls = { + gofumpt = true, + codelenses = { + gc_details = false, + generate = true, + regenerate_cgo = true, + run_govulncheck = true, + test = true, + tidy = true, + upgrade_dependency = true, + vendor = true, + }, + hints = { + assignVariableTypes = true, + compositeLiteralFields = true, + compositeLiteralTypes = true, + constantValues = true, + functionTypeParameters = true, + parameterNames = true, + rangeVariableTypes = true, + }, + analyses = { + fieldalignment = true, + nilness = true, + unusedparams = true, + unusedwrite = true, + useany = true, + }, + usePlaceholders = true, + completeUnimported = true, + staticcheck = true, + directoryFilters = { '-.git', '-.vscode', '-.idea', '-.vscode-test', '-node_modules' }, + semanticTokens = true, + }, + }, + }) + + -- Lua (lua_ls) + vim.lsp.config('lua_ls', { + capabilities = capabilities, + settings = { + Lua = { + completion = { + callSnippet = 'Replace', + }, + diagnostics = { + globals = { 'vim' }, + }, + }, + }, + }) + + -- JSON mit Schema Support + vim.lsp.config('jsonls', { + capabilities = capabilities, + settings = { + json = { + schemas = require('schemastore').json.schemas(), + validate = { enable = true }, + }, + }, + }) + + -- YAML mit Schema Support + vim.lsp.config('yamlls', { + capabilities = capabilities, + settings = { + yaml = { + schemaStore = { + enable = false, + url = '', + }, + schemas = require('schemastore').yaml.schemas(), + }, + }, + }) + + -- HTML + vim.lsp.config('html', { + capabilities = capabilities, + }) + + -- CSS + vim.lsp.config('cssls', { + capabilities = capabilities, + }) + + -- Docker + vim.lsp.config('dockerls', { + capabilities = capabilities, + }) + + vim.lsp.config('docker_compose_language_service', { + capabilities = capabilities, + }) + + -- ========== Diagnostics Configuration ========== + + vim.diagnostic.config({ + virtual_text = { + prefix = 'โ—', + source = 'if_many', + }, + signs = true, + underline = true, + update_in_insert = false, + severity_sort = true, + float = { + border = 'rounded', + source = 'always', + header = '', + prefix = '', + }, + }) + + -- Diagnostic signs + 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 + + -- LSP Hover border + vim.lsp.handlers['textDocument/hover'] = vim.lsp.with( + vim.lsp.handlers.hover, + { border = 'rounded' } + ) + + vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with( + vim.lsp.handlers.signature_help, + { border = 'rounded' } + ) + end, + }, + + -- SchemaStore fรผr JSON/YAML + { + 'b0o/schemastore.nvim', + lazy = true, + }, +} diff --git a/.config/nvim/lua/plugins/neotree.lua b/.config/nvim/lua/plugins/neotree.lua new file mode 100644 index 0000000..c5a1c17 --- /dev/null +++ b/.config/nvim/lua/plugins/neotree.lua @@ -0,0 +1,113 @@ +-- ============================================================================ +-- Neo-tree - File Explorer +-- ============================================================================ + +return { + { + 'nvim-neo-tree/neo-tree.nvim', + version = '*', + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-tree/nvim-web-devicons', + 'MunifTanjim/nui.nvim', + }, + cmd = 'Neotree', + keys = { + { 'e', 'Neotree toggle right', desc = 'Explorer toggle' }, + { 'ef', 'Neotree focus filesystem right', desc = 'Explorer focus' }, + { 'eb', 'Neotree focus buffers right', desc = 'Explorer buffers' }, + { 'eg', 'Neotree focus git_status right', desc = 'Explorer git' }, + }, + config = function() + require('neo-tree').setup({ + close_if_last_window = false, + popup_border_style = 'rounded', + enable_git_status = true, + enable_diagnostics = true, + + default_component_configs = { + indent = { + indent_size = 2, + padding = 1, + with_markers = true, + indent_marker = 'โ”‚', + last_indent_marker = 'โ””', + with_expanders = true, + expander_collapsed = '', + expander_expanded = '', + }, + icon = { + folder_closed = '', + folder_open = '', + folder_empty = '๓ฐœŒ', + default = '*', + }, + modified = { + symbol = '[+]', + }, + git_status = { + symbols = { + added = '', + modified = '', + deleted = 'โœ–', + renamed = 'โžœ', + untracked = 'โ˜…', + ignored = 'โ—Œ', + unstaged = 'โœ—', + staged = 'โœ“', + conflict = '', + } + }, + }, + + window = { + position = 'right', + width = 35, + mappings = { + [''] = 'none', + ['<2-LeftMouse>'] = 'open', + [''] = 'open', + ['S'] = 'open_split', + ['s'] = 'open_vsplit', + ['t'] = 'open_tabnew', + ['C'] = 'close_node', + ['z'] = 'close_all_nodes', + ['R'] = 'refresh', + ['a'] = { + 'add', + config = { + show_path = 'relative' + } + }, + ['d'] = 'delete', + ['r'] = 'rename', + ['y'] = 'copy_to_clipboard', + ['x'] = 'cut_to_clipboard', + ['p'] = 'paste_from_clipboard', + ['q'] = 'close_window', + ['?'] = 'show_help', + } + }, + + filesystem = { + filtered_items = { + visible = false, + hide_dotfiles = false, + hide_gitignored = false, + hide_by_name = { + 'node_modules' + }, + never_show = { + '.DS_Store', + }, + }, + follow_current_file = { + enabled = true, + leave_dirs_open = false, + }, + use_libuv_file_watcher = true, + }, + }) + end, + }, +} diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..09f6631 --- /dev/null +++ b/.config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,89 @@ +-- ============================================================================ +-- Telescope - Fuzzy Finder +-- ============================================================================ + +return { + { + 'nvim-telescope/telescope.nvim', + event = 'VimEnter', + branch = '0.1.x', + dependencies = { + 'nvim-lua/plenary.nvim', + { + 'nvim-telescope/telescope-fzf-native.nvim', + build = 'make', + cond = function() + return vim.fn.executable('make') == 1 + end, + }, + { 'nvim-telescope/telescope-ui-select.nvim' }, + { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, + }, + config = function() + local telescope = require('telescope') + local actions = require('telescope.actions') + + telescope.setup({ + defaults = { + prompt_prefix = ' ', + selection_caret = ' ', + path_display = { 'truncate' }, + sorting_strategy = 'ascending', + layout_config = { + horizontal = { + prompt_position = 'top', + preview_width = 0.55, + }, + vertical = { + mirror = false, + }, + width = 0.87, + height = 0.80, + preview_cutoff = 120, + }, + mappings = { + i = { + [''] = actions.cycle_history_next, + [''] = actions.cycle_history_prev, + [''] = actions.move_selection_next, + [''] = actions.move_selection_previous, + }, + }, + }, + pickers = { + find_files = { + hidden = true, + find_command = { 'rg', '--files', '--hidden', '--glob', '!**/.git/*' }, + }, + }, + extensions = { + ['ui-select'] = { + require('telescope.themes').get_dropdown(), + }, + }, + }) + + -- Extensions laden + pcall(telescope.load_extension, 'fzf') + pcall(telescope.load_extension, 'ui-select') + + -- Keymaps + local builtin = require('telescope.builtin') + vim.keymap.set('n', 'ff', builtin.find_files, { desc = 'Find files' }) + vim.keymap.set('n', 'fg', builtin.live_grep, { desc = 'Live grep' }) + vim.keymap.set('n', 'fb', builtin.buffers, { desc = 'Buffers' }) + vim.keymap.set('n', 'fh', builtin.help_tags, { desc = 'Help tags' }) + vim.keymap.set('n', 'fo', builtin.oldfiles, { desc = 'Recent files' }) + vim.keymap.set('n', 'fw', builtin.grep_string, { desc = 'Current word' }) + vim.keymap.set('n', 'fd', builtin.diagnostics, { desc = 'Diagnostics' }) + vim.keymap.set('n', 'fr', builtin.resume, { desc = 'Resume' }) + vim.keymap.set('n', 'f.', builtin.oldfiles, { desc = 'Recent files' }) + vim.keymap.set('n', '/', builtin.current_buffer_fuzzy_find, { desc = 'Search in buffer' }) + + -- Git + vim.keymap.set('n', 'gc', builtin.git_commits, { desc = 'Git commits' }) + vim.keymap.set('n', 'gf', builtin.git_files, { desc = 'Git files' }) + vim.keymap.set('n', 'gs', builtin.git_status, { desc = 'Git status' }) + end, + }, +} diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..a97b515 --- /dev/null +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,103 @@ +-- ============================================================================ +-- Treesitter - Syntax Highlighting +-- ============================================================================ + +return { + { + 'nvim-treesitter/nvim-treesitter', + build = ':TSUpdate', + event = { 'BufReadPost', 'BufNewFile' }, + dependencies = { + 'nvim-treesitter/nvim-treesitter-textobjects', + }, + config = function() + require('nvim-treesitter.configs').setup({ + -- Parser die automatisch installiert werden + ensure_installed = { + -- Primary + 'typescript', + 'tsx', + 'javascript', + 'go', + + -- Supporting + 'lua', + 'vim', + 'vimdoc', + 'html', + 'css', + 'json', + 'yaml', + 'toml', + 'markdown', + 'markdown_inline', + 'bash', + 'dockerfile', + 'git_config', + 'git_rebase', + 'gitcommit', + 'gitignore', + }, + + -- Auto-install parser wenn fehlt + auto_install = true, + + -- Syntax highlighting + highlight = { + enable = true, + additional_vim_regex_highlighting = false, + }, + + -- Indentation + indent = { + enable = true, + }, + + -- Incremental selection + incremental_selection = { + enable = true, + keymaps = { + init_selection = '', + node_incremental = '', + scope_incremental = false, + node_decremental = '', + }, + }, + + -- Text objects + textobjects = { + select = { + enable = true, + lookahead = true, + keymaps = { + ['af'] = '@function.outer', + ['if'] = '@function.inner', + ['ac'] = '@class.outer', + ['ic'] = '@class.inner', + }, + }, + move = { + enable = true, + set_jumps = true, + goto_next_start = { + [']f'] = '@function.outer', + [']c'] = '@class.outer', + }, + goto_next_end = { + [']F'] = '@function.outer', + [']C'] = '@class.outer', + }, + goto_previous_start = { + ['[f'] = '@function.outer', + ['[c'] = '@class.outer', + }, + goto_previous_end = { + ['[F'] = '@function.outer', + ['[C'] = '@class.outer', + }, + }, + }, + }) + end, + }, +} diff --git a/.config/nvim/lua/plugins/ui.lua b/.config/nvim/lua/plugins/ui.lua new file mode 100644 index 0000000..d77aa6c --- /dev/null +++ b/.config/nvim/lua/plugins/ui.lua @@ -0,0 +1,76 @@ +-- ============================================================================ +-- UI - Colorscheme & Statusline +-- ============================================================================ + +return { + -- Tokyonight Theme + { + 'folke/tokyonight.nvim', + lazy = false, + priority = 1000, + config = function() + require('tokyonight').setup({ + style = 'night', + transparent = true, + terminal_colors = true, + styles = { + sidebars = 'transparent', + floats = 'transparent', + }, + on_colors = function(colors) + colors.bg_statusline = colors.none + end, + }) + vim.cmd.colorscheme('tokyonight-night') + end, + }, + + -- Lualine Statusline + { + 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + event = 'VeryLazy', + opts = { + options = { + theme = 'tokyonight', + component_separators = { left = '', right = '' }, + section_separators = { left = '', right = '' }, + globalstatus = true, + }, + sections = { + lualine_a = { 'mode' }, + lualine_b = { 'branch', 'diff', 'diagnostics' }, + lualine_c = { + { + 'filename', + path = 1, -- Relativer Pfad + symbols = { + modified = '[+]', + readonly = '[-]', + unnamed = '[No Name]', + } + } + }, + lualine_x = { 'encoding', 'fileformat', 'filetype' }, + lualine_y = { 'progress' }, + lualine_z = { 'location' } + }, + }, + }, + + -- Indent guides + { + 'lukas-reineke/indent-blankline.nvim', + event = { 'BufReadPost', 'BufNewFile' }, + main = 'ibl', + opts = { + indent = { + char = 'โ”‚', + }, + scope = { + show_start = false, + show_end = false, + }, + }, + }, +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..9d0ad65 --- /dev/null +++ b/README.md @@ -0,0 +1,253 @@ +# ๐Ÿš€ Dotfiles - QA Engineer Dev Setup + +Meine persรถnliche Development-Umgebung optimiert fรผr: +- **TypeScript/Playwright** Testing (QA bei Mobilistics) +- **Go** Development (Benchmarking & Learning) +- **Fish Shell** mit modernen Tools +- **Ghostty** Terminal +- **Neovim** (Scratch Build - kein Framework!) + +--- + +## ๐Ÿ“ฆ Was ist enthalten? + +### Core Tools +- **Neovim** - Scratch config mit lazy.nvim (TypeScript/Go optimiert) +- **Fish Shell** - Mit Fisher, NVM, FZF Integration +- **Ghostty** - Modernes Terminal mit Tokyo Night Theme +- **Starship** - Cross-shell prompt + +### Development +- **LSP Support**: TypeScript (ts_ls), Go (gopls), Lua, HTML, CSS, JSON, YAML +- **Completion**: nvim-cmp mit Snippets +- **Navigation**: Harpoon, Telescope, Neo-tree +- **Git**: LazyGit, Fugitive, Gitsigns +- **Formatting**: Conform (Prettier, Black, gofumpt) + +### System Monitoring +- **btop** - Ressourcen-Monitor +- **neofetch** - System Info +- **yabai** - Tiling Window Manager (macOS) + +--- + +## ๐Ÿ”ง Installation + +### Schnellstart (macOS/Linux) + +```bash +# 1. Clone das Repo +git clone https://github.com/yourusername/dotfiles.git ~/gits/dotfiles + +# 2. Run install script +cd ~/gits/dotfiles +chmod +x install.sh +./install.sh + +# 3. Restart terminal +# 4. Open Neovim (plugins werden automatisch installiert) +nvim +``` + +### Manuelle Installation + +```bash +# Core tools installieren +brew install git neovim fish starship fzf ripgrep fd bat btop +brew install --cask ghostty + +# Symlinks erstellen +ln -sf ~/gits/dotfiles/.config/fish ~/.config/fish +ln -sf ~/gits/dotfiles/.config/nvim ~/.config/nvim +ln -sf ~/gits/dotfiles/.config/ghostty ~/.config/ghostty +ln -sf ~/gits/dotfiles/.config/starship.toml ~/.config/starship.toml + +# Fish als default shell +chsh -s $(which fish) +``` + +--- + +## ๐Ÿ“ Struktur + +``` +dotfiles/ +โ”œโ”€โ”€ .config/ +โ”‚ โ”œโ”€โ”€ fish/ # Fish shell config + plugins +โ”‚ โ”‚ โ”œโ”€โ”€ conf.d/ # Auto-loaded configs +โ”‚ โ”‚ โ”œโ”€โ”€ functions/ # Fish functions +โ”‚ โ”‚ โ””โ”€โ”€ config.fish # Main config +โ”‚ โ”œโ”€โ”€ ghostty/ # Terminal config + themes +โ”‚ โ”œโ”€โ”€ nvim/ # Neovim scratch config +โ”‚ โ”‚ โ”œโ”€โ”€ lua/ +โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ core/ # Options, keymaps, lazy.nvim +โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ plugins/ # Plugin configs (modular!) +โ”‚ โ”‚ โ””โ”€โ”€ init.lua # Entry point +โ”‚ โ”œโ”€โ”€ btop/ # System monitor config +โ”‚ โ”œโ”€โ”€ neofetch/ # System info config +โ”‚ โ”œโ”€โ”€ yabai/ # Window manager (macOS) +โ”‚ โ””โ”€โ”€ starship.toml # Prompt config +โ”œโ”€โ”€ .zsh/ # Zsh configs (optional) +โ”œโ”€โ”€ .zshrc # Zsh config +โ”œโ”€โ”€ install.sh # Automated setup +โ””โ”€โ”€ README.md # This file +``` + +--- + +## ๐ŸŽฏ Neovim Keybindings (Wichtigste) + +### General +- `` - Leader key +- `ee` - Go error handling snippet + +### File Navigation +- `ff` - Telescope find files +- `fg` - Telescope live grep +- `fb` - Telescope buffers +- `e` - Neo-tree toggle + +### Harpoon (File Switching) +- `a` - Mark file +- `h` - Harpoon menu +- `` - Jump to file 1 +- `` - Jump to file 2 +- `` - Jump to file 3 +- `` - Jump to file 4 + +### Git +- `gs` - Git status (Fugitive) +- `gg` - LazyGit + +### LSP +- `gd` - Go to definition +- `gr` - Go to references +- `K` - Hover documentation +- `ca` - Code actions +- `rn` - Rename + +--- + +## ๐Ÿ”„ Updates + +```bash +# Dotfiles updaten +cd ~/gits/dotfiles +git pull + +# Neovim plugins updaten +nvim +:Lazy sync + +# Fish plugins updaten +fisher update +``` + +--- + +## ๐Ÿ› ๏ธ Anpassungen + +### Neovim +- **Neue Sprache hinzufรผgen**: Editiere `~/.config/nvim/lua/plugins/lsp.lua` +- **Neues Plugin**: Erstelle neue Datei in `~/.config/nvim/lua/plugins/` +- **Keymaps รคndern**: Editiere `~/.config/nvim/lua/core/keymaps.lua` + +### Fish +- **Neue Aliases**: `~/.config/fish/conf.d/aliases.fish` +- **Environment Variables**: `~/.config/fish/conf.d/paths.fish` +- **Functions**: Neue Datei in `~/.config/fish/functions/` + +### Ghostty +- **Theme รคndern**: Editiere `~/.config/ghostty/config` +- **Neue Themes**: Hinzufรผgen in `~/.config/ghostty/themes/` + +--- + +## ๐Ÿ› Troubleshooting + +### Neovim Plugins laden nicht +```bash +# Lazy.nvim neu installieren +rm -rf ~/.local/share/nvim +nvim +``` + +### Fish Plugins fehlen +```bash +# Fisher neu installieren +curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source +fisher install jorgebucaran/fisher +fisher update +``` + +### LSP funktioniert nicht +```bash +# Mason servers neu installieren +nvim +:Mason +# Dann manuell die benรถtigten Server installieren +``` + +--- + +## ๐Ÿ“ System Requirements + +### Minimum +- **OS**: macOS 12+, Linux (Arch, Debian, Fedora) +- **Neovim**: 0.10+ +- **Git**: 2.30+ +- **Fish**: 3.5+ + +### Recommended +- **Neovim**: 0.11+ (fรผr moderne LSP APIs) +- **Terminal**: Ghostty, iTerm2, Alacritty +- **Font**: Nerd Font (fรผr Icons) + +--- + +## ๐ŸŽจ Features + +### Neovim +โœ… **Scratch Build** - Kein Framework, volle Kontrolle +โœ… **Modern APIs** - Neovim 0.11 ready +โœ… **TypeScript/Playwright** - Optimiert fรผr QA +โœ… **Go Support** - gopls mit gofumpt +โœ… **Modular** - Jedes Plugin in eigener Datei +โœ… **Lazy Loading** - Schneller Start + +### Fish Shell +โœ… **NVM Integration** - Node Version Management +โœ… **FZF Integration** - Fuzzy finding everywhere +โœ… **Git Shortcuts** - Aliases fรผr hรคufige Commands +โœ… **Kubernetes** - kubectl completion +โœ… **Auto-completion** - Fรผr Docker, Git, etc. + +--- + +## ๐Ÿ“š Resources + +- [Neovim Docs](https://neovim.io/doc/) +- [Fish Shell Docs](https://fishshell.com/docs/current/) +- [Ghostty Terminal](https://ghostty.org/) +- [lazy.nvim](https://github.com/folke/lazy.nvim) +- [ThePrimeagen's Neovim Setup](https://github.com/ThePrimeagen/init.lua) + +--- + +## ๐Ÿ“„ License + +MIT - Do whatever you want with it! + +--- + +## ๐Ÿ™ Credits + +- **Neovim** Community +- **ThePrimeagen** - Harpoon & Inspiration +- **folke** - lazy.nvim, tokyonight +- **Fish Shell** Community +- **Ghostty** Team + +--- + +**Happy Coding!** ๐Ÿš€ diff --git a/install.sh b/install.sh index e2720c3..63e8386 100644 --- a/install.sh +++ b/install.sh @@ -1,11 +1,11 @@ #!/bin/bash # Dotfiles Installation Script - Cross-Platform -# Test Developer Setup: Fish or Zsh + Ghostty + Tools +# Optimiert fรผr Fish + Ghostty + Neovim Scratch Setup set -e # Exit on error -DOTFILES_DIR="$HOME/git/dotfiles" +DOTFILES_DIR="$HOME/gits/dotfiles" BACKUP_DIR="$HOME/.config-backup-$(date +%Y%m%d-%H%M%S)" # Colors @@ -38,12 +38,6 @@ detect_os() { elif [[ -f /etc/fedora-release ]]; then OS="fedora" PACKAGE_MANAGER="dnf" - elif [[ -f /etc/redhat-release ]]; then - OS="rhel" - PACKAGE_MANAGER="yum" - elif [[ -f /etc/opensuse-release ]]; then - OS="opensuse" - PACKAGE_MANAGER="zypper" else error "Unsupported operating system" exit 1 @@ -72,14 +66,6 @@ install_package_manager() { log "DNF detected - updating package database..." sudo dnf check-update || true ;; - "yum") - log "YUM detected - updating package database..." - sudo yum check-update || true - ;; - "zypper") - log "Zypper detected - updating package database..." - sudo zypper refresh - ;; esac } @@ -100,12 +86,6 @@ install_package() { "dnf") sudo dnf install -y "$package" ;; - "yum") - sudo yum install -y "$package" - ;; - "zypper") - sudo zypper install -y "$package" - ;; esac } @@ -118,51 +98,13 @@ install_cask() { brew install --cask "$app" ;; "pacman") - # This shouldn't be called for Arch anymore since we use yay directly - warn "Arch Linux packages should be installed via yay, not individual pacman calls" - ;; - "apt") - case $app in - "brave-browser") - # Add Brave repository - curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg - echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main" | sudo tee /etc/apt/sources.list.d/brave-browser-release.list - sudo apt update - sudo apt install -y brave-browser - ;; - "postman") - warn "Install Postman via Snap: sudo snap install postman" - ;; - "1password") - # Add 1Password repository - curl -sS https://downloads.1password.com/linux/keys/1password.asc | sudo gpg --dearmor --output /usr/share/keyrings/1password-archive-keyring.gpg - echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/1password-archive-keyring.gpg] https://downloads.1password.com/linux/debian/amd64 stable main' | sudo tee /etc/apt/sources.list.d/1password.list - sudo apt update - sudo apt install -y 1password - ;; - "parsec") - warn "Download Parsec manually from parseapp.com" - ;; - "ghostty") - warn "Ghostty needs manual installation or Flatpak" - ;; - esac - ;; - "dnf"|"yum") - case $app in - "brave-browser") - sudo dnf config-manager --add-repo https://brave-browser-rpm-release.s3.brave.com/x86_64/ - sudo rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc - sudo dnf install -y brave-browser - ;; - *) - warn "Install $app via Flatpak: flatpak install $app" - ;; - esac + # Use yay for AUR packages + if command -v yay &> /dev/null; then + yay -S --noconfirm "$app" + fi ;; *) - warn "GUI app installation for $app not implemented for $PACKAGE_MANAGER" - warn "Consider using Flatpak: flatpak install $app" + warn "GUI app installation for $app not supported on $OS" ;; esac } @@ -170,8 +112,8 @@ install_cask() { header() { echo -e "${BLUE} โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•— -โ•‘ Complete Development Setup โ•‘ -โ•‘ Cross-Platform Tool Installer โ•‘ +โ•‘ QA Engineer Dev Setup โ•‘ +โ•‘ TypeScript/Playwright + Go โ•‘ โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•${NC}" } @@ -195,45 +137,48 @@ backup_configs() { # Backup existing configs [ -d ~/.config/fish ] && cp -r ~/.config/fish "$BACKUP_DIR/" - [ -f ~/.zshrc ] && cp ~/.zshrc "$BACKUP_DIR/" [ -d ~/.config/ghostty ] && cp -r ~/.config/ghostty "$BACKUP_DIR/" + [ -d ~/.config/nvim ] && cp -r ~/.config/nvim "$BACKUP_DIR/" [ -d ~/.config/neofetch ] && cp -r ~/.config/neofetch "$BACKUP_DIR/" + [ -d ~/.config/btop ] && cp -r ~/.config/btop "$BACKUP_DIR/" + [ -d ~/.config/yabai ] && cp -r ~/.config/yabai "$BACKUP_DIR/" [ -f ~/.config/starship.toml ] && cp ~/.config/starship.toml "$BACKUP_DIR/" + [ -f ~/.zshrc ] && cp ~/.zshrc "$BACKUP_DIR/" log "Backup created: $BACKUP_DIR" } -install_tools() { - log "Installing development tools..." +install_core_tools() { + log "Installing core development tools..." - # Core tools - OS specific package names case $OS in "macos") - # Command line tools - install_package starship - install_package neofetch - install_package btop + # Essential CLI tools install_package git + install_package neovim + install_package fish + install_package starship install_package fzf install_package ripgrep install_package fd install_package bat + install_package btop + install_package neofetch + + # Development install_package go install_package python3 install_package node - install_package syncthing - install_package tailscale - install_package vim - # GUI Applications - install_cask parsec - install_cask postman - install_cask 1password - install_cask brave-browser + # Terminal install_cask ghostty + + # Optional tools + install_package direnv + install_package lazygit ;; "arch") - # Check if yay is installed, install if not + # Check if yay is installed if ! command -v yay &> /dev/null; then log "Installing yay AUR helper..." sudo pacman -S --needed base-devel git @@ -242,693 +187,196 @@ install_tools() { cd - && rm -rf /tmp/yay fi - # Install everything via yay (handles both official repos + AUR) - log "Installing all packages via yay..." + # Install via yay yay -S --noconfirm \ - starship \ - neofetch \ - btop \ - git \ - fzf \ - ripgrep \ - fd \ - bat \ - go \ - python \ - nodejs \ - npm \ - syncthing \ - tailscale \ - vim \ - parsec \ - postman-bin \ - 1password \ - brave-bin \ - ghostty + git neovim fish starship fzf ripgrep fd bat btop neofetch \ + go python nodejs npm \ + ghostty direnv lazygit ;; - "debian") - # Command line tools + "debian"|"fedora") + # Basic tools install_package git + install_package fish install_package fzf install_package ripgrep install_package fd-find install_package bat - install_package golang-go - install_package python3 - install_package nodejs - install_package npm - install_package syncthing - install_package vim - - # Install starship manually - curl -sS https://starship.rs/install.sh | sh install_package neofetch - # Tailscale - curl -fsSL https://tailscale.com/install.sh | sh + # Neovim (from source if needed) + if ! command -v nvim &> /dev/null; then + warn "Installing Neovim from source..." + install_neovim_from_source + fi - warn "GUI applications need manual installation on Debian/Ubuntu:" - warn "- Parsec, Postman, 1Password, Brave Browser" - warn "- btop may need manual installation on older versions" - ;; - "fedora"|"rhel") - # Command line tools - install_package git - install_package fzf - install_package ripgrep - install_package fd-find - install_package bat + # Starship + curl -sS https://starship.rs/install.sh | sh + + # Development install_package golang install_package python3 install_package nodejs - install_package npm - install_package syncthing - install_package vim - # Install starship manually - curl -sS https://starship.rs/install.sh | sh - install_package neofetch - - # Tailscale - curl -fsSL https://tailscale.com/install.sh | sh - - warn "GUI applications available via Flatpak or manual installation" - ;; - "opensuse") - # Command line tools - install_package git - install_package fzf - install_package ripgrep - install_package fd - install_package bat - install_package go - install_package python3 - install_package nodejs - install_package npm - install_package syncthing - install_package vim - - # Install starship manually - curl -sS https://starship.rs/install.sh | sh - install_package neofetch - - # Tailscale - curl -fsSL https://tailscale.com/install.sh | sh - - warn "GUI applications may need manual installation" + warn "Ghostty needs manual installation on $OS" ;; esac - # Setup vim and other tools - setup_vim - install_node_tools - - log "Tools installation complete!" - - # Show post-installation notes - show_post_install_notes + log "Core tools installed!" } -show_post_install_notes() { +install_neovim_from_source() { + log "Building Neovim from source..." + + # Install build dependencies case $OS in - "macos"|"arch") - log "All tools installed successfully!" + "debian") + sudo apt install -y ninja-build gettext cmake unzip curl build-essential ;; - "debian"|"fedora"|"rhel"|"opensuse") - warn "Additional GUI apps can be installed via:" - warn "โ€ข Flatpak: flatpak install brave postman" - warn "โ€ข Snap: snap install brave postman" - warn "โ€ข Manual downloads from official websites" - warn "โ€ข AppImage versions where available" + "fedora") + sudo dnf install -y ninja-build cmake gcc make unzip gettext curl ;; esac -} - -install_node_tools() { - log "Installing Node.js tools..." - # Ensure npm is available - if command -v npm &> /dev/null; then - npm install -g @playwright/test - npx playwright install - else - warn "npm not found, skipping Playwright installation" - fi -} - -setup_vim() { - log "Setting up Kickstart Vim..." + # Clone and build + cd /tmp + git clone https://github.com/neovim/neovim + cd neovim + git checkout stable + make CMAKE_BUILD_TYPE=Release + sudo make install + cd ~ + rm -rf /tmp/neovim - # Backup existing .vimrc - [ -f ~/.vimrc ] && mv ~/.vimrc ~/.vimrc.backup.$(date +%Y%m%d-%H%M%S) - - # Clone or update kickstart.vim - if [ -d ~/kickstart.vim ]; then - cd ~/kickstart.vim && git pull - else - git clone https://github.com/theopn/kickstart.vim.git ~/kickstart.vim - fi - - # Create symlink - ln -sf ~/kickstart.vim/.vimrc ~/.vimrc - - # Install plugins - vim +PlugInstall +qa -} - -setup_dotfiles_symlinks() { - log "Creating dotfiles symlinks..." - - # Remove existing configs - rm -rf ~/.config/neofetch ~/.config/btop - rm -f ~/.config/starship.toml - - # Create symlinks to dotfiles - common configs - ln -sf "$DOTFILES_DIR/neofetch" ~/.config/neofetch - ln -sf "$DOTFILES_DIR/terminal/starship.toml" ~/.config/starship.toml - - # Ghostty (only if directory exists in dotfiles) - if [ -d "$DOTFILES_DIR/terminal/ghostty" ]; then - rm -rf ~/.config/ghostty - ln -sf "$DOTFILES_DIR/terminal/ghostty" ~/.config/ghostty - fi - - # Btop config - mkdir -p ~/.config/btop - if [ -f "$DOTFILES_DIR/btop/btop.conf" ]; then - ln -sf "$DOTFILES_DIR/btop/btop.conf" ~/.config/btop/btop.conf - fi - if [ -d "$DOTFILES_DIR/btop/themes" ]; then - ln -sf "$DOTFILES_DIR/btop/themes" ~/.config/btop/themes - fi - - log "Dotfiles symlinks created!" -} - -setup_auto_updates() { - log "Setting up automatic system updates..." - - # Create update script - local update_script="$HOME/.local/bin/update-system.sh" - mkdir -p "$(dirname "$update_script")" - : - # Copy the update script content (same as before) - cat > "$update_script" << 'EOF' -#!/bin/bash - -# System Update Script -# Updates all packages, dotfiles, and development tools - -DOTFILES_DIR="$HOME/git/dotfiles" -LOG_FILE="$HOME/.local/share/system-updates.log" -LAST_UPDATE_FILE="$HOME/.local/share/last-system-update" -DATE=$(date '+%Y-%m-%d %H:%M:%S') - -# Colors for output -GREEN='\033[0;32m' -YELLOW='\033[1;33m' -RED='\033[0;31m' -NC='\033[0m' - -log() { - echo -e "${GREEN}[INFO]${NC} $1" - echo "[$DATE] INFO: $1" >> "$LOG_FILE" -} - -warn() { - echo -e "${YELLOW}[WARN]${NC} $1" - echo "[$DATE] WARN: $1" >> "$LOG_FILE" -} - -error() { - echo -e "${RED}[ERROR]${NC} $1" - echo "[$DATE] ERROR: $1" >> "$LOG_FILE" -} - -detect_os() { - if [[ "$OSTYPE" == "darwin"* ]]; then - OS="macos" - PACKAGE_MANAGER="brew" - elif [[ -f /etc/arch-release ]]; then - OS="arch" - PACKAGE_MANAGER="yay" - elif [[ -f /etc/debian_version ]]; then - OS="debian" - PACKAGE_MANAGER="apt" - elif [[ -f /etc/fedora-release ]]; then - OS="fedora" - PACKAGE_MANAGER="dnf" - elif [[ -f /etc/redhat-release ]]; then - OS="rhel" - PACKAGE_MANAGER="yum" - else - OS="unknown" - PACKAGE_MANAGER="unknown" - fi -} - -is_update_needed() { - if [ ! -f "$LAST_UPDATE_FILE" ]; then - return 0 # No previous update, run it - fi - - local last_update=$(cat "$LAST_UPDATE_FILE" 2>/dev/null || echo "0") - local current_date=$(date +%s) - local days_since_update=$(( (current_date - last_update) / 86400 )) - - if [ $days_since_update -ge 30 ]; then - log "Last update was $days_since_update days ago, running update..." - return 0 - else - log "Last update was $days_since_update days ago, skipping..." - return 1 - fi -} - -update_system_packages() { - log "Updating system packages ($OS)..." - - case $PACKAGE_MANAGER in - "brew") - brew update - brew upgrade - brew cleanup - ;; - "yay") - yay -Syu --noconfirm - yay -Yc --noconfirm - ;; - "apt") - sudo apt update - sudo apt upgrade -y - sudo apt autoremove -y - sudo apt autoclean - ;; - "dnf") - sudo dnf upgrade -y - sudo dnf autoremove -y - ;; - "yum") - sudo yum update -y - sudo yum clean all - ;; - esac -} - -update_dotfiles() { - log "Updating dotfiles..." - - if [ -d "$DOTFILES_DIR/.git" ]; then - cd "$DOTFILES_DIR" - git fetch origin - LOCAL=$(git rev-parse @) - REMOTE=$(git rev-parse @{u}) - - if [ "$LOCAL" != "$REMOTE" ]; then - git pull origin main || git pull origin master - log "Dotfiles updated" - else - log "Dotfiles up to date" - fi - fi -} - -update_vim_plugins() { - if [ -f "$HOME/.vimrc" ] && command -v vim &> /dev/null; then - vim +PlugUpdate +PlugClean! +qa - log "Vim plugins updated" - fi -} - -update_node_packages() { - if command -v npm &> /dev/null; then - npm update -g - log "npm packages updated" - fi - - if command -v npx &> /dev/null; then - npx playwright install 2>/dev/null || true - fi -} - -mark_update_completed() { - date +%s > "$LAST_UPDATE_FILE" - log "Update timestamp saved" -} - -main() { - mkdir -p "$(dirname "$LOG_FILE")" - mkdir -p "$(dirname "$LAST_UPDATE_FILE")" - - # Check if running with --force flag - if [[ "$1" == "--force" ]] || is_update_needed; then - echo "[$DATE] Starting system update..." >> "$LOG_FILE" - - detect_os - log "Starting update process..." - - update_system_packages - update_dotfiles - update_vim_plugins - update_node_packages - - mark_update_completed - log "Update completed!" - echo "[$DATE] Update completed" >> "$LOG_FILE" - fi -} - -main "$@" -EOF - - chmod +x "$update_script" - - # Create startup check script - create_startup_check "$update_script" - - # Setup traditional cron job (for always-on systems) - setup_cron_job "$update_script" - - # Setup system-specific startup methods - setup_startup_updates "$update_script" - - log "Auto-update system configured!" - log "Updates will run:" - log "โ€ข Monthly on 1st at 2:00 AM (if system is on)" - log "โ€ข At startup if update is overdue (30+ days)" - log "โ€ข Manual: $update_script --force" - log "View logs: tail -f ~/.local/share/system-updates.log" -} - -create_startup_check() { - local update_script="$1" - local startup_check="$HOME/.local/bin/check-updates-on-startup.sh" - - cat > "$startup_check" << EOF -#!/bin/bash -# Check for overdue updates on startup (runs max once per day) - -DAILY_CHECK_FILE="\$HOME/.local/share/daily-update-check" -TODAY=\$(date +%Y-%m-%d) - -# Only run once per day -if [ -f "\$DAILY_CHECK_FILE" ] && [ "\$(cat "\$DAILY_CHECK_FILE" 2>/dev/null)" = "\$TODAY" ]; then - exit 0 -fi - -# Mark today as checked -echo "\$TODAY" > "\$DAILY_CHECK_FILE" - -# Run update check in background (non-blocking) -nohup "$update_script" > /dev/null 2>&1 & -EOF - - chmod +x "$startup_check" - return "$startup_check" -} - -setup_startup_updates() { - local update_script="$1" - local startup_check="$HOME/.local/bin/check-updates-on-startup.sh" - - case $OS in - "macos") - setup_macos_startup "$startup_check" - ;; - "arch"|"debian"|"fedora"|"rhel") - setup_linux_startup "$startup_check" - ;; - esac -} - -setup_macos_startup() { - local startup_check="$1" - local plist_file="$HOME/Library/LaunchAgents/com.user.system-updates.plist" - - log "Setting up macOS LaunchAgent for startup updates..." - - mkdir -p "$HOME/Library/LaunchAgents" - - cat > "$plist_file" << EOF - - - - - Label - com.user.system-updates - ProgramArguments - - $startup_check - - RunAtLoad - - StandardOutPath - $HOME/.local/share/startup-updates.log - StandardErrorPath - $HOME/.local/share/startup-updates-error.log - - -EOF - - # Load the LaunchAgent - launchctl load "$plist_file" 2>/dev/null || warn "LaunchAgent setup may need manual activation" - log "macOS startup updates configured" -} - -setup_linux_startup() { - local startup_check="$1" - - # Try systemd user service first - if command -v systemctl &> /dev/null; then - setup_systemd_user_service "$startup_check" - else - # Fallback to shell profile - setup_shell_profile_check "$startup_check" - fi -} - -setup_systemd_user_service() { - local startup_check="$1" - local service_dir="$HOME/.config/systemd/user" - - log "Setting up systemd user service for startup updates..." - - mkdir -p "$service_dir" - - # Create service file - cat > "$service_dir/system-updates.service" << EOF -[Unit] -Description=System Updates Check -After=network-online.target - -[Service] -Type=oneshot -ExecStart=$startup_check -StandardOutput=append:$HOME/.local/share/startup-updates.log -StandardError=append:$HOME/.local/share/startup-updates-error.log - -[Install] -WantedBy=default.target -EOF - - # Enable the service - systemctl --user daemon-reload - systemctl --user enable system-updates.service - - log "systemd user service configured" -} - -setup_shell_profile_check() { - local startup_check="$1" - - log "Adding startup update check to shell profiles..." - - # Add to shell profiles (as fallback) - local check_line="# Auto-update check (once per day) -if [ -f \"$startup_check\" ]; then - \"$startup_check\" & -fi" - - # Add to profiles that exist - for profile in ~/.profile ~/.bash_profile ~/.zprofile; do - if [ -f "$profile" ]; then - if ! grep -q "check-updates-on-startup" "$profile"; then - echo "$check_line" >> "$profile" - log "Added to $profile" - fi - fi - done -} - -setup_cron_job() { - local script_path="$1" - - log "Setting up monthly cron job..." - - # Create cron job entry - local cron_job="0 2 1 * * $script_path >> ~/.local/share/cron-updates.log 2>&1" - - # Add to crontab if not already present - (crontab -l 2>/dev/null | grep -v "$script_path"; echo "$cron_job") | crontab - - - log "Cron job installed: Monthly updates on 1st at 2:00 AM" - - # Show current crontab - log "Current cron jobs:" - crontab -l | grep -v "^#" || warn "No cron jobs found" + log "Neovim installed from source" } setup_fish() { log "Setting up Fish shell..." - # Install Fish - install_package fish - # Install Fisher (Fish plugin manager) - if ! command -v fisher &> /dev/null; then - fish -c "curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher" + if ! fish -c "type -q fisher" 2>/dev/null; then + log "Installing Fisher..." + fish -c "curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher" fi - # Remove existing fish config - rm -rf ~/.config/fish + # Remove existing fish config (if not symlink) + if [ ! -L ~/.config/fish ] && [ -d ~/.config/fish ]; then + rm -rf ~/.config/fish + fi # Create symlink to dotfiles - ln -sf "$DOTFILES_DIR/shells/fish" ~/.config/fish + ln -sf "$DOTFILES_DIR/.config/fish" ~/.config/fish # Install Fish plugins log "Installing Fish plugins..." - fish -c "fisher install jorgebucaran/nvm.fish" - fish -c "fisher install PatrickF1/fzf.fish" - fish -c "fisher install franciscolourenco/done" - - # Install Node.js via NVM (if available) - if command -v fish &> /dev/null; then - fish -c "nvm install latest && nvm use latest" || warn "NVM setup failed, Node.js should be available via system package" - fi + fish -c "fisher install jorgebucaran/nvm.fish" || true + fish -c "fisher install PatrickF1/fzf.fish" || true + fish -c "fisher install franciscolourenco/done" || true # Set as default shell local fish_path=$(which fish) - if ! grep -q "$fish_path" /etc/shells; then + if ! grep -q "$fish_path" /etc/shells 2>/dev/null; then echo "$fish_path" | sudo tee -a /etc/shells fi - chsh -s "$fish_path" + + if [ "$SHELL" != "$fish_path" ]; then + log "Setting Fish as default shell..." + chsh -s "$fish_path" + fi log "Fish shell configured!" } -setup_zsh() { - log "Setting up Zsh shell..." +setup_neovim() { + log "Setting up Neovim..." - # Install Zsh - install_package zsh - - # Remove existing configs - rm -rf ~/.zshrc ~/.oh-my-zsh - - # Install Oh My Zsh - RUNZSH=no sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" - - # Install NVM for Zsh (cross-platform) - if [ ! -d "$HOME/.nvm" ]; then - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash + # Remove existing nvim config (if not symlink) + if [ ! -L ~/.config/nvim ] && [ -d ~/.config/nvim ]; then + rm -rf ~/.config/nvim fi - # Create symlink to dotfiles - ln -sf "$DOTFILES_DIR/shells/zsh/.zshrc" ~/.zshrc + # Create symlink + ln -sf "$DOTFILES_DIR/.config/nvim" ~/.config/nvim - # Install Node.js via NVM - export NVM_DIR="$HOME/.nvm" - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" - if command -v nvm &> /dev/null; then - nvm install node && nvm use node - else - warn "NVM setup failed, using system Node.js" - fi - - # Set as default shell - local zsh_path=$(which zsh) - if ! grep -q "$zsh_path" /etc/shells; then - echo "$zsh_path" | sudo tee -a /etc/shells - fi - chsh -s "$zsh_path" - - log "Zsh shell configured!" + log "Neovim configured! Run 'nvim' to install plugins on first start." } -show_menu() { - echo -e "${BLUE} -Select your shell setup: +setup_other_configs() { + log "Setting up other configurations..." + + # Ghostty + if [ -d "$DOTFILES_DIR/.config/ghostty" ]; then + rm -rf ~/.config/ghostty + ln -sf "$DOTFILES_DIR/.config/ghostty" ~/.config/ghostty + fi + + # Starship + ln -sf "$DOTFILES_DIR/.config/starship.toml" ~/.config/starship.toml + + # Neofetch + if [ -d "$DOTFILES_DIR/.config/neofetch" ]; then + rm -rf ~/.config/neofetch + ln -sf "$DOTFILES_DIR/.config/neofetch" ~/.config/neofetch + fi + + # Btop + if [ -d "$DOTFILES_DIR/.config/btop" ]; then + mkdir -p ~/.config/btop + ln -sf "$DOTFILES_DIR/.config/btop/btop.conf" ~/.config/btop/btop.conf + [ -d "$DOTFILES_DIR/.config/btop/themes" ] && ln -sf "$DOTFILES_DIR/.config/btop/themes" ~/.config/btop/themes + fi + + # Yabai (macOS only) + if [ "$OS" = "macos" ] && [ -d "$DOTFILES_DIR/.config/yabai" ]; then + rm -rf ~/.config/yabai + ln -sf "$DOTFILES_DIR/.config/yabai" ~/.config/yabai + fi + + # Zsh (if exists) + if [ -f "$DOTFILES_DIR/.zshrc" ]; then + ln -sf "$DOTFILES_DIR/.zshrc" ~/.zshrc + fi + + log "Configurations symlinked!" +} -1) Fish Shell - - Modern auto-completion - - Clean configuration - - User-friendly syntax - -2) Zsh Shell - - POSIX compatible - - Oh-My-Zsh framework - - Traditional Unix shell - -Detected OS: $OS ($PACKAGE_MANAGER) - -Tools to be installed: -โ€ข Development: Go, Python, Node.js, Git, Vim -โ€ข Terminal: Starship, Neofetch, btop, fzf, ripgrep, fd, bat -โ€ข Networking: Syncthing, Tailscale -โ€ข Applications: Parsec, Postman, 1Password, Brave Browser -โ€ข Testing: Playwright framework - -${NC}" - read -p "Choose (1-2): " choice +install_playwright() { + log "Installing Playwright..." + + if command -v npm &> /dev/null; then + npm install -g @playwright/test + npx playwright install + log "Playwright installed!" + else + warn "npm not found, skipping Playwright" + fi } main() { header check_prerequisites backup_configs - install_tools - setup_dotfiles_symlinks - setup_auto_updates - - show_menu - - case $choice in - 1) - setup_fish - log "Fish setup complete! Restart your terminal." - ;; - 2) - setup_zsh - log "Zsh setup complete! Restart your terminal." - ;; - *) - error "Invalid choice. Exiting." - exit 1 - ;; - esac + install_core_tools + setup_fish + setup_neovim + setup_other_configs + install_playwright echo -e "${GREEN} โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•— โ•‘ Setup Complete! โ•‘ โ•‘ โ•‘ -โ•‘ โœ“ $OS system detected โ•‘ +โ•‘ โœ“ $OS detected โ•‘ +โ•‘ โœ“ Fish shell configured โ•‘ +โ•‘ โœ“ Neovim (Scratch) configured โ•‘ +โ•‘ โœ“ Ghostty terminal configured โ•‘ โ•‘ โœ“ Development tools installed โ•‘ โ•‘ โœ“ Dotfiles symlinked โ•‘ -โ•‘ โœ“ Shell configured โ•‘ -โ•‘ โœ“ Smart auto-updates enabled โ•‘ โ•‘ โ•‘ -โ•‘ Updates run automatically: โ•‘ -โ•‘ โ€ข Monthly (1st at 2 AM) if system is on โ•‘ -โ•‘ โ€ข At startup if overdue (30+ days) โ•‘ -โ•‘ โ€ข Max once per day (non-blocking) โ•‘ -โ•‘ โ•‘ -โ•‘ Manual commands: โ•‘ -โ•‘ โ€ข Force update: ~/.local/bin/update-system.sh --force โ•‘ -โ•‘ โ€ข View logs: tail -f ~/.local/share/system-updates.log โ•‘ -โ•‘ โ•‘ -โ•‘ Perfect for laptops and desktops! โ•‘ -โ•‘ โ•‘ -โ•‘ Restart terminal to see changes! โ•‘ +โ•‘ Next steps: โ•‘ +โ•‘ 1. Restart your terminal โ•‘ +โ•‘ 2. Run 'nvim' to install plugins โ•‘ +โ•‘ 3. Enjoy your setup! โ•‘ โ•‘ โ•‘ โ•‘ Backup: $BACKUP_DIR โ•‘ โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•${NC}"