diff --git a/.luarc.json b/.luarc.json new file mode 100644 index 0000000..0b79da3 --- /dev/null +++ b/.luarc.json @@ -0,0 +1,198 @@ +{ + "workspace.library": [ + "/home/thallada/.local/share/nvim/site/pack/packer/start/neodev.nvim/types/nightly", + "/home/linuxbrew/.linuxbrew/Cellar/neovim/HEAD-b2e8c0d/share/nvim/runtime/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/opt/copilot.lua/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/opt/crates.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/opt/nvim-code-action-menu/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/Comment.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/alpha-nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/auto-session/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/bufferline.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/cellular-automaton.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/cmp-buffer/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/cmp-cmdline/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/cmp-git/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp-signature-help/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/cmp-path/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/cmp-vsnip/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/copilot-cmp/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/diffview.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/fidget.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/git-conflict.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/gitsigns.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/goto-preview/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/gruvbox.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/gui-font-resize.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/impatient.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/indent-blankline.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/kanagawa.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/leap.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/lspkind.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/lualine.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/mason-lspconfig.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/mason.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/neoai.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/neodev.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/neotest/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/neotest-rust/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nui.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/null-ls.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/numb.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-autopairs/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-cmp/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-colorizer.lua/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-dap/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-dap-ui/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-dap-virtual-text/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-lastplace/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-lightbulb/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-lspconfig/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-pqf/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-surround/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-treesitter/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-treesitter-context/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-treesitter-pairs/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-treesitter-refactor/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-treesitter-textobjects/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-ts-autotag/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-ts-context-commentstring/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-web-devicons/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/octo.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/oil.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/oxocarbon.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/packer.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/plenary.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/rest.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/rust-tools.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/session-lens/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/telescope-emoji.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/telescope-env.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/telescope-fzf-native.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/telescope-github.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/telescope-project.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/telescope-ui-select.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/telescope.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/toggleterm.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/tokyonight.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/treesj/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/trouble.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/true-zen.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/typescript.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/vim-startuptime/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/which-key.nvim/lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/winshift.nvim/lua", + "/home/thallada/.config/nvim", + "/home/thallada/.local/share/nvim/site", + "/home/thallada/.local/share/nvim/site/pack/packer/start/Comment.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/FixCursorHold.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/alpha-nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/auto-session", + "/home/thallada/.local/share/nvim/site/pack/packer/start/bufferline.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/cellular-automaton.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/cmp-buffer", + "/home/thallada/.local/share/nvim/site/pack/packer/start/cmp-cmdline", + "/home/thallada/.local/share/nvim/site/pack/packer/start/cmp-git", + "/home/thallada/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp", + "/home/thallada/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp-signature-help", + "/home/thallada/.local/share/nvim/site/pack/packer/start/cmp-path", + "/home/thallada/.local/share/nvim/site/pack/packer/start/cmp-vsnip", + "/home/thallada/.local/share/nvim/site/pack/packer/start/copilot-cmp", + "/home/thallada/.local/share/nvim/site/pack/packer/start/diffview.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/fidget.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/friendly-snippets", + "/home/thallada/.local/share/nvim/site/pack/packer/start/git-conflict.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/gitsigns.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/goto-preview", + "/home/thallada/.local/share/nvim/site/pack/packer/start/gruvbox.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/gui-font-resize.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/impatient.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/indent-blankline.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/kanagawa.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/leap.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/lspkind.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/lualine.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/mason-lspconfig.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/mason.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/neoai.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/neodev.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/neotest", + "/home/thallada/.local/share/nvim/site/pack/packer/start/neotest-rust", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nui.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/null-ls.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/numb.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-autopairs", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-cmp", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-colorizer.lua", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-dap", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-dap-ui", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-dap-virtual-text", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-lastplace", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-lightbulb", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-lspconfig", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-pqf", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-surround", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-treesitter", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-treesitter-context", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-treesitter-pairs", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-treesitter-refactor", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-treesitter-textobjects", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-ts-autotag", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-ts-context-commentstring", + "/home/thallada/.local/share/nvim/site/pack/packer/start/nvim-web-devicons", + "/home/thallada/.local/share/nvim/site/pack/packer/start/octo.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/oil.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/oxocarbon.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/packer.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/papercolor-theme", + "/home/thallada/.local/share/nvim/site/pack/packer/start/plenary.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/rest.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/rust-tools.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/session-lens", + "/home/thallada/.local/share/nvim/site/pack/packer/start/telescope-emoji.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/telescope-env.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/telescope-fzf-native.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/telescope-github.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/telescope-project.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/telescope-symbols.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/telescope-ui-select.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/telescope.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/toggleterm.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/tokyonight.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/treesj", + "/home/thallada/.local/share/nvim/site/pack/packer/start/trouble.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/true-zen.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/typescript.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/vim-eunuch", + "/home/thallada/.local/share/nvim/site/pack/packer/start/vim-fugitive", + "/home/thallada/.local/share/nvim/site/pack/packer/start/vim-just", + "/home/thallada/.local/share/nvim/site/pack/packer/start/vim-mundo", + "/home/thallada/.local/share/nvim/site/pack/packer/start/vim-repeat", + "/home/thallada/.local/share/nvim/site/pack/packer/start/vim-rhubarb", + "/home/thallada/.local/share/nvim/site/pack/packer/start/vim-sleuth", + "/home/thallada/.local/share/nvim/site/pack/packer/start/vim-startuptime", + "/home/thallada/.local/share/nvim/site/pack/packer/start/vim-unimpaired", + "/home/thallada/.local/share/nvim/site/pack/packer/start/vim-vsnip", + "/home/thallada/.local/share/nvim/site/pack/packer/start/which-key.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/winshift.nvim", + "/home/thallada/.local/share/nvim/site/pack/packer/start/zig.vim", + "/home/linuxbrew/.linuxbrew/Cellar/neovim/HEAD-b2e8c0d/share/nvim/runtime", + "/home/linuxbrew/.linuxbrew/Cellar/neovim/HEAD-b2e8c0d/share/nvim/runtime/pack/dist/opt/matchit", + "/home/thallada/.local/share/nvim/site/pack/packer/start/cmp-buffer/after", + "/home/thallada/.local/share/nvim/site/pack/packer/start/cmp-cmdline/after", + "/home/thallada/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp/after", + "/home/thallada/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp-signature-help/after", + "/home/thallada/.local/share/nvim/site/pack/packer/start/cmp-path/after", + "/home/thallada/.local/share/nvim/site/pack/packer/start/cmp-vsnip/after", + "/home/thallada/.local/share/nvim/site/pack/packer/start/octo.nvim/after", + "/home/thallada/.local/share/nvim/site/pack/packer/start/rest.nvim/after", + "/home/thallada/.config/nvim/after", + "/home/thallada/.config/nvim/lua", + "${3rd}/luassert/library", + "${3rd}/luv/library" + ], + "diagnostics.globals": [ + "vim" + ] +} \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md new file mode 100644 index 0000000..185280b --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# 💤 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/after/plugin/gruvbox.lua b/after/plugin/gruvbox.lua deleted file mode 100644 index 35274c8..0000000 --- a/after/plugin/gruvbox.lua +++ /dev/null @@ -1,16 +0,0 @@ --- local colors = require("gruvbox.palette").get_base_colors({}, "dark", "hard"); --- --- function FixGruvbox() --- vim.api.nvim_set_hl(0, 'DiffviewDiffAddAsDelete', { bg = "#431313" }) --- vim.api.nvim_set_hl(0, 'DiffDelete', { bg = "none", fg = colors.dark2 }) --- vim.api.nvim_set_hl(0, 'DiffviewDiffDelete', { bg = "none", fg = colors.dark2 }) --- vim.api.nvim_set_hl(0, 'DiffAdd', { bg = "#142a03" }) --- vim.api.nvim_set_hl(0, 'DiffChange', { bg = "#3B3307" }) --- vim.api.nvim_set_hl(0, 'DiffText', { bg = "#4D520D" }) --- end --- FixGruvbox() --- --- vim.api.nvim_create_autocmd( --- "ColorScheme", --- { pattern = { "gruvbox" }, callback = FixGruvbox } --- ) diff --git a/ftplugin/markdown.lua b/ftplugin/markdown.lua deleted file mode 100644 index d840aec..0000000 --- a/ftplugin/markdown.lua +++ /dev/null @@ -1 +0,0 @@ -vim.opt.textwidth = 80 diff --git a/init.lua b/init.lua index 333aa3b..2514f9e 100644 --- a/init.lua +++ b/init.lua @@ -1,24 +1,2 @@ --- Dependencies needed for this config: --- ripgrep - https://github.com/BurntSushi/ripgrep --- fd - https://github.com/sharkdp/fd --- git - https://git-scm.com/ --- bat - https://github.com/sharkdp/bat - --- disables netrw -vim.g.loaded = 1 -vim.g.loaded_netrwPlugin = 1 - --- speed up loading Lua modules -if pcall(require, 'impatient') then - require('impatient') -else - print('Failed to load impatient.') -end - --- require('plenary.reload').reload_module('plugins') -require('install-plugins') - --- require('plenary.reload').reload_module('user.settings') --- require('plenary.reload').reload_module('user.keymaps') -require('user.settings') -require('user.keymaps') +-- bootstrap lazy.nvim, LazyVim and your plugins +require("config.lazy") diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..54b612a --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,89 @@ +{ + "LazyVim": { "branch": "main", "commit": "68ff818a5bb7549f90b05e412b76fe448f605ffb" }, + "LuaSnip": { "branch": "master", "commit": "df58ee1664cfda71479cd2bbd56114f56599eba6" }, + "SchemaStore.nvim": { "branch": "main", "commit": "54a4ea14b70cd3fc9db8217bb4ac9e1f78bfa390" }, + "alpha-nvim": { "branch": "main", "commit": "234822140b265ec4ba3203e3e0be0e0bb826dff5" }, + "bufferline.nvim": { "branch": "main", "commit": "9e8d2f695dd50ab6821a6a53a840c32d2067a78a" }, + "catppuccin": { "branch": "main", "commit": "a2107df4379d66e72a36a89792603151cebec1bf" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-calc": { "branch": "main", "commit": "ce91d14d2e7a8b3f6ad86d85e34d41c1ae6268d9" }, + "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, + "cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" }, + "cmp-git": { "branch": "main", "commit": "f900a4cf117300fdc3ba31d26f8b6223ccd9c574" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "conform.nvim": { "branch": "master", "commit": "cbc510ca5b4aec1fd104b6c6f070a7fcf36cc0c8" }, + "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, + "copilot.lua": { "branch": "master", "commit": "73047082d72fcfdde1f73b7f17ad495cffcbafaa" }, + "crates.nvim": { "branch": "main", "commit": "406295abeb7eedae3bcee3f0db690ada605c629c" }, + "dial.nvim": { "branch": "master", "commit": "019bbe9daea397c93a99adc747f8f071379fee5c" }, + "diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" }, + "dressing.nvim": { "branch": "master", "commit": "fe3071330a0720ce3695ac915820c8134b22d1b0" }, + "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, + "friendly-snippets": { "branch": "main", "commit": "43727c2ff84240e55d4069ec3e6158d74cb534b6" }, + "gitsigns.nvim": { "branch": "main", "commit": "5fc573f2d2a49aec74dd6dc977e8b137429d1897" }, + "gruvbox.nvim": { "branch": "main", "commit": "517b012757fbe7a4d6e507baf5cc75837e62734f" }, + "headlines.nvim": { "branch": "master", "commit": "e3d7bfdf40e41a020d966d35f8b48d75b90367d2" }, + "inc-rename.nvim": { "branch": "main", "commit": "14922a84777702244a499b43134b9d04e640cbcd" }, + "indent-blankline.nvim": { "branch": "master", "commit": "29be0919b91fb59eca9e90690d76014233392bef" }, + "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, + "lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" }, + "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "f522b5439bedac0225daf8d2fedb5039b59e83ee" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "5b4db7c0d6873436b42bcda0ba7cd4efa9206745" }, + "mason.nvim": { "branch": "main", "commit": "41e75af1f578e55ba050c863587cffde3556ffa6" }, + "mini.ai": { "branch": "main", "commit": "4a2e387b121352dfb478f440c9a5313a9d97006c" }, + "mini.bufremove": { "branch": "main", "commit": "f53c7f27e36009fe61563c11cde154b94a0e5b94" }, + "mini.comment": { "branch": "main", "commit": "3d9c8009615857e982f09bc5357fc95f2a2175f3" }, + "mini.files": { "branch": "main", "commit": "3f8af5f9e4bbedbacbade760531464c0d679490d" }, + "mini.hipatterns": { "branch": "main", "commit": "581ae9cab55fea530fecd3930925f4ef1c7703af" }, + "mini.indentscope": { "branch": "main", "commit": "c8fdafa7bf603d758986a27eb546c55a5c73b1a3" }, + "mini.pairs": { "branch": "main", "commit": "71f117fd57f930da6ef4126b24f594dd398bac26" }, + "mini.surround": { "branch": "main", "commit": "af8129efcabe95fc08a233e9f91569829bed031f" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "230ff118613fa07138ba579b89d13ec2201530b9" }, + "neoconf.nvim": { "branch": "main", "commit": "64437787dba70fce50dad7bfbb97d184c5bc340f" }, + "neodev.nvim": { "branch": "main", "commit": "f972d7e6cd21b691199565cfe3e6487e774a4e8f" }, + "neotest": { "branch": "master", "commit": "d424d262d01bccc1e0b038c9a7220a755afd2a1f" }, + "neotest-python": { "branch": "master", "commit": "c969a5b0073f2b5c8eaf017d1652f9251d761a15" }, + "neotest-rust": { "branch": "main", "commit": "46428d9013023f516a61274a78b0cee87fb7e8bc" }, + "noice.nvim": { "branch": "main", "commit": "92433164e2f7118d4122c7674c3834d9511722ba" }, + "nui.nvim": { "branch": "main", "commit": "257dccc43b4badc735978f0791d216f7d665b75a" }, + "numb.nvim": { "branch": "master", "commit": "3f7d4a74bd456e747a1278ea1672b26116e0824d" }, + "nvim-cmp": { "branch": "main", "commit": "0b751f6beef40fd47375eaf53d3057e0bfa317e4" }, + "nvim-dap": { "branch": "master", "commit": "e154fdb6d70b3765d71f296e718b29d8b7026a63" }, + "nvim-dap-python": { "branch": "master", "commit": "e0be843877e7ae756ef1ee7a441ca0b9e1677da9" }, + "nvim-dap-ui": { "branch": "master", "commit": "34160a7ce6072ef332f350ae1d4a6a501daf0159" }, + "nvim-dap-virtual-text": { "branch": "master", "commit": "57f1dbd0458dd84a286b27768c142e1567f3ce3b" }, + "nvim-lint": { "branch": "master", "commit": "3a7c15331a57ba40a56f00f29173700af853fa03" }, + "nvim-lspconfig": { "branch": "master", "commit": "e4a56adbc51c55964253dce4505cec55c82c1c04" }, + "nvim-notify": { "branch": "master", "commit": "e4a2022f4fec2d5ebc79afa612f96d8b11c627b3" }, + "nvim-spectre": { "branch": "master", "commit": "a18a58015b46f02b4fe537ebfffd82e46110ff24" }, + "nvim-treesitter": { "branch": "master", "commit": "b056e4227b1c5d3ecfe96941352364c0c10668df" }, + "nvim-treesitter-context": { "branch": "master", "commit": "bf4d15ee4e96ff5201f16a4ed14443670662eb90" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "dbcd9388e3b119a87c785e10a00d62876077d23d" }, + "nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "b8ff464f2afc2000f6c72fa331a8fc090cb46b39" }, + "nvim-web-devicons": { "branch": "master", "commit": "5efb8bd06841f91f97c90e16de85e96d57e9c862" }, + "oil.nvim": { "branch": "master", "commit": "e89a8f8adeef2dfab851fd056d38ee7afc97c249" }, + "persistence.nvim": { "branch": "main", "commit": "ad538bfd5336f1335cdb6fd4e0b0eebfa6e12f32" }, + "plenary.nvim": { "branch": "master", "commit": "366b0837486f60ae0e7550c15de8ff66d057c4cd" }, + "project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" }, + "rust-tools.nvim": { "branch": "master", "commit": "0cc8adab23117783a0292a0c8a2fbed1005dc645" }, + "ssr.nvim": { "branch": "main", "commit": "bb323ba621ac647b4ac5638b47666e3ef3c279e1" }, + "telescope-emoji.nvim": { "branch": "master", "commit": "86248d97be84a1ce83f0541500ef9edc99ea2aa1" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, + "telescope-undo.nvim": { "branch": "main", "commit": "d3afc1c105535a90caec092ce27a113f77ba7b84" }, + "telescope.nvim": { "branch": "master", "commit": "e4c62dedd760d339bea5b8325c2d918d87476d00" }, + "todo-comments.nvim": { "branch": "main", "commit": "4a6737a8d70fe1ac55c64dfa47fcb189ca431872" }, + "toggleterm.nvim": { "branch": "main", "commit": "faee9d60428afc7857e0927fdc18daa6c409fa64" }, + "tokyonight.nvim": { "branch": "main", "commit": "f247ee700b569ed43f39320413a13ba9b0aef0db" }, + "treesj": { "branch": "main", "commit": "1d6e89f4790aa04eaae38fa9460a3ee191961c96" }, + "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, + "true-zen.nvim": { "branch": "main", "commit": "2b9e210e0d1a735e1fa85ec22190115dffd963aa" }, + "venv-selector.nvim": { "branch": "main", "commit": "c259dacb20a00fb84ec6006e9a24b4085b27120a" }, + "vim-illuminate": { "branch": "master", "commit": "3bd2ab64b5d63b29e05691e624927e5ebbf0fb86" }, + "vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" }, + "wezterm-types": { "branch": "main", "commit": "49f66ce40002f0ef881440c10f8854b02bb67c3f" }, + "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } +} \ No newline at end of file diff --git a/lazyvim.json b/lazyvim.json new file mode 100644 index 0000000..464c4ee --- /dev/null +++ b/lazyvim.json @@ -0,0 +1,25 @@ +{ + "extras": [ + "lazyvim.plugins.extras.coding.copilot", + "lazyvim.plugins.extras.dap.core", + "lazyvim.plugins.extras.editor.mini-files", + "lazyvim.plugins.extras.formatting.black", + "lazyvim.plugins.extras.formatting.prettier", + "lazyvim.plugins.extras.lang.docker", + "lazyvim.plugins.extras.lang.json", + "lazyvim.plugins.extras.lang.markdown", + "lazyvim.plugins.extras.lang.python", + "lazyvim.plugins.extras.lang.rust", + "lazyvim.plugins.extras.lang.typescript", + "lazyvim.plugins.extras.lang.yaml", + "lazyvim.plugins.extras.linting.eslint", + "lazyvim.plugins.extras.test.core", + "lazyvim.plugins.extras.ui.alpha", + "lazyvim.plugins.extras.util.mini-hipatterns", + "lazyvim.plugins.extras.util.project" + ], + "news": { + "NEWS.md": "2123" + }, + "version": 2 +} \ No newline at end of file diff --git a/lua/config/autocmds.lua b/lua/config/autocmds.lua new file mode 100644 index 0000000..27e9e06 --- /dev/null +++ b/lua/config/autocmds.lua @@ -0,0 +1,3 @@ +-- 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 diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua new file mode 100644 index 0000000..c938b14 --- /dev/null +++ b/lua/config/keymaps.lua @@ -0,0 +1,8 @@ +-- Keymaps are automatically loaded on the VeryLazy event +-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua +-- Add any additional keymaps here +local Util = require("lazyvim.util") + +vim.keymap.set("n", "H", function() + Util.terminal({ "clx" }) +end, { desc = "Toggle clx (console HackerNews) floating terminal" }) diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua new file mode 100644 index 0000000..891b190 --- /dev/null +++ b/lua/config/lazy.lua @@ -0,0 +1,46 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + -- bootstrap lazy.nvim + -- stylua: ignore + vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) +end +vim.opt.rtp:prepend(vim.env.LAZY or lazypath) + +require("lazy").setup({ + spec = { + -- add LazyVim and import its plugins + { "LazyVim/LazyVim", import = "lazyvim.plugins" }, + -- import any extras modules here + -- { import = "lazyvim.plugins.extras.lang.typescript" }, + -- { import = "lazyvim.plugins.extras.lang.json" }, + -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, + -- import/override with your plugins + { import = "plugins" }, + }, + defaults = { + -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. + -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. + lazy = false, + -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, + -- have outdated releases, which may break your Neovim install. + version = false, -- always use the latest git commit + -- version = "*", -- try installing the latest stable version for plugins that support semver + }, + install = { colorscheme = { "tokyonight", "habamax" } }, + checker = { enabled = true }, -- automatically check for plugin updates + performance = { + rtp = { + -- disable some rtp plugins + disabled_plugins = { + "gzip", + -- "matchit", + -- "matchparen", + -- "netrwPlugin", + "tarPlugin", + "tohtml", + "tutor", + "zipPlugin", + }, + }, + }, +}) diff --git a/lua/config/options.lua b/lua/config/options.lua new file mode 100644 index 0000000..214baf0 --- /dev/null +++ b/lua/config/options.lua @@ -0,0 +1,6 @@ +-- Options are automatically loaded before lazy.nvim startup +-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua +-- Add any additional options here + +-- idk if it does anything cause I have to set it in the nvim-cmp settings too +vim.opt.completeopt = "menu,menuone,noinsert,noselect" diff --git a/lua/install-plugins.lua b/lua/install-plugins.lua deleted file mode 100644 index 6431b06..0000000 --- a/lua/install-plugins.lua +++ /dev/null @@ -1,499 +0,0 @@ -local ensure_packer = function() - local fn = vim.fn - local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim' - if fn.empty(fn.glob(install_path)) > 0 then - fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path }) - vim.cmd [[packadd packer.nvim]] - return true - end - return false -end - -local packer_bootstrap = ensure_packer() - --- https://github.com/wbthomason/packer.nvim/issues/202 -require('packer').init({ - max_jobs = 50 -}) - -return require('packer').startup(function(use) - use 'wbthomason/packer.nvim' - - use 'lewis6991/impatient.nvim' - use 'nvim-lua/plenary.nvim' - use { - 'neovim/nvim-lspconfig', - requires = { - 'williamboman/mason.nvim', - 'williamboman/mason-lspconfig.nvim', - 'hrsh7th/cmp-nvim-lsp', - }, - config = function() - require('plugins.lsp') - end, - } - use { - 'j-hui/fidget.nvim', - tag = 'legacy', - config = function() - require('plugins.fidget-nvim') - end, - } - use { - "folke/neodev.nvim", - config = function() - require('plugins.neodev-nvim') - end, - } - use { - 'hrsh7th/nvim-cmp', - requires = { - 'hrsh7th/cmp-nvim-lsp', - 'hrsh7th/cmp-nvim-lsp-signature-help', - 'hrsh7th/cmp-buffer', - 'hrsh7th/cmp-path', - 'hrsh7th/cmp-cmdline', - }, - config = function() - require('plugins.nvim-cmp') - end, - } - use { - 'Saecki/crates.nvim', - event = { "BufRead Cargo.toml" }, - requires = { 'nvim-lua/plenary.nvim' }, - config = function() - require('plugins.crates-nvim') - end, - } - use { - 'petertriho/cmp-git', - requires = 'nvim-lua/plenary.nvim', - } - use { - 'rmagatti/goto-preview', - config = function() - require('plugins.goto-preview-nvim') - end, - } - use 'hrsh7th/cmp-vsnip' - use 'hrsh7th/vim-vsnip' - use 'rafamadriz/friendly-snippets' - use { - 'folke/trouble.nvim', - config = function() - require('plugins.trouble-nvim') - end, - } - use { - 'mfussenegger/nvim-dap', - config = function() - require('plugins.nvim-dap') - end, - } - use { - 'theHamsta/nvim-dap-virtual-text', - config = function() - require('plugins.nvim-dap-virtual-text') - end, - } - use { - 'rcarriga/nvim-dap-ui', - requires = { - 'mfussenegger/nvim-dap', - }, - config = function() - require('plugins.nvim-dap-ui') - end, - } - use { - 'kosayoda/nvim-lightbulb', - requires = 'antoinemadec/FixCursorHold.nvim', - config = function() - require('plugins.nvim-lightbulb') - end, - } - use { - 'weilbith/nvim-code-action-menu', - cmd = 'CodeActionMenu', - } - use 'onsails/lspkind.nvim' - use { - 'nvim-treesitter/nvim-treesitter', - run = function() require('nvim-treesitter.install').update({ with_sync = true }) end, - config = function() - require('plugins.nvim-treesitter') - end, - } - use { - 'nvim-treesitter/nvim-treesitter-textobjects', - requires = { - 'nvim-treesitter/nvim-treesitter', - }, - } - use { - 'theHamsta/nvim-treesitter-pairs', - requires = { - 'nvim-treesitter/nvim-treesitter', - }, - } - use { - 'windwp/nvim-ts-autotag', - requires = { - 'nvim-treesitter/nvim-treesitter', - }, - } - use { - 'windwp/nvim-autopairs', - config = function() - require('plugins.nvim-autopairs') - end, - } - use { - 'nvim-treesitter/nvim-treesitter-refactor', - requires = { - 'nvim-treesitter/nvim-treesitter', - }, - } - use { - 'JoosepAlviste/nvim-ts-context-commentstring', - requires = { - 'nvim-treesitter/nvim-treesitter', - }, - } - use { - 'numToStr/Comment.nvim', - requires = { - 'nvim-treesitter/nvim-treesitter', - }, - config = function() - require('plugins.comment-nvim') - end, - } - use { - 'nvim-treesitter/nvim-treesitter-context', - requires = { - 'nvim-treesitter/nvim-treesitter', - }, - config = function() - require('plugins.nvim-treesitter-context') - end, - } - use { - 'nvim-telescope/telescope.nvim', - requires = { 'nvim-lua/plenary.nvim' }, - config = function() - require('plugins.telescope') - end, - } - use { - 'nvim-telescope/telescope-fzf-native.nvim', - run = 'make', - requires = { - 'nvim-telescope/telescope.nvim', - }, - } - use { - 'nvim-telescope/telescope-symbols.nvim', - requires = { - 'nvim-telescope/telescope.nvim', - }, - } - use { - 'nvim-telescope/telescope-github.nvim', - requires = { - 'nvim-lua/plenary.nvim', - 'nvim-telescope/telescope.nvim', - }, - } - use { - 'LinArcX/telescope-env.nvim', - requires = { - 'nvim-telescope/telescope.nvim', - }, - } - use { - 'xiyaowong/telescope-emoji.nvim', - requires = { - 'nvim-telescope/telescope.nvim', - }, - } - use 'nvim-telescope/telescope-ui-select.nvim' - use 'nvim-telescope/telescope-project.nvim' - use 'NLKNguyen/papercolor-theme' - use { - 'akinsho/toggleterm.nvim', - tag = '*', - config = function() - require('plugins.toggleterm-nvim') - end, - } - use { - 'ethanholz/nvim-lastplace', - config = function() - require('plugins.lastplace-nvim') - end, - } - use { - 'nacro90/numb.nvim', - config = function() - require('plugins.numb-nvim') - end, - } - use { - 'tpope/vim-fugitive', - config = function() - require('plugins.fugitive') - end, - } - use 'tpope/vim-rhubarb' - use { - 'lewis6991/gitsigns.nvim', - config = function() - require('plugins.gitsigns') - end, - } - use { - 'sindrets/diffview.nvim', - requires = 'nvim-lua/plenary.nvim', - config = function() - require('plugins.diffview') - end, - } - use 'kyazdani42/nvim-web-devicons' - use { - 'pwntester/octo.nvim', - requires = { - 'nvim-lua/plenary.nvim', - 'nvim-telescope/telescope.nvim', - 'kyazdani42/nvim-web-devicons', - }, - config = function() - require('plugins.octo-nvim') - end - } - use { - 'stevearc/oil.nvim', - requires = { - 'nvim-tree/nvim-web-devicons', - }, - config = function() - require('plugins.oil-nvim') - end, - } - use { - 'kylechui/nvim-surround', - config = function() - require('plugins.surround-nvim') - end, - } - use { - 'ggandor/leap.nvim', - requires = 'tpope/vim-repeat', - config = function() - require('plugins.leap-nvim') - end, - } - use 'dstein64/vim-startuptime' - use { - 'nvim-neotest/neotest', - requires = { - 'nvim-lua/plenary.nvim', - 'nvim-treesitter/nvim-treesitter', - 'antoinemadec/FixCursorHold.nvim', - }, - config = function() - require('plugins.neotest') - end, - } - use 'rouge8/neotest-rust' - use { - 'simrat39/rust-tools.nvim', - requires = { - 'hrsh7th/nvim-cmp', - }, - config = function() - require('plugins.rust-tools-nvim') - end, - } - use { - 'jose-elias-alvarez/typescript.nvim', - config = function() - require('plugins.typescript-nvim') - end, - } - use { - 'zbirenbaum/copilot.lua', - cmd = 'Copilot', - event = 'InsertEnter', - config = function() - require('plugins.copilot') - end, - } - use { - 'zbirenbaum/copilot-cmp', - requires = { - 'hrsh7th/nvim-cmp', - 'zbirenbaum/copilot.lua', - }, - config = function () - require('plugins.copilot-cmp') - end - } - -- use 'github/copilot.vim' - use { "MunifTanjim/nui.nvim" } - use { - "Bryley/neoai.nvim", - require = { "MunifTanjim/nui.nvim" }, - config = function() - require('plugins.neoai-nvim') - end - } - use 'ziglang/zig.vim' - use { - 'akinsho/bufferline.nvim', - tag = "v3.*", - requires = 'kyazdani42/nvim-web-devicons', - config = function() - require('plugins.bufferline-nvim') - end, - } - use { - 'nvim-lualine/lualine.nvim', - requires = { - 'kyazdani42/nvim-web-devicons', - opt = true - }, - config = function() - require('plugins.lualine-nvim') - end, - } - use 'tpope/vim-unimpaired' - use 'tpope/vim-repeat' - use 'tpope/vim-eunuch' - use 'tpope/vim-sleuth' - use { - 'simnalamburt/vim-mundo', - config = function() - require('plugins.vim-mundo') - end, - } - use { - 'lukas-reineke/indent-blankline.nvim', - config = function() - require('plugins.indent-blankline-nvim') - end, - } - use { - 'ktunprasert/gui-font-resize.nvim', - config = function() - require('plugins.gui-font-resize-nvim') - end, - } - use { - 'jose-elias-alvarez/null-ls.nvim', - config = function() - require('plugins.null-ls-nvim') - end, - requires = { 'nvim-lua/plenary.nvim' }, - } - use { - 'rmagatti/auto-session', - config = function() - require('plugins.auto-session') - end - } - use { - 'rmagatti/session-lens', - requires = {'rmagatti/auto-session', 'nvim-telescope/telescope.nvim'}, - config = function() - require('plugins.session-lens') - end - } - use { - 'Pocco81/true-zen.nvim', - config = function() - require('plugins.true-zen-nvim') - end - } - use { - 'sindrets/winshift.nvim', - config = function() - require('plugins.winshift-nvim') - end, - } - use { - 'NTBBloodbath/rest.nvim', - requires = { 'nvim-lua/plenary.nvim' }, - config = function() - require('plugins.rest-nvim') - end, - } - use { - 'norcalli/nvim-colorizer.lua', - config = function() - require('plugins.nvim-colorizer') - end, - } - use { - 'folke/which-key.nvim', - config = function() - require('plugins.which-key-nvim') - end - } - use { - 'ellisonleao/gruvbox.nvim', - config = function() - require('plugins.gruvbox') - end, - } - use 'eandrju/cellular-automaton.nvim' - use 'nyoom-engineering/oxocarbon.nvim' - use 'folke/tokyonight.nvim' - use { - 'rebelot/kanagawa.nvim', - config = function() - require('plugins.kanagawa-nvim') - end, - } - use { - 'lifepillar/pgsql.vim', - ft = { 'sql' }, - config = function() - require('plugins.pgsql-vim') - end, - } - use 'NoahTheDuke/vim-just' - use { - 'yorickpeterse/nvim-pqf', - config = function() - require('plugins.nvim-pqf') - end, - } - use { - 'akinsho/git-conflict.nvim', - config = function() - require('plugins.git-conflict-nvim') - end, - } - use { - 'Wansmer/treesj', - requires = { 'nvim-treesitter' }, - config = function() - require('plugins.treesj') - end, - } - use { - 'goolord/alpha-nvim', - requires = { 'nvim-tree/nvim-web-devicons' }, - config = function () - require'alpha'.setup(require'alpha.themes.startify'.config) - end - } - - -- Automatically set up your configuration after cloning packer.nvim - -- Put this at the end after all plugins - if packer_bootstrap then - require('packer').sync() - end -end) diff --git a/lua/plugins/alpha-nvim.lua b/lua/plugins/alpha-nvim.lua deleted file mode 100644 index edc3ade..0000000 --- a/lua/plugins/alpha-nvim.lua +++ /dev/null @@ -1 +0,0 @@ -require('alpha').setup(require('alpha.themes.startify').config) diff --git a/lua/plugins/auto-session.lua b/lua/plugins/auto-session.lua deleted file mode 100644 index 814c579..0000000 --- a/lua/plugins/auto-session.lua +++ /dev/null @@ -1,7 +0,0 @@ -vim.o.sessionoptions='blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal' - -require('auto-session').setup({ - log_level = 'error', - auto_session_suppress_dirs = { '~/', '~/workspace', '~/Downloads', '/'}, - auto_session_enable_last_session = false, -}) diff --git a/lua/plugins/bufferline-nvim.lua b/lua/plugins/bufferline-nvim.lua deleted file mode 100644 index 69c7184..0000000 --- a/lua/plugins/bufferline-nvim.lua +++ /dev/null @@ -1,7 +0,0 @@ -vim.opt.termguicolors = true -require('bufferline').setup({ - options = { - mode = 'tabs', - diagnostics = 'nvim_lsp', - }, -}) diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua new file mode 100644 index 0000000..6a82c5c --- /dev/null +++ b/lua/plugins/colorscheme.lua @@ -0,0 +1,9 @@ +return { + { "ellisonleao/gruvbox.nvim" }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "gruvbox", + }, + }, +} diff --git a/lua/plugins/comment-nvim.lua b/lua/plugins/comment-nvim.lua deleted file mode 100644 index 0cbd4dd..0000000 --- a/lua/plugins/comment-nvim.lua +++ /dev/null @@ -1,69 +0,0 @@ -require("Comment").setup({ - ---Add a space b/w comment and the line - ---@type boolean|fun():boolean - padding = true, - - ---Whether the cursor should stay at its position - ---NOTE: This only affects NORMAL mode mappings and doesn't work with dot-repeat - ---@type boolean - sticky = true, - - ---Lines to be ignored while comment/uncomment. - ---Could be a regex string or a function that returns a regex string. - ---Example: Use '^$' to ignore empty lines - ---@type string|fun():string - ignore = nil, - - ---LHS of toggle mappings in NORMAL + VISUAL mode - ---@type table - toggler = { - ---Line-comment toggle keymap - line = "gcc", - ---Block-comment toggle keymap - block = "gbc", - }, - - ---LHS of operator-pending mappings in NORMAL + VISUAL mode - ---@type table - opleader = { - ---Line-comment keymap - line = "gc", - ---Block-comment keymap - block = "gb", - }, - - ---LHS of extra mappings - ---@type table - extra = { - ---Add comment on the line above - above = "gcO", - ---Add comment on the line below - below = "gco", - ---Add comment at the end of line - eol = "gcA", - }, - - ---Create basic (operator-pending) and extended mappings for NORMAL + VISUAL mode - ---NOTE: If `mappings = false` then the plugin won't create any mappings - ---@type boolean|table - mappings = { - ---Operator-pending mapping - ---Includes `gcc`, `gbc`, `gc[count]{motion}` and `gb[count]{motion}` - ---NOTE: These mappings can be changed individually by `opleader` and `toggler` config - basic = true, - ---Extra mapping - ---Includes `gco`, `gcO`, `gcA` - extra = true, - ---Extended mapping - ---Includes `g>`, `g<`, `g>[count]{motion}` and `g<[count]{motion}` - extended = false, - }, - - ---Pre-hook, called before commenting the line - ---@type fun(ctx: CommentCtx):string - pre_hook = nil, - - ---Post-hook, called after commenting is done - ---@type fun(ctx: CommentCtx) - post_hook = nil, -}) diff --git a/lua/plugins/copilot-cmp.lua b/lua/plugins/copilot-cmp.lua deleted file mode 100644 index bb5620f..0000000 --- a/lua/plugins/copilot-cmp.lua +++ /dev/null @@ -1,3 +0,0 @@ -local cmp = require('copilot_cmp') - -cmp.setup() diff --git a/lua/plugins/copilot.lua b/lua/plugins/copilot.lua deleted file mode 100644 index 4a371e5..0000000 --- a/lua/plugins/copilot.lua +++ /dev/null @@ -1,4 +0,0 @@ -require('copilot').setup({ - suggestion = { enabled = false }, - panel = { enabled = false }, -}); diff --git a/lua/plugins/crates-nvim.lua b/lua/plugins/crates-nvim.lua deleted file mode 100644 index 4e6360d..0000000 --- a/lua/plugins/crates-nvim.lua +++ /dev/null @@ -1,23 +0,0 @@ -local crates = require('crates') -local opts = { silent = true } - -crates.setup() - -vim.keymap.set('n', 'ct', crates.toggle, { silent = true, desc = "Rust [C]rate [T]oggle" }) -vim.keymap.set('n', 'cr', crates.reload, { silent = true, desc = "Rust [C]rate [R]eload"}) - -vim.keymap.set('n', 'cv', crates.show_versions_popup, { silent = true, desc = "Rust [C]rate show [V]ersions" }) -vim.keymap.set('n', 'cf', crates.show_features_popup, { silent = true, desc = "Rust [C]rate show [F]eatures" }) -vim.keymap.set('n', 'cd', crates.show_dependencies_popup, { silent = true, desc = "Rust [C]rate show [D]ependencies" }) - -vim.keymap.set('n', 'cu', crates.update_crate, { silent = true, desc = "Rust [C]rate [U]pdate (to newest compatible version)" }) -vim.keymap.set('v', 'cu', crates.update_crates, { silent = true, desc = "Rust [C]rates [U]pdate (to newest compatible versions)" }) -vim.keymap.set('n', 'ca', crates.update_all_crates, { silent = true, desc = "Rust [C]rates update [A]ll (to newest compatible versions)" }) -vim.keymap.set('n', 'cU', crates.upgrade_crate, { silent = true, desc = "Rust [C]rate [U]pgrade" }) -vim.keymap.set('v', 'cU', crates.upgrade_crates, { silent = true, desc = "Rust [C]rates [U]pgrade" }) -vim.keymap.set('n', 'cA', crates.upgrade_all_crates, { silent = true, desc = "Rust [C]rates upgrade [A]ll" }) - -vim.keymap.set('n', 'cH', crates.open_homepage, { silent = true, desc = "Rust [C]rate open [H]omepage" }) -vim.keymap.set('n', 'cR', crates.open_repository, { silent = true, desc = "Rust [C]rate open [R]epository" }) -vim.keymap.set('n', 'cD', crates.open_documentation, { silent = true, desc = "Rust [C]rate open [D]ocumentation" }) -vim.keymap.set('n', 'cC', crates.open_crates_io, { silent = true, desc = "Rust [C]rate open [C]rates.io" }) diff --git a/lua/plugins/dial.lua b/lua/plugins/dial.lua new file mode 100644 index 0000000..ac30388 --- /dev/null +++ b/lua/plugins/dial.lua @@ -0,0 +1,35 @@ +-- better increase/descrease +return { + "monaqa/dial.nvim", + keys = { + { + "", + function() + return require("dial.map").inc_normal() + end, + expr = true, + desc = "Increment", + }, + { + "", + function() + return require("dial.map").dec_normal() + end, + expr = true, + desc = "Decrement", + }, + }, + config = function() + local augend = require("dial.augend") + require("dial.config").augends:register_group({ + default = { + augend.integer.alias.decimal, + augend.integer.alias.hex, + augend.date.alias["%Y/%m/%d"], + augend.constant.alias.bool, + augend.semver.alias.semver, + augend.constant.new({ elements = { "let", "const" } }), + }, + }) + end, +} diff --git a/lua/plugins/diffview.lua b/lua/plugins/diffview.lua index ab634bc..ad21fb4 100644 --- a/lua/plugins/diffview.lua +++ b/lua/plugins/diffview.lua @@ -1,21 +1,24 @@ -local actions = require("diffview.actions") - -require("diffview").setup({ - enhanced_diff_hl = true, - keymaps = { - view = { - ["gq"] = "DiffviewClose", - }, - file_panel = { - ["gq"] = "DiffviewClose", - }, - file_history_panel = { - ["gq"] = "DiffviewClose", - }, - } -}) - -vim.keymap.set('v', 'gl', [['<,'>DiffviewFileHistory]], { noremap = false, silent = true, desc = "Toggle [G]it [L]og of selected lines" }) -vim.keymap.set('n', 'gL', [[DiffviewFileHistory]], { noremap = false, silent = true, desc = "Toggle [G]it [L]og of current branch" }) -vim.keymap.set('n', 'gl', [[DiffviewFileHistory %]], { noremap = false, silent = true, desc = "Toggle [G]it [L]og of current file history" }) -vim.keymap.set('n', 'gd', [[DiffviewOpen]], { noremap = false, silent = true, desc = "[G]it [D]iff current file against index" }) +return { + "sindrets/diffview.nvim", + cmd = { "DiffviewOpen", "DiffviewClose", "DiffviewToggleFiles", "DiffviewFocusFiles" }, + opts = { + enhanced_diff_hl = true, + keymaps = { + view = { + ["gq"] = "DiffviewClose", + }, + file_panel = { + ["gq"] = "DiffviewClose", + }, + file_history_panel = { + ["gq"] = "DiffviewClose", + }, + }, + }, + keys = { + { "v", "gl", "'<,'>DiffviewFileHistory", desc = "Toggle git log of selected lines" }, + { "gL", "DiffviewFileHistory", desc = "Toggle git log of current branch" }, + { "gl", "DiffviewFileHistory %", desc = "Toggle git log of current file history" }, + { "gd", "DiffviewOpen", desc = "Git diff current file against the index" }, + }, +} diff --git a/lua/plugins/example.lua b/lua/plugins/example.lua new file mode 100644 index 0000000..f84ebdc --- /dev/null +++ b/lua/plugins/example.lua @@ -0,0 +1,265 @@ +-- since this is just an example spec, don't actually load anything here and return an empty spec +-- stylua: ignore +if true then return {} end + +-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim +-- +-- In your plugin files, you can: +-- * add extra plugins +-- * disable/enabled LazyVim plugins +-- * override the configuration of LazyVim plugins +return { + -- add gruvbox + { "ellisonleao/gruvbox.nvim" }, + + -- Configure LazyVim to load gruvbox + { + "LazyVim/LazyVim", + opts = { + colorscheme = "gruvbox", + }, + }, + + -- change trouble config + { + "folke/trouble.nvim", + -- opts will be merged with the parent spec + opts = { use_diagnostic_signs = true }, + }, + + -- disable trouble + { "folke/trouble.nvim", enabled = false }, + + -- add symbols-outline + { + "simrat39/symbols-outline.nvim", + cmd = "SymbolsOutline", + keys = { { "cs", "SymbolsOutline", desc = "Symbols Outline" } }, + config = true, + }, + + -- override nvim-cmp and add cmp-emoji + { + "hrsh7th/nvim-cmp", + dependencies = { "hrsh7th/cmp-emoji" }, + ---@param opts cmp.ConfigSchema + opts = function(_, opts) + table.insert(opts.sources, { name = "emoji" }) + end, + }, + + -- change some telescope options and a keymap to browse plugin files + { + "nvim-telescope/telescope.nvim", + keys = { + -- add a keymap to browse plugin files + -- stylua: ignore + { + "fp", + function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end, + desc = "Find Plugin File", + }, + }, + -- change some options + opts = { + defaults = { + layout_strategy = "horizontal", + layout_config = { prompt_position = "top" }, + sorting_strategy = "ascending", + winblend = 0, + }, + }, + }, + + -- add telescope-fzf-native + { + "telescope.nvim", + dependencies = { + "nvim-telescope/telescope-fzf-native.nvim", + build = "make", + config = function() + require("telescope").load_extension("fzf") + end, + }, + }, + + -- add pyright to lspconfig + { + "neovim/nvim-lspconfig", + ---@class PluginLspOpts + opts = { + ---@type lspconfig.options + servers = { + -- pyright will be automatically installed with mason and loaded with lspconfig + pyright = {}, + }, + }, + }, + + -- add tsserver and setup with typescript.nvim instead of lspconfig + { + "neovim/nvim-lspconfig", + dependencies = { + "jose-elias-alvarez/typescript.nvim", + init = function() + require("lazyvim.util").on_attach(function(_, buffer) + -- stylua: ignore + vim.keymap.set( "n", "co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" }) + vim.keymap.set("n", "cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer }) + end) + end, + }, + ---@class PluginLspOpts + opts = { + ---@type lspconfig.options + servers = { + -- tsserver will be automatically installed with mason and loaded with lspconfig + tsserver = {}, + }, + -- you can do any additional lsp server setup here + -- return true if you don't want this server to be setup with lspconfig + ---@type table + setup = { + -- example to setup with typescript.nvim + tsserver = function(_, opts) + require("typescript").setup({ server = opts }) + return true + end, + -- Specify * to use this function as a fallback for any server + -- ["*"] = function(server, opts) end, + }, + }, + }, + + -- for typescript, LazyVim also includes extra specs to properly setup lspconfig, + -- treesitter, mason and typescript.nvim. So instead of the above, you can use: + { import = "lazyvim.plugins.extras.lang.typescript" }, + + -- add more treesitter parsers + { + "nvim-treesitter/nvim-treesitter", + opts = { + ensure_installed = { + "bash", + "html", + "javascript", + "json", + "lua", + "markdown", + "markdown_inline", + "python", + "query", + "regex", + "tsx", + "typescript", + "vim", + "yaml", + }, + }, + }, + + -- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above + -- would overwrite `ensure_installed` with the new value. + -- If you'd rather extend the default config, use the code below instead: + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + -- add tsx and treesitter + vim.list_extend(opts.ensure_installed, { + "tsx", + "typescript", + }) + end, + }, + + -- the opts function can also be used to change the default opts: + { + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + opts = function(_, opts) + table.insert(opts.sections.lualine_x, "😄") + end, + }, + + -- or you can return new options to override all the defaults + { + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + opts = function() + return { + --[[add your custom lualine config here]] + } + end, + }, + + -- use mini.starter instead of alpha + { import = "lazyvim.plugins.extras.ui.mini-starter" }, + + -- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc + { import = "lazyvim.plugins.extras.lang.json" }, + + -- add any tools you want to have installed below + { + "williamboman/mason.nvim", + opts = { + ensure_installed = { + "stylua", + "shellcheck", + "shfmt", + "flake8", + }, + }, + }, + + -- Use for completion and snippets (supertab) + -- first: disable default and behavior in LuaSnip + { + "L3MON4D3/LuaSnip", + keys = function() + return {} + end, + }, + -- then: setup supertab in cmp + { + "hrsh7th/nvim-cmp", + dependencies = { + "hrsh7th/cmp-emoji", + }, + ---@param opts cmp.ConfigSchema + opts = function(_, opts) + local has_words_before = function() + unpack = unpack or table.unpack + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil + end + + local luasnip = require("luasnip") + local cmp = require("cmp") + + opts.mapping = vim.tbl_extend("force", opts.mapping, { + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() + -- this way you will only jump inside the snippet region + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif has_words_before() then + cmp.complete() + 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" }), + }) + end, + }, +} diff --git a/lua/plugins/fidget-nvim.lua b/lua/plugins/fidget-nvim.lua deleted file mode 100644 index 89bddb7..0000000 --- a/lua/plugins/fidget-nvim.lua +++ /dev/null @@ -1 +0,0 @@ -require('fidget').setup() diff --git a/lua/plugins/fugitive.lua b/lua/plugins/fugitive.lua deleted file mode 100644 index 836fa84..0000000 --- a/lua/plugins/fugitive.lua +++ /dev/null @@ -1,11 +0,0 @@ -vim.keymap.set('n', 'gx', [[G]], { noremap = false, silent = true, desc = "Toggle [G]it status window" }) -vim.keymap.set('n', 'gs', [[Git]], { noremap = false, silent = true, desc = "Toggle [G]it [S]tatus window" }) -vim.keymap.set('n', 'gfd', [[Gdiffsplit]], { noremap = false, silent = true, desc = "[G]it [D]iff current file against index with [F]ugitive" }) -vim.keymap.set('n', 'gc', [[Git commit]], { noremap = false, silent = true, desc = "[G]it [C]ommit" }) -vim.keymap.set('n', 'gb', [[Git blame -C]], { noremap = false, silent = true, desc = "[G]it [B]lame" }) -vim.keymap.set('n', 'gp', [[Git push]], { noremap = false, silent = true, desc = "[G]it [P]ush" }) -vim.keymap.set('n', 'gf', [[Git push --force]], { noremap = false, silent = true, desc = "[G]it [F]orce push" }) -vim.keymap.set('n', 'gu', [[Git pull]], { noremap = false, silent = true, desc = "[G]it p[U]ll" }) -vim.keymap.set('n', 'gh', [[Git diff --cached]], { noremap = false, silent = true, desc = "[G]it diff current staged changes" }) -vim.keymap.set('n', 'go', [[GBrowse]], { noremap = false, silent = true, desc = "[B]rowse [G]it URL for fugitive object under cursor" }) -vim.keymap.set('v', 'go', [['<,'>GBrowse]], { noremap = false, silent = true, desc = "[B]rowse [G]it URL for selected lines" }) diff --git a/lua/plugins/git-conflict-nvim.lua b/lua/plugins/git-conflict-nvim.lua deleted file mode 100644 index 0c2c14c..0000000 --- a/lua/plugins/git-conflict-nvim.lua +++ /dev/null @@ -1 +0,0 @@ -require('git-conflict').setup() diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua deleted file mode 100644 index 2c8c08f..0000000 --- a/lua/plugins/gitsigns.lua +++ /dev/null @@ -1,41 +0,0 @@ -require('gitsigns').setup({ - update_debounce = 500, - 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 = "Jump to next git hunk [C]hange" }) - - map('n', '[c', function() - if vim.wo.diff then return '[c' end - vim.schedule(function() gs.prev_hunk() end) - return '' - end, { expr = true, desc = "Jump to previous git hunk [C]hange" }) - - -- Actions - map({ 'n', 'v' }, 'hs', ':Gitsigns stage_hunk', { desc = "[S]tage git [H]unk" }) - map({ 'n', 'v' }, 'hr', ':Gitsigns reset_hunk', { desc = "[R]eset git [H]unk" }) - map('n', 'hS', gs.stage_buffer, { desc = "[S]tage git buffer" }) - map('n', 'hu', gs.undo_stage_hunk, { desc = "[U]ndo git [H]unk" }) - map('n', 'hR', gs.reset_buffer, { desc = "[R]eset git buffer" }) - map('n', 'hp', gs.preview_hunk, { desc = "[P]review git [H]unk" }) - map('n', 'hb', function() gs.blame_line { full = true } end, { desc = "Git [B]lame line" }) - map('n', 'tb', gs.toggle_current_line_blame, { desc = "[T]oggle current line git [B]lame" }) - map('n', 'hd', gs.diffthis, { desc = "Git [D]iff current file with index" }) - map('n', 'hD', function() gs.diffthis('~') end, { desc = "Git [D]iff current file with last commit" }) - map('n', 'td', gs.toggle_deleted, { desc = "[T]oggle showing [D]eleted git hunks" }) - - -- Text object - map({ 'o', 'x' }, 'ih', ':Gitsigns select_hunk', { desc = "Select git [H]unk under cursor" }) - end -}) diff --git a/lua/plugins/goto-preview-nvim.lua b/lua/plugins/goto-preview-nvim.lua deleted file mode 100644 index 574cd34..0000000 --- a/lua/plugins/goto-preview-nvim.lua +++ /dev/null @@ -1,5 +0,0 @@ -require('goto-preview').setup({ - default_mappings = true, - -- resizing_mappings = true, - opacity = 90, -}) diff --git a/lua/plugins/gruvbox.lua b/lua/plugins/gruvbox.lua index 2c7600e..323d80c 100644 --- a/lua/plugins/gruvbox.lua +++ b/lua/plugins/gruvbox.lua @@ -1,38 +1,11 @@ -require("gruvbox").setup({ - undercurl = true, - underline = true, - bold = true, - italic = { - strings = true, - comments = true, - operators = false, - folds = true, +return { + "ellisonleao/gruvbox.nvim", + opts = { + contrast = "hard", + palette_overrides = { + dark0_hard = "#131516", + dark1 = "#242424", + }, + dim_inactive = true, }, - strikethrough = true, - invert_selection = false, - invert_signs = false, - invert_tabline = false, - invert_intend_guides = false, - inverse = true, -- invert background for search, diffs, statuslines and errors - contrast = "hard", -- can be "hard" or "soft" - dim_inactive = true, - transparent_mode = false, - palette_overrides = { - dark0_hard = '#131516', - dark1 = '#242424', - }, - overrides = { - Pmenu = { bg = '#222222'}, - GruvboxAquaSign = { bg = "NONE" }, - GruvboxBlueSign = { bg = "NONE" }, - GruvboxGreenSign = { bg = "NONE" }, - GruvboxOrangeSign = { bg = "NONE" }, - GruvboxPurpleSign = { bg = "NONE" }, - GruvboxRedSign = { bg = "NONE" }, - GruvboxYellowSign = { bg = "NONE" }, - SignColumn = { bg = "NONE" }, - Search = { fg = "#E1A416" }, - IncSearch = { fg = "#E56700" }, - } -}) -vim.o.background = "dark" +} diff --git a/lua/plugins/gui-font-resize-nvim.lua b/lua/plugins/gui-font-resize-nvim.lua deleted file mode 100644 index cee4c31..0000000 --- a/lua/plugins/gui-font-resize-nvim.lua +++ /dev/null @@ -1,8 +0,0 @@ -require('gui-font-resize').setup({ - default_size = 11.0, -- absolute size it will fallback to when :GUIFontSizeSet is not specified - change_by = 1, -- step value that will inc/dec the fontsize by -}) - -vim.keymap.set('n', '', [[GUIFontSizeUp]], { noremap = true, silent = true, desc = "Increase font size" }) -vim.keymap.set('n', '', [[GUIFontSizeDown]], { noremap = true, silent = true, desc = "Decrease font size" }) -vim.keymap.set('n', '', [[set guifont=Hack:h11 | GUIFontSizeSet]], { noremap = true, silent = true, desc = "Set font family and size to default" }) diff --git a/lua/plugins/inc-rename.lua b/lua/plugins/inc-rename.lua new file mode 100644 index 0000000..975259e --- /dev/null +++ b/lua/plugins/inc-rename.lua @@ -0,0 +1,8 @@ +return { + "smjonas/inc-rename.nvim", + cmd = "IncRename", + config = true, + keys = { + { "rn", ":IncRename ", desc = "Incremental Rename" }, + }, +} diff --git a/lua/plugins/indent-blankline-nvim.lua b/lua/plugins/indent-blankline-nvim.lua deleted file mode 100644 index 14c35fc..0000000 --- a/lua/plugins/indent-blankline-nvim.lua +++ /dev/null @@ -1,6 +0,0 @@ -require("ibl").setup({ - scope = { - show_start = false, - show_end = false, - } -}) diff --git a/lua/plugins/kanagawa-nvim.lua b/lua/plugins/kanagawa-nvim.lua deleted file mode 100644 index 0b8d543..0000000 --- a/lua/plugins/kanagawa-nvim.lua +++ /dev/null @@ -1 +0,0 @@ -require('kanagawa').setup() diff --git a/lua/plugins/lastplace-nvim.lua b/lua/plugins/lastplace-nvim.lua deleted file mode 100644 index 1680901..0000000 --- a/lua/plugins/lastplace-nvim.lua +++ /dev/null @@ -1,5 +0,0 @@ -require('nvim-lastplace').setup({ - lastplace_ignore_buftype = { 'quickfix', 'nofile', 'nowrite', 'help' }, - lastplace_ignore_filetype = { 'gitcommit', 'gitrebase', 'svn', 'hgcommit' }, - lastplace_open_folds = true, -}) diff --git a/lua/plugins/leap-nvim.lua b/lua/plugins/leap-nvim.lua deleted file mode 100644 index c0aeeef..0000000 --- a/lua/plugins/leap-nvim.lua +++ /dev/null @@ -1 +0,0 @@ -require('leap').add_default_mappings() diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua deleted file mode 100644 index 3444674..0000000 --- a/lua/plugins/lsp.lua +++ /dev/null @@ -1,111 +0,0 @@ -require('mason').setup({ - max_concurrent_installers = 10, -}) -require('mason-lspconfig').setup({ - automatic_installation = true, -}) - -local on_attach = require('plugins.lsp.on_attach') --- Mappings. --- See `:help vim.diagnostic.*` for documentation on any of the below functions -local opts = { noremap=true, silent=true } -vim.keymap.set('n', 'e', vim.diagnostic.open_float, opts) -vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts) -vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts) -vim.keymap.set('n', 'q', vim.diagnostic.setloclist, opts) - -local lsp_flags = { - -- This is the default in Nvim 0.7+ - debounce_text_changes = 150, -} -require('lspconfig')['pyright'].setup({ - on_attach = on_attach, - flags = lsp_flags, -}) --- Setup by typescript.nvim automatically --- require('lspconfig')['tsserver'].setup({ --- on_attach = on_attach, --- flags = lsp_flags, --- }) -require('lspconfig')['jsonls'].setup({ - on_attach = on_attach, - flags = lsp_flags, -}) -require('lspconfig')['eslint'].setup({ - on_attach = on_attach, - flags = lsp_flags, - -- root_dir = require('lspconfig').util.find_git_ancestor, -}) -require('lspconfig')['html'].setup({ - on_attach = on_attach, - flags = lsp_flags, -}) -require('lspconfig')['cssls'].setup({ - on_attach = on_attach, - flags = lsp_flags, -}) --- Setup by rust-tools automatically --- require('lspconfig')['rust_analyzer'].setup({ --- on_attach = on_attach, --- flags = lsp_flags, --- -- Server-specific settings... --- settings = { --- ['rust-analyzer'] = {} --- } --- }) -require('lspconfig')['lua_ls'].setup({ - on_attach = on_attach, - flags = lsp_flags, - settings = { - Lua = { - completion = { - callSnippet = "Replace" - }, - runtime = { - -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) - version = 'LuaJIT', - }, - diagnostics = { - -- Get the language server to recognize the `vim` global - globals = { 'vim' }, - }, - workspace = { - -- Make the server aware of Neovim runtime files - library = vim.api.nvim_get_runtime_file('', true), - }, - }, - }, -}) -require('lspconfig')['bashls'].setup({ - on_attach = on_attach, - flags = lsp_flags, -}) -require('lspconfig')['marksman'].setup({ - on_attach = on_attach, - flags = lsp_flags, -}) -require('lspconfig')['sqlls'].setup({ - on_attach = function(client, bufn) - on_attach(client, bufn) - require('sqlls').on_attach(client, bufn) - end, - flags = lsp_flags, -}) -require('lspconfig')['taplo'].setup({ - on_attach = on_attach, - flags = lsp_flags, -}) -require('lspconfig')['zls'].setup({ - on_attach = on_attach, - flags = lsp_flags, -}) -require('lspconfig')['terraformls'].setup({ - on_attach = on_attach, - flags = lsp_flags, -}) -vim.api.nvim_create_autocmd({"BufWritePre"}, { - pattern = {"*.tf", "*.tfvars"}, - callback = function() - vim.lsp.buf.format() - end, -}) diff --git a/lua/plugins/lsp/on_attach.lua b/lua/plugins/lsp/on_attach.lua deleted file mode 100644 index acd395f..0000000 --- a/lua/plugins/lsp/on_attach.lua +++ /dev/null @@ -1,77 +0,0 @@ --- From: https://github.com/Saecki/crates.nvim -local function show_documentation() - local filetype = vim.bo.filetype - if vim.tbl_contains({ 'vim','help' }, filetype) then - vim.cmd('h '..vim.fn.expand('')) - elseif vim.tbl_contains({ 'man' }, filetype) then - vim.cmd('Man '..vim.fn.expand('')) - elseif vim.fn.expand('%:t') == 'Cargo.toml' and require('crates').popup_available() then - require('crates').show_popup() - else - vim.lsp.buf.hover() - end -end - --- Use an on_attach function to only map the following keys --- after the language server attaches to the current buffer --- thallada: NOTE: copied also in lsp/init.lua since I can't figure out how to import it here -local on_attach = function(_, bufnr) - -- Enable completion triggered by - vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') - - -- Mappings. - -- See `:help vim.lsp.*` for documentation on any of the below functions - local bufopts = { noremap=true, silent=true, buffer=bufnr } - vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) - vim.keymap.set('n', 'K', show_documentation, bufopts) - vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) - vim.keymap.set('n', '', vim.lsp.buf.signature_help, bufopts) - vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, bufopts) - vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, bufopts) - vim.keymap.set('n', 'wl', function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, bufopts) - vim.keymap.set('n', 'rn', vim.lsp.buf.rename, bufopts) - vim.keymap.set('n', 'a', vim.lsp.buf.code_action, bufopts) - vim.keymap.set('v', 'a', vim.lsp.buf.code_action, bufopts) - vim.keymap.set('n', 'ga', vim.lsp.buf.code_action, bufopts) - vim.keymap.set('n', 'f', function() vim.lsp.buf.format { async = true } end, bufopts) - vim.keymap.set('n', 'F', function() vim.lsp.buf.format { async = true } end, bufopts) - -- vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) - -- vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) - -- vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, bufopts) - -- vim.keymap.set('n', 'gW', vim.lsp.buf.workspace_symbol, bufopts) - -- vim.keymap.set('n', 'g0', vim.lsp.buf.document_symbol, bufopts) - vim.keymap.set( - 'n', - 'gr', - [[lua require('telescope.builtin').lsp_references()]], - { noremap = true, silent = true } - ) - vim.keymap.set( - 'n', - 'gd', - [[lua require('telescope.builtin').lsp_definitions()]], - { noremap = true, silent = true } - ) - vim.keymap.set( - 'n', - 'D', - [[lua require('telescope.builtin').lsp_type_definitions()]], - { noremap = true, silent = true } - ) - vim.keymap.set( - 'n', - 'gW', - [[lua require('telescope.builtin').lsp_dynamic_workspace_symbols()]], - { noremap = true, silent = true } - ) - vim.keymap.set( - 'n', - 'g0', - [[lua require('telescope.builtin').lsp_document_symbols()]], - { noremap = true, silent = true } - ) -end - -return on_attach diff --git a/lua/plugins/lualine-nvim.lua b/lua/plugins/lualine-nvim.lua deleted file mode 100644 index 66e91cf..0000000 --- a/lua/plugins/lualine-nvim.lua +++ /dev/null @@ -1,24 +0,0 @@ -require('lualine').setup({ - sections = { - lualine_c = { - require('auto-session.lib').current_session_name, - { - 'filename', - file_status = true, -- displays file status (readonly status, modified status) - path = 1, -- 0 = just filename, 1 = relative path, 2 = absolute path - }, - }, - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = { { - 'filename', - file_status = true, -- displays file status (readonly status, modified status) - path = 1 -- 0 = just filename, 1 = relative path, 2 = absolute path - } }, - lualine_x = { 'location' }, - lualine_y = {}, - lualine_z = {} - }, -}) diff --git a/lua/plugins/luasnip.lua b/lua/plugins/luasnip.lua new file mode 100644 index 0000000..36f3a64 --- /dev/null +++ b/lua/plugins/luasnip.lua @@ -0,0 +1,7 @@ +-- Disable and behavior in luasnip for supertab: https://www.lazyvim.org/configuration/recipes#supertab +return { + "L3MON4D3/LuaSnip", + keys = function() + return {} + end, +} diff --git a/lua/plugins/mini-indentscope.lua b/lua/plugins/mini-indentscope.lua new file mode 100644 index 0000000..dfc8528 --- /dev/null +++ b/lua/plugins/mini-indentscope.lua @@ -0,0 +1,11 @@ +return { + "echasnovski/mini.indentscope", + opts = { + draw = { + -- Speed up distracting animation + animation = function() + return 1 + end, + }, + }, +} diff --git a/lua/plugins/neoai-nvim.lua b/lua/plugins/neoai-nvim.lua deleted file mode 100644 index 42167f7..0000000 --- a/lua/plugins/neoai-nvim.lua +++ /dev/null @@ -1,12 +0,0 @@ -require('neoai').setup() - -vim.keymap.set('n', 'ai', 'NeoAI', - { silent = true, noremap = true, desc = "Toggle Neo[AI]" } -) -vim.keymap.set('n', 'ac', 'NeoAIContext', - { silent = true, noremap = true, desc = "Toggle Neo[A]i with [C]ontext of current buffer" } -) --- Can't get this to work :/ --- vim.keymap.set('x', 'ai', [['<,'>NeoAIContext]], --- { silent = true, noremap = true, desc = "Toggle Neo[AI] with context of selected text" } --- ) diff --git a/lua/plugins/neodev-nvim.lua b/lua/plugins/neodev-nvim.lua deleted file mode 100644 index d14885b..0000000 --- a/lua/plugins/neodev-nvim.lua +++ /dev/null @@ -1 +0,0 @@ -require('neodev').setup({}) diff --git a/lua/plugins/neotest.lua b/lua/plugins/neotest.lua deleted file mode 100644 index cf46fd6..0000000 --- a/lua/plugins/neotest.lua +++ /dev/null @@ -1,17 +0,0 @@ -local neotest = require('neotest') -neotest.setup({ - adapters = { - require('neotest-rust'), - }, -}) - -vim.keymap.set("n", "t", function() neotest.run.run() end, { desc = "Run neo[T]ests under cursor"}) -vim.keymap.set("n", "tf", function() neotest.run.run(vim.fn.expand('%')) end, { desc = "Run neo[T]ests in current file" }) -vim.keymap.set("n", "tt", function() neotest.run.run({ strategy = 'dap' }) end, { desc = "Run neo[T]ests in DAP debugging mode" }) -vim.keymap.set("n", "ta", function() neotest.run.attach() end, { desc = "[A]ttach to neo[T]est process" }) -vim.keymap.set("n", "to", function() neotest.output.open({ enter = true }) end, { desc = "[O]pen neo[T]ests summary window" }) -vim.keymap.set("n", "ts", function() neotest.summary.toggle() end, { desc = "Toggle neo[T]est [S]ummary window"}) - -vim.diagnostic.config({ - neotest = true, -}, vim.api.nvim_create_namespace('neotest')) diff --git a/lua/plugins/null-ls-nvim.lua b/lua/plugins/null-ls-nvim.lua deleted file mode 100644 index 5d5c9c3..0000000 --- a/lua/plugins/null-ls-nvim.lua +++ /dev/null @@ -1,84 +0,0 @@ -local null_ls = require("null-ls") - --- From: https://github.com/jose-elias-alvarez/null-ls.nvim/wiki/Formatting-on-save -local async_formatting = function(bufnr) - bufnr = bufnr or vim.api.nvim_get_current_buf() - - vim.lsp.buf_request( - bufnr, - "textDocument/formatting", - vim.lsp.util.make_formatting_params({}), - function(err, res, ctx) - if err then - local err_msg = type(err) == "string" and err or err.message - -- you can modify the log message / level (or ignore it completely) - vim.notify("formatting: " .. err_msg, vim.log.levels.WARN) - return - end - - -- don't apply results if buffer is unloaded or has been modified - if not vim.api.nvim_buf_is_loaded(bufnr) or vim.api.nvim_buf_get_option(bufnr, "modified") then - return - end - - if res then - local client = vim.lsp.get_client_by_id(ctx.client_id) - vim.lsp.util.apply_text_edits(res, bufnr, client and client.offset_encoding or "utf-16") - vim.api.nvim_buf_call(bufnr, function() - vim.cmd("silent noautocmd update") - end) - end - end - ) -end - -local augroup = vim.api.nvim_create_augroup("LspFormatting", {}) - -null_ls.setup({ - -- thallada: broken - -- on_attach = function(client, bufnr) - -- if client.supports_method("textDocument/formatting") then - -- vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) - -- vim.api.nvim_create_autocmd("BufWritePost", { - -- group = augroup, - -- buffer = bufnr, - -- callback = function() - -- async_formatting(bufnr) - -- end, - -- }) - -- end - -- end, - sources = { - -- Linter - -- null_ls.builtins.diagnostics.eslint_d, - -- null_ls.builtins.diagnostics.prettierd, - null_ls.builtins.diagnostics.jsonlint, - null_ls.builtins.diagnostics.markdownlint, - null_ls.builtins.diagnostics.stylelint, - null_ls.builtins.diagnostics.tidy, - -- Somehow breaks tsx syntax highlighting in new buffers... wtf??? - -- Issue made here: https://github.com/jose-elias-alvarez/null-ls.nvim/issues/1527 - null_ls.builtins.diagnostics.todo_comments, - null_ls.builtins.diagnostics.tsc, - null_ls.builtins.diagnostics.fish, - null_ls.builtins.diagnostics.codespell, - -- Formatter - null_ls.builtins.formatting.eslint_d, - null_ls.builtins.formatting.markdownlint, - null_ls.builtins.formatting.prettierd, - null_ls.builtins.formatting.sqlfluff.with({ - extra_args = { "--dialect", "postgres" }, - }), - null_ls.builtins.formatting.stylua, - null_ls.builtins.formatting.rustfmt, - null_ls.builtins.formatting.tidy, - null_ls.builtins.formatting.taplo, - -- Refactoring - null_ls.builtins.code_actions.refactoring, - -- Shells - -- Git - null_ls.builtins.code_actions.gitsigns, - -- Plugins - require('typescript.extensions.null-ls.code-actions'), - }, -}) diff --git a/lua/plugins/numb-nvim.lua b/lua/plugins/numb-nvim.lua deleted file mode 100644 index 26d12d7..0000000 --- a/lua/plugins/numb-nvim.lua +++ /dev/null @@ -1,6 +0,0 @@ -require("numb").setup({ - show_numbers = true, -- Enable 'number' for the window while peeking - show_cursorline = true, -- Enable 'cursorline' for the window while peeking - number_only = false, -- Peek only when the command is only a number instead of when it starts with a number - centered_peeking = true, -- Peeked line will be centered relative to window -}) diff --git a/lua/plugins/numb.lua b/lua/plugins/numb.lua new file mode 100644 index 0000000..c831a5a --- /dev/null +++ b/lua/plugins/numb.lua @@ -0,0 +1,11 @@ +return { + "nacro90/numb.nvim", + config = function() + require("numb").setup({ + show_numbers = true, -- Enable 'number' for the window while peeking + show_cursorline = true, -- Enable 'cursorline' for the window while peeking + number_only = false, -- Peek only when the command is only a number instead of when it starts with a number + centered_peeking = true, -- Peeked line will be centered releative to window + }) + end, +} diff --git a/lua/plugins/nvim-autopairs.lua b/lua/plugins/nvim-autopairs.lua deleted file mode 100644 index 22c8a38..0000000 --- a/lua/plugins/nvim-autopairs.lua +++ /dev/null @@ -1,28 +0,0 @@ -local npairs = require("nvim-autopairs") -local Rule = require('nvim-autopairs.rule') -local cmp = require('cmp') -local cmp_autopairs = require('nvim-autopairs.completion.cmp') - -npairs.setup({ - check_ts = true, - ts_config = { - lua = {'string'},-- it will not add a pair on that treesitter node - javascript = {'template_string'}, - java = false,-- don't check treesitter on java - } -}) - -local ts_conds = require('nvim-autopairs.ts-conds') - --- press % => %% only while inside a comment or string -npairs.add_rules({ - Rule("%", "%", "lua") - :with_pair(ts_conds.is_ts_node({'string','comment'})), - Rule("$", "$", "lua") - :with_pair(ts_conds.is_not_ts_node({'function'})) -}) - -cmp.event:on( - 'confirm_done', - cmp_autopairs.on_confirm_done() -) diff --git a/lua/plugins/nvim-cmp.lua b/lua/plugins/nvim-cmp.lua index b0214b0..c57186e 100644 --- a/lua/plugins/nvim-cmp.lua +++ b/lua/plugins/nvim-cmp.lua @@ -1,144 +1,83 @@ -local cmp = require('cmp') -local lspkind = require('lspkind') - -local has_words_before = function() - if vim.api.nvim_buf_get_option(0, "buftype") == "prompt" then return false end - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and vim.api.nvim_buf_get_text(0, line-1, 0, line-1, col, {})[1]:match("^%s*$") == nil -end - -cmp.setup({ - experimental = { ghost_text = true }, - snippet = { - -- REQUIRED - you must specify a snippet engine - expand = function(args) - vim.fn['vsnip#anonymous'](args.body) -- For `vsnip` users. - -- require('luasnip').lsp_expand(args.body) -- For `luasnip` users. - -- require('snippy').expand_snippet(args.body) -- For `snippy` users. - -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. - 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.abort(), - [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - [""] = cmp.mapping(function(fallback) - if cmp.visible() and has_words_before() then - cmp.select_next_item({ behavior = cmp.SelectBehavior.Select }) - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - else - fallback() - end - end, { "i", "s" }), - }), - sources = cmp.config.sources({ - { name = "copilot", priority = 100, group_index = 1 }, - { - name = 'nvim_lsp_signature_help', - priority = 90, - group_index = 2, - }, - { - name = 'nvim_lsp', - priority = 90, - group_index = 2, - }, - { - name = 'buffer', - priority = 80, - group_index = 3, - }, - { - name = 'path', - priority = 80, - group_index = 3, - }, - { name = 'vsnip' }, -- For vsnip users. - -- { name = 'luasnip' }, -- For luasnip users. - -- { name = 'ultisnips' }, -- For ultisnips users. - -- { name = 'snippy' }, -- For snippy users. - }), - sorting = { - priority_weight = 2, - comparators = { - require("copilot_cmp.comparators").prioritize, - require("copilot_cmp.comparators").score, - -- Below is the default comparitor list and order for nvim-cmp - cmp.config.compare.offset, - -- cmp.config.compare.scopes, --this is commented in nvim-cmp too - cmp.config.compare.exact, - cmp.config.compare.score, - cmp.config.compare.recently_used, - cmp.config.compare.locality, - cmp.config.compare.kind, - cmp.config.compare.sort_text, - cmp.config.compare.length, - cmp.config.compare.order,function(...) return require('cmp_buffer'):compare_locality(...) end, - } - }, - formatting = { - format = lspkind.cmp_format({ - mode = 'symbol_text', - maxwidth = 50, - ellipsis_char = '…', - -- symbol_map = { Copilot = '🤖' }, - }) - } -}) - --- Set configuration for specific filetype. -cmp.setup.filetype('gitcommit', { - sources = cmp.config.sources({ - { name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it. - }, { - { name = 'buffer' }, - }) -}) - --- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). -cmp.setup.cmdline({ '/', '?' }, { - mapping = cmp.mapping.preset.cmdline(), - sources = { - { name = 'buffer' } - } -}) - --- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). -cmp.setup.cmdline(':', { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = 'path' } - }, { - { name = 'cmdline', keyword_pattern=[=[[^[:blank:]\!]*]=], keyword_length=3 } - }) -}) - --- Add additional capabilities supported by nvim-cmp -local capabilities = require('cmp_nvim_lsp').default_capabilities() - -local lspconfig = require("lspconfig") - --- Enable some language servers with the additional completion capabilities offered by nvim-cmp -local servers = { 'pyright', 'tsserver', 'html', 'cssls' } -for _, lsp in ipairs(servers) do - lspconfig[lsp].setup({ - -- on_attach = my_custom_on_attach, - capabilities = capabilities, - }) -end - +-- Configure nvim-cmp with "supertab"-like behavior for LuaSnip integration: https://www.lazyvim.org/configuration/recipes#supertab +-- Also, prevent autocomplete from automatically selecting the first item in the list on , and instead require the user to press to select the first item. return { - capabilities, + "hrsh7th/nvim-cmp", + dependencies = { + "hrsh7th/cmp-calc", + "hrsh7th/cmp-emoji", + "hrsh7th/cmp-cmdline", + "petertriho/cmp-git", + }, + ---@param opts cmp.ConfigSchema + opts = function(_, opts) + local has_words_before = function() + unpack = unpack or table.unpack + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil + end + + local luasnip = require("luasnip") + local cmp = require("cmp") + + opts.mapping = vim.tbl_extend("force", opts.mapping, { + [""] = cmp.mapping(function(fallback) + -- This bit is for preventing auto-completion auto-triggering from copilot-cmp: + -- https://github.com/zbirenbaum/copilot-cmp?tab=readme-ov-file#tab-completion-configuration-highly-recommended + if cmp.visible() and has_words_before() then + -- You could replace select_next_item() with confirm({ select = true }) to get VS Code autocompletion behavior + cmp.select_next_item({ behavior = cmp.SelectBehavior.Select }) + -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() + -- this way you will only jump inside the snippet region + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif has_words_before() then + cmp.complete() + 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" }), + [""] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + }) + + -- Do not auto-select the first auto-complete item, require a to select the first item. + opts.completion.completeopt = "menu,menuone,noinsert,noselect" + + opts.sources = cmp.config.sources(vim.list_extend(opts.sources, { + { name = "emoji" }, + { name = "git" }, + { name = "calc" }, + })) + + -- `/` cmdline setup. + cmp.setup.cmdline("/", { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = "buffer" }, + }, + }) + + -- `:` cmdline setup. + cmp.setup.cmdline(":", { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = "path" }, + }, { + { + name = "cmdline", + option = { + ignore_cmds = { "Man", "!" }, + }, + }, + }), + }) + end, } diff --git a/lua/plugins/nvim-colorizer.lua b/lua/plugins/nvim-colorizer.lua deleted file mode 100644 index 1bd1636..0000000 --- a/lua/plugins/nvim-colorizer.lua +++ /dev/null @@ -1 +0,0 @@ -require('colorizer').setup() diff --git a/lua/plugins/nvim-dap-ui.lua b/lua/plugins/nvim-dap-ui.lua deleted file mode 100644 index 22a4f93..0000000 --- a/lua/plugins/nvim-dap-ui.lua +++ /dev/null @@ -1 +0,0 @@ -require('dapui').setup() diff --git a/lua/plugins/nvim-dap-virtual-text.lua b/lua/plugins/nvim-dap-virtual-text.lua deleted file mode 100644 index c34eb72..0000000 --- a/lua/plugins/nvim-dap-virtual-text.lua +++ /dev/null @@ -1 +0,0 @@ -require('nvim-dap-virtual-text').setup() diff --git a/lua/plugins/nvim-dap.lua b/lua/plugins/nvim-dap.lua deleted file mode 100644 index 0e12f8e..0000000 --- a/lua/plugins/nvim-dap.lua +++ /dev/null @@ -1,27 +0,0 @@ --- thallada: this is setup in rust-tools -local dap = require('dap') --- dap.adapters.codelldb = { --- type = 'server', --- port = '${port}', --- executable = { --- command = '/home/thallada/vscode-lldb/extension/adapter/codelldb', --- args = { '--port', '${port}'} --- } --- } --- dap.configurations.rust = { --- { --- name = "Launch file", --- type = "codelldb", --- request = "launch", --- program = function() --- return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') --- end, --- cwd = '${workspaceFolder}', --- stopOnEntry = true, --- }, --- } - -vim.keymap.set('n', 'b', [[lua require('dap').toggle_breakpoint()]], { desc = "Toggle DAP [B]reakpoint"}) -vim.keymap.set('n', 'be', [[lua require('dap').set_exception_breakpoints()]], { desc = "Toggle DAP [B]reak on [E]xceptions" }) -vim.keymap.set('n', 'bc', [[lua require('dap').clear_breakpoints()]], { desc = "[C]lear DAP [B]reakpoints" }) -vim.keymap.set('n', 'bo', [[lua require('dapui').toggle()]], { desc = "Toggle nvim dapui" }) diff --git a/lua/plugins/nvim-lightbulb.lua b/lua/plugins/nvim-lightbulb.lua deleted file mode 100644 index a7a9204..0000000 --- a/lua/plugins/nvim-lightbulb.lua +++ /dev/null @@ -1 +0,0 @@ -require('nvim-lightbulb').setup({ autocmd = { enabled = true } }) diff --git a/lua/plugins/nvim-pqf.lua b/lua/plugins/nvim-pqf.lua deleted file mode 100644 index a551a8d..0000000 --- a/lua/plugins/nvim-pqf.lua +++ /dev/null @@ -1 +0,0 @@ -require('pqf').setup() diff --git a/lua/plugins/nvim-treesitter-context.lua b/lua/plugins/nvim-treesitter-context.lua deleted file mode 100644 index 3da8a35..0000000 --- a/lua/plugins/nvim-treesitter-context.lua +++ /dev/null @@ -1,5 +0,0 @@ -require('treesitter-context').setup{ - enable = true, - max_lines = 0, - min_window_height = 10, -} diff --git a/lua/plugins/nvim-treesitter.lua b/lua/plugins/nvim-treesitter.lua deleted file mode 100644 index f24a18d..0000000 --- a/lua/plugins/nvim-treesitter.lua +++ /dev/null @@ -1,105 +0,0 @@ -require('nvim-treesitter.configs').setup { - ensure_installed = 'all', - ignore_install = { 'phpdoc' }, - - sync_install = false, - auto_install = true, - - highlight = { - enable = true, - disable = { 'sql' }, -- since pgsql.vim is currently better at highlighting - }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = "", - node_incremental = "", - scope_incremental = "", - node_decremental = "", - }, - }, - indent = { - enable = true - }, - textobjects = { - select = { - enable = true, - lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim - keymaps = { - -- You can use the capture groups defined in textobjects.scm - ['aa'] = '@parameter.outer', - ['ia'] = '@parameter.inner', - ['af'] = '@function.outer', - ['if'] = '@function.inner', - ['ac'] = '@class.outer', - ['ic'] = '@class.inner', - } - } - }, - move = { - enable = true, - set_jumps = true, -- whether to set jumps in the jumplist - goto_next_start = { - [']m'] = '@function.outer', - [']]'] = '@class.outer', - }, - goto_next_end = { - [']M'] = '@function.outer', - [']['] = '@class.outer', - }, - goto_previous_start = { - ['[m'] = '@function.outer', - ['[['] = '@class.outer', - }, - goto_previous_end = { - ['[M'] = '@function.outer', - ['[]'] = '@class.outer', - }, - }, - swap = { - enable = true, - swap_next = { - ['a'] = '@parameter.inner', - }, - swap_previous = { - ['A'] = '@parameter.inner', - }, - }, - autotag = { - enable = true, - }, - refactor = { - highlight_definitions = { - enable = true, - clear_on_cursor_move = true, - }, - smart_rename = { - enable = true, - keymaps = { - smart_rename = 'grr', - }, - }, - }, - context_commentstring = { - enable = true, - enable_autocmd = false, - }, - pairs = { - enable = true, - disable = {}, - highlight_pair_events = {}, -- e.g. {"CursorMoved"}, -- when to highlight the pairs, use {} to deactivate highlighting - highlight_self = false, -- whether to highlight also the part of the pair under cursor (or only the partner) - goto_right_end = false, -- whether to go to the end of the right partner or the beginning - fallback_cmd_normal = "call matchit#Match_wrapper('',1,'n')", -- What command to issue when we can't find a pair (e.g. "normal! %") - keymaps = { - goto_partner = "%", - delete_balanced = "X", - }, - delete_balanced = { - only_on_first_char = false, -- whether to trigger balanced delete when on first character of a pair - fallback_cmd_normal = nil, -- fallback command when no pair found, can be nil - longest_partner = false, -- whether to delete the longest or the shortest pair when multiple found. - -- E.g. whether to delete the angle bracket or whole tag in - } - }, -} diff --git a/lua/plugins/octo-nvim.lua b/lua/plugins/octo-nvim.lua deleted file mode 100644 index 3acfead..0000000 --- a/lua/plugins/octo-nvim.lua +++ /dev/null @@ -1,4 +0,0 @@ -require('octo').setup() - --- Doesn't work, need to set this in settings too -vim.api.nvim_set_hl(0, 'OctoEditable', { bg = '#313131' }) diff --git a/lua/plugins/oil-nvim.lua b/lua/plugins/oil-nvim.lua deleted file mode 100644 index 05a42e3..0000000 --- a/lua/plugins/oil-nvim.lua +++ /dev/null @@ -1,3 +0,0 @@ -require("oil").setup() - -vim.keymap.set("n", "-", require("oil").open, { desc = "Open parent directory" }) diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua new file mode 100644 index 0000000..8774e6a --- /dev/null +++ b/lua/plugins/oil.lua @@ -0,0 +1,8 @@ +return { + "stevearc/oil.nvim", + opts = {}, + dependencies = { "nvim-tree/nvim-web-devicons" }, + keys = { + { "-", "Oil", { desc = "Open parent directory in current buffer" } }, + }, +} diff --git a/lua/plugins/pgsql-vim.lua b/lua/plugins/pgsql-vim.lua deleted file mode 100644 index 6a4407d..0000000 --- a/lua/plugins/pgsql-vim.lua +++ /dev/null @@ -1 +0,0 @@ -vim.g.sql_type_default = 'pgsql'; diff --git a/lua/plugins/rest-nvim.lua b/lua/plugins/rest-nvim.lua deleted file mode 100644 index e1714fd..0000000 --- a/lua/plugins/rest-nvim.lua +++ /dev/null @@ -1,7 +0,0 @@ -require('rest-nvim').setup({ - skip_ssl_verification = true, -}) - -vim.keymap.set('n', 'rd', [[RestNvim]], { noremap = false, silent = true, desc = "Run rest.nvim under cursor" }) -vim.keymap.set('n', 'ry', [[RestNvimPreview]], { noremap = false, silent = true, desc = "Show cURL command for rest.nvim under cursor"}) -vim.keymap.set('n', 'ri', [[RestNvimLast]], { noremap = false, silent = true }) diff --git a/lua/plugins/rust-tools-nvim.lua b/lua/plugins/rust-tools-nvim.lua deleted file mode 100644 index 0963ac9..0000000 --- a/lua/plugins/rust-tools-nvim.lua +++ /dev/null @@ -1,51 +0,0 @@ -local rt = require('rust-tools') -local lsp_on_attach = require('plugins.lsp.on_attach') -local nvim_cmp_capabilities = require('plugins.nvim-cmp').capabilities - -local extension_path = vim.env.HOME .. '/vscode-lldb/extension/' -local codelldb_path = extension_path .. 'adapter/codelldb' -local liblldb_path = extension_path .. 'lldb/lib/liblldb.so' - -rt.setup({ - tools = { - runnables = { - use_telescope = true - }, - }, - server = { - capabilities = nvim_cmp_capabilities, - on_attach = function(client, bufnr) - lsp_on_attach(client, bufnr) - vim.keymap.set('n', '', rt.hover_actions.hover_actions, { buffer = bufnr, desc = "Show hover actions under cursor" }) - -- Code action groups - vim.keymap.set('n', 'a', rt.code_action_group.code_action_group, { buffer = bufnr, desc = "Show code actions under cursor" }) - vim.keymap.set('n', 'rc', rt.open_cargo_toml.open_cargo_toml, { buffer = bufnr, desc = "Open Cargo.toml for current project" }) - vim.keymap.set('n', 'rp', rt.parent_module.parent_module, { buffer = bufnr, desc = "Go to parent Rust module" }) - vim.keymap.set('n', 'rm', rt.expand_macro.expand_macro, { buffer = bufnr, desc = "Expand Rust macro" }) - end, - settings = { - -- to enable rust-analyzer settings visit: - -- https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/generated_config.adoc - ['rust-analyzer'] = { - -- enable clippy on save - checkOnSave = { - command = 'clippy' - }, - } - }, - }, - dap = { - adapter = require('rust-tools.dap').get_codelldb_adapter( - codelldb_path, - liblldb_path - ) - } -}) - -vim.api.nvim_create_autocmd('BufRead', { - group = vim.api.nvim_create_augroup('CmpSourceCargo', { clear = true }), - pattern = 'Cargo.toml', - callback = function() - require('cmp').setup.buffer({ sources = { { name = 'crates' } } }) - end, -}) diff --git a/lua/plugins/session-lens.lua b/lua/plugins/session-lens.lua deleted file mode 100644 index 104a4e7..0000000 --- a/lua/plugins/session-lens.lua +++ /dev/null @@ -1 +0,0 @@ -require('session-lens').setup() diff --git a/lua/plugins/ssr.lua b/lua/plugins/ssr.lua new file mode 100644 index 0000000..eb18ffc --- /dev/null +++ b/lua/plugins/ssr.lua @@ -0,0 +1,13 @@ +return { + "cshuaimin/ssr.nvim", + keys = { + { + "sR", + function() + require("ssr").open() + end, + mode = { "n", "x" }, + desc = "Structural Replace", + }, + }, +} diff --git a/lua/plugins/surround-nvim.lua b/lua/plugins/surround-nvim.lua deleted file mode 100644 index f2499fd..0000000 --- a/lua/plugins/surround-nvim.lua +++ /dev/null @@ -1 +0,0 @@ -require("nvim-surround").setup({}) diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 345a2b7..1e93344 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -1,175 +1,30 @@ -local trouble = require('trouble.providers.telescope') -local telescope = require('telescope') - -telescope.setup { - defaults = { - mappings = { - i = { - [''] = trouble.open_with_trouble, - [''] = 'which_key', - }, - n = { - [''] = trouble.open_with_trouble, - [''] = 'which_key', - }, +return { + "telescope.nvim", + dependencies = { + { + "debugloop/telescope-undo.nvim", + keys = { { "U", "Telescope undo" } }, + config = function() + require("telescope").load_extension("undo") + end, + }, + { + "xiyaowong/telescope-emoji.nvim", + keys = { { "fj", "Telescope emoji" } }, + config = function() + require("telescope").load_extension("undo") + end, + }, + }, + keys = { + { + "fp", + function() + require("telescope.builtin").find_files({ + cwd = require("lazy.core.config").options.root, + }) + end, + desc = "Find Plugin File", }, }, - extensions = { - project = { - theme = 'dropdown', - } - } } - -require('telescope').load_extension('fzf') -require('telescope').load_extension('gh') -require('telescope').load_extension('env') -require('telescope').load_extension('emoji') -require('telescope').load_extension('ui-select') -require('telescope').load_extension('project') -require('telescope').load_extension('session-lens') - -vim.keymap.set( - 'n', - 'fgf', - [[lua require('telescope.builtin').git_files({ show_untracked = true })]], - { noremap = true, silent = true, desc = "[F]ind [G]it [F]iles" } -) -vim.keymap.set( - 'n', - 'f.', - [[lua require('telescope.builtin').git_files({ no_ignore = true })]], - { noremap = true, silent = true, desc = "[F]ind ALL git files including ignored [.]" } -) -vim.keymap.set( - 'n', - '_', - [[lua require('telescope.builtin').live_grep()]], - { noremap = true, silent = true, desc = "Search by live grep" } -) -vim.keymap.set( - 'n', - '_', - [[lua require('telescope.builtin').live_grep({ search_dirs = { vim.fn.expand('%:p:h') } })]], - { noremap = true, silent = true, desc = "Search by live grep in current (present) working directory" } -) -vim.keymap.set( - 'n', - '8', - [[lua require('telescope.builtin').grep_string()]], - { noremap = true, silent = true, desc = "Search by grep" } -) -vim.keymap.set( - 'n', - '3', - [[lua require('telescope.builtin').grep_string()]], - { noremap = true, silent = true, desc = "Search by grep" } -) -vim.keymap.set( - "n", - "fd", - [[lua require('telescope.builtin').find_files({cwd=require('telescope.utils').buffer_dir()})]], - { noremap = true, silent = true, desc = "[F]ind [D]irectories" } -) -vim.keymap.set( - 'n', - 'fb', - [[lua require('telescope.builtin').buffers()]], - { noremap = true, silent = true, desc = "[F]ind [B]uffers" } -) -vim.keymap.set( - 'n', - 'fh', - [[lua require('telescope.builtin').help_tags()]], - { noremap = true, silent = true, desc = "[F]ind [T]ags" } -) -vim.keymap.set( - 'n', - 'ft', - [[lua require('telescope.builtin').treesitter()]], - { noremap = true, silent = true, desc = "[F]ind [T]reesitter objects" } -) -vim.keymap.set( - 'n', - 'fr', - [[lua require('telescope.builtin').resume()]], - { noremap = true, silent = true, desc = "[R]esume last [F]ind" } -) -vim.keymap.set( - 'n', - 'fs', - [[lua require('telescope.builtin').spell_suggest()]], - { noremap = true, silent = true, desc = "[F]ind [S]pelling suggestion" } -) -vim.keymap.set( - 'n', - 'fgc', - [[lua require('telescope.builtin').git_commits()]], - { noremap = true, silent = true, desc = "[F]ind [G]it [C]ommits" } -) -vim.keymap.set( - "n", - 'fga', - [[lua require('telescope.builtin').git_bcommits()]], - { noremap = true, silent = true, desc = "[F]ind [G]it commits for current buffer" } -) -vim.keymap.set( - 'n', - 'fgb', - [[lua require('telescope.builtin').git_branches()]], - { noremap = true, silent = true, desc = "[F]ind [G]it [B]ranches" } -) -vim.keymap.set( - 'n', - 'fe', - [[Telescope emoji]], - { noremap = true, silent = true, desc = "[F]ind [E]moji" } -) -vim.keymap.set( - 'n', - 'f"', - [[lua require('telescope.builtin').registers()]], - { noremap = true, silent = true, desc = "[F]ind registers [\"]" } -) -vim.keymap.set( - 'n', - 'fm', - [[lua require('telescope.builtin').keymaps()]], - { noremap = true, silent = true, desc = "[F]ind key [M]appings" } -) -vim.keymap.set( - 'n', - '', - [[lua require('telescope.builtin').find_files()]], - { noremap = true, silent = true, desc = "find files shortcut" } -) -vim.keymap.set( - 'n', - 'ff', - [[lua require('telescope.builtin').find_files()]], - { noremap = true, silent = true, desc = "[F]ind [F]iles" } -) -vim.keymap.set( - 'n', - 'fi', - [[lua require('telescope.builtin').builtin()]], - { noremap = true, silent = true, desc = "[F]ind telescope f[i]nders" } -) -vim.keymap.set( - 'n', - 'fl', - [[lua require('telescope.builtin').reloader()]], - { noremap = true, silent = true, desc = "[F]ind [L]ua module to reload" } -) -vim.keymap.set( - 'n', - '', - [[lua require('telescope').extensions.project.project({ display_type = 'full' })]], - { noremap = true, silent = true, desc = "Find projects" } -) -vim.keymap.set( - 'n', - '`', - [[lua require('session-lens').search_session()]], - { noremap = true, silent = true, desc = "Find sessions" } -) diff --git a/lua/plugins/toggleterm-nvim.lua b/lua/plugins/toggleterm-nvim.lua deleted file mode 100644 index bc2f704..0000000 --- a/lua/plugins/toggleterm-nvim.lua +++ /dev/null @@ -1,60 +0,0 @@ -require("toggleterm").setup({ - direction = "horizontal", - open_mapping = [[]], - hide_numbers = true, - -- shell = 'fish', -}) - -vim.keymap.set('n', [[]], [[ToggleTerm direction=float]], { desc = "Toggle terminal in floating window" }) -vim.keymap.set('n', [[]], [[ToggleTerm direction=horizontal]], { desc = "Toggle terminal in horizontal bottom window" }) --- tmux muscle-memory for fullscreening nvim window --- replaced with true-zen.nvim --- vim.keymap.set('n', [[z]], [[ToggleTermToggleAll]]) --- vim.keymap.set('t', [[z]], [[tab split]]) -vim.keymap.set('t', '', [[]], { desc = "Escape terminal mode" }) -vim.keymap.set('t', '', [[wincmd h]], { desc = "Move focus down one window" }) -vim.keymap.set('t', '', [[wincmd k]], { desc = "Move focus up one window" }) -vim.keymap.set('t', '', [[wincmd h]], { desc = "Move focus left one window" }) -vim.keymap.set('t', '', [[wincmd l]], { desc = "Move focus right one window" }) - --- vim.keymap.set('n', '', [[ToggleTerm]], { noremap = true, silent = true }) --- vim.keymap.set('t', '', [[ToggleTerm]], { noremap = true, silent = true }) - --- Custom gitui terminal -local Terminal = require('toggleterm.terminal').Terminal -local gitui = Terminal:new({ - cmd = 'gitui', - direction = 'float', - float_opts = { - border = "curved", - width = function() return math.ceil(vim.o.columns * 0.8) end, - height = function() return math.ceil(vim.o.lines * 0.8) end, - winblend = 3, - }, - hidden = true, -}) - -function _gitui_toggle() - gitui:toggle() -end - -vim.keymap.set('n', 'G', 'lua _gitui_toggle()', { noremap = true, silent = true, desc = "Toggle gitui floating terminal" }) - --- Custom clx commandline hacker news terminal -local clx = Terminal:new({ - cmd = 'clx', - direction = 'float', - float_opts = { - border = "curved", - width = function() return math.ceil(vim.o.columns * 0.8) end, - height = function() return math.ceil(vim.o.lines * 0.8) end, - winblend = 3, - }, - hidden = true, -}) - -function _clx_toggle() - clx:toggle() -end - -vim.keymap.set('n', 'H', 'lua _clx_toggle()', { noremap = true, silent = true, desc = "Toggle clx (console HackerNews) floating terminal" }) diff --git a/lua/plugins/toggleterm.lua b/lua/plugins/toggleterm.lua new file mode 100644 index 0000000..364e817 --- /dev/null +++ b/lua/plugins/toggleterm.lua @@ -0,0 +1,42 @@ +return { + "akinsho/toggleterm.nvim", + version = "*", + opts = { + direction = "horizontal", + open_mapping = [[]], + hide_numbers = true, + }, + cmd = { + "ToggleTerm", + "TermExec", + "ToggleTermSendCurrentLine", + "ToggleTermSendVisualLines", + "ToggleTermSendVisualSelection", + "ToggleTermOpenAll", + "ToggleTermCloseAll", + "ToggleTermToggleAll", + }, + keys = { + [[]], + { "", [[ToggleTerm direction=float]], { desc = "Toggle terminal in floating window" } }, + { + "", + [[ToggleTerm direction=horizontal]], + { desc = "Toggle terminal in horizontal bottom window" }, + }, + -- tmux muscle-memory for fullscreening nvim window + -- replaced with true-zen.nvim + -- vim.keymap.set('n', [[z]], [[ToggleTermToggleAll]]) + -- vim.keymap.set('t', [[z]], [[tab split]]) + { "t", "", [[]], { desc = "Escape terminal mode" } }, + { "t", "", [[wincmd h]], { desc = "Move focus down one window" } }, + { "t", "", [[wincmd k]], { desc = "Move focus up one window" } }, + { "t", "", [[wincmd h]], { desc = "Move focus left one window" } }, + { "t", "", [[wincmd l]], { desc = "Move focus right one window" } }, + { "n", [[]], [[ToggleTerm]] }, + { "n", "", [[ToggleTerm]] }, + { "t", "", [[ToggleTerm]] }, + -- { "H", "lua _clx_toggle()", { desc = "Toggle clx (console HackerNews) floating terminal" } }, + -- { "G", "lua _gitui_toggle()", { desc = "Toggle gitui floating terminal" } }, + }, +} diff --git a/lua/plugins/treesj.lua b/lua/plugins/treesj.lua index 4c15b62..918aa00 100644 --- a/lua/plugins/treesj.lua +++ b/lua/plugins/treesj.lua @@ -1 +1,7 @@ -require('treesj').setup() +return { + "Wansmer/treesj", + keys = { + { "J", "TSJToggle", desc = "Join Toggle" }, + }, + opts = { use_default_keymaps = false, max_join_length = 150 }, +} diff --git a/lua/plugins/trouble-nvim.lua b/lua/plugins/trouble-nvim.lua deleted file mode 100644 index 6dbbe5e..0000000 --- a/lua/plugins/trouble-nvim.lua +++ /dev/null @@ -1,18 +0,0 @@ -vim.keymap.set('n', 'xx', 'TroubleToggle', - { silent = true, noremap = true, desc = "Toggle trouble buffer diagnostics" } -) -vim.keymap.set('n', 'xw', 'TroubleToggle workspace_diagnostics', - { silent = true, noremap = true, desc = "Toggle trouble workspace diagnostics" } -) -vim.keymap.set('n', 'xd', 'TroubleToggle document_diagnostics', - { silent = true, noremap = true, desc = "Toggle trouble document diagnostics" } -) -vim.keymap.set('n', 'xl', 'TroubleToggle loclist', - { silent = true, noremap = true, desc = "Toggle trouble diagnostics in loclist" } -) -vim.keymap.set('n', 'xq', 'TroubleToggle quickfix', - { silent = true, noremap = true, desc = "Toggle trouble diagnostics in quickfix" } -) -vim.keymap.set('n', 'gR', 'TroubleToggle lsp_references', - { silent = true, noremap = true, desc = "Toggle trouble LSP [R]eferences under cursor" } -) diff --git a/lua/plugins/true-zen-nvim.lua b/lua/plugins/true-zen-nvim.lua deleted file mode 100644 index 39814c3..0000000 --- a/lua/plugins/true-zen-nvim.lua +++ /dev/null @@ -1,10 +0,0 @@ -require('true-zen').setup() - -vim.keymap.set('n', 'zn', [[:TZNarrow]], { noremap = true, silent = true, desc = "[Z]oom [N]arrow current line" }) -vim.keymap.set('v', 'zn', [[:'<,'>TZNarrow]], { noremap = true, silent = true, desc = "[Z]oom [N]arrow selected lines" }) -vim.keymap.set('n', 'zf', [[:TZFocus]], { noremap = true, silent = true, desc = "[Z]oom [N]arrow current buffer in new tab" }) -vim.keymap.set('n', 'zm', [[:TZMinimalist]], { noremap = true, silent = true, desc = "[Z] Toggle minimalist nvim UI mode" }) -vim.keymap.set('n', 'za', [[:TZAtaraxis]], { noremap = true, silent = true, desc = "[Z]oom [A]taraxis current buffer minimalist mode" }) --- tmux muscle-memory for fullscreening nvim window -vim.keymap.set('n', [[z]], [[:TZFocus]], { desc = "Toggle [Z]oom current buffer in new tab" }) -vim.keymap.set('t', [[z]], [[:TZFocus]], { desc = "Toggle [Z]oom current terminal buffer in new tab" }) diff --git a/lua/plugins/true-zen.lua b/lua/plugins/true-zen.lua new file mode 100644 index 0000000..f048eb8 --- /dev/null +++ b/lua/plugins/true-zen.lua @@ -0,0 +1,14 @@ +return { + "Pocco81/true-zen.nvim", + cmd = { "TZNarrow", "TZFocus", "TZMinimalist", "TZAtaraxis" }, + keys = { + { "n", "zn", [[:TZNarrow]], { desc = "[Z]oom [N]arrow current line" } }, + { "v", "zn", [[:'<,'>TZNarrow]], { desc = "[Z]oom [N]arrow selected lines" } }, + { "n", "zf", [[:TZFocus]], { desc = "[Z]oom [N]arrow current buffer in new tab" } }, + { "n", "zm", [[:TZMinimalist]], { desc = "[Z] Toggle minimalist nvim UI mode" } }, + { "n", "za", [[:TZAtaraxis]], { desc = "[Z]oom [A]taraxis current buffer minimalist mode" } }, + -- tmux memory for fullscreening nvim window + { "n", [[z]], [[:TZFocus]], { desc = "Toggle [Z]oom current buffer in new tab" } }, + { "t", [[z]], [[:TZFocus]], { desc = "Toggle [Z]oom current terminal buffer in new tab" } }, + }, +} diff --git a/lua/plugins/typescript-nvim.lua b/lua/plugins/typescript-nvim.lua deleted file mode 100644 index ef60f5e..0000000 --- a/lua/plugins/typescript-nvim.lua +++ /dev/null @@ -1,7 +0,0 @@ -local on_attach = require('plugins.lsp.on_attach') - -require('typescript').setup({ - server = { -- pass options to lspconfig's setup method - on_attach = on_attach, - }, -}) diff --git a/lua/plugins/vim-mundo.lua b/lua/plugins/vim-mundo.lua deleted file mode 100644 index 5d35dc6..0000000 --- a/lua/plugins/vim-mundo.lua +++ /dev/null @@ -1 +0,0 @@ -vim.keymap.set('n', 'u', [[MundoToggle]], { noremap = true, silent = true, desc = "Toggle [U]ndo UI"}) diff --git a/lua/plugins/wezterm-types.lua b/lua/plugins/wezterm-types.lua new file mode 100644 index 0000000..4062caa --- /dev/null +++ b/lua/plugins/wezterm-types.lua @@ -0,0 +1 @@ +return { "justinsgithub/wezterm-types" } diff --git a/lua/plugins/which-key-nvim.lua b/lua/plugins/which-key-nvim.lua deleted file mode 100644 index b5df4ba..0000000 --- a/lua/plugins/which-key-nvim.lua +++ /dev/null @@ -1 +0,0 @@ -require('which-key').setup() diff --git a/lua/plugins/winshift-nvim.lua b/lua/plugins/winshift-nvim.lua deleted file mode 100644 index 16cae99..0000000 --- a/lua/plugins/winshift-nvim.lua +++ /dev/null @@ -1,11 +0,0 @@ -require('winshift').setup() - -vim.keymap.set('n', '', [[WinShift]], { noremap = true, silent = true }) -vim.keymap.set('n', 'm', [[WinShift]], { noremap = true, silent = true }) - -vim.keymap.set('n', 'X', [[WinShift swap]], { noremap = true, silent = true }) - -vim.keymap.set('n', '', [[WinShift left]], { noremap = true, silent = true }) -vim.keymap.set('n', '', [[WinShift down]], { noremap = true, silent = true }) -vim.keymap.set('n', '', [[WinShift up]], { noremap = true, silent = true }) -vim.keymap.set('n', '', [[WinShift right]], { noremap = true, silent = true }) diff --git a/lua/user/keymaps.lua b/lua/user/keymaps.lua deleted file mode 100644 index 5df81b5..0000000 --- a/lua/user/keymaps.lua +++ /dev/null @@ -1,42 +0,0 @@ --- Pasting with Control-V because of muscle-memory -vim.keymap.set('n', '', '"+p') -vim.keymap.set('n', '', '"+p') -vim.keymap.set('i', '', '*') -vim.keymap.set('i', '', '*') -vim.keymap.set('t', '', '"+pi') -vim.keymap.set('t', '', '"+pi') - --- Faster window navigation -vim.keymap.set('n', '', 'j') -vim.keymap.set('n', '', 'k') -vim.keymap.set('n', '', 'h') -vim.keymap.set('n', '', 'l') - -vim.keymap.set('n', ',', ':noh', { silent = true, desc = "Clear highlighting" }) - -vim.keymap.set('n', 'v', [[:e ~/.config/nvim/init.lua]], { silent = true, desc = "Open [V]im config" }) - --- URL handling (since I disabled netrw) --- source: https://sbulav.github.io/vim/neovim-opening-urls/ -if vim.fn.has('mac') == 1 then - vim.keymap.set('n', '', '"+p') - vim.keymap.set('n', '', '"+p') - vim.keymap.set('i', '', '*') - vim.keymap.set('i', '', '*') - vim.keymap.set('t', '', '"+pi') - vim.keymap.set('t', '', '"+pi') - vim.keymap.set('', 'gx', [[call jobstart(['open', expand('')], { 'detach': v:true })]], { noremap = true, silent = true }) -elseif vim.fn.has("unix") == 1 then - vim.keymap.set('', 'gx', [[call jobstart(['xdg-open', expand('')], { 'detach': v:true })]], { noremap = true, silent = true }) -else - vim.keymap.set[''].gx = {[[lua print("Error: gx is not supported on this OS!")]]} -end - --- this is needed here since it doesn't work in plugins/sqls.lua for some reason --- sqls is dead now apparently :( --- vim.keymap.set('n', 's', [[SqlsExecuteQuery]], { noremap = false, silent = true, desc = "[S]qls execute query under cursor" }) --- vim.keymap.set('n', 'S', [[SqlsExecuteQueryVertical]], { noremap = false, silent = true, desc = "[S]qls execute query under cursor in vertical split" }) --- vim.keymap.set('x', 's', [[(sqls-execute-query)]], { noremap = false, silent = true, desc = "[S]qls execute selected query" }) --- vim.keymap.set('x', 'S', [[(sqls-execute-query-vertical)]], { noremap = false, silent = true, desc = "[S]qls execute selected query in vertical split" }) - -vim.keymap.set("n", "bo", "%bd|e#", { desc = "Close all buffers but the current one" }) -- https://stackoverflow.com/a/42071865/516188 diff --git a/lua/user/settings.lua b/lua/user/settings.lua deleted file mode 100644 index f570c68..0000000 --- a/lua/user/settings.lua +++ /dev/null @@ -1,100 +0,0 @@ --- Nubmer column -vim.opt.relativenumber = true -vim.opt.number = true -vim.opt.signcolumn = 'yes' -- remove jitter - --- Wrapping / indenting -vim.opt.wrap = true -vim.opt.breakindent = true -vim.opt.tabstop = 2 -vim.opt.softtabstop=2 -vim.opt.shiftwidth = 2 -vim.opt.expandtab = true -vim.opt.autoindent = true -vim.opt.smarttab = true -vim.opt.textwidth = 120 -vim.opt.colorcolumn = '+1' - --- Search -vim.opt.ignorecase = true -vim.opt.smartcase = true -vim.opt.incsearch = true -vim.opt.hlsearch = true - --- Scrolling -vim.opt.scrolloff = 3 -vim.opt.sidescrolloff = 15 -vim.opt.sidescroll = 1 - --- Mouse -vim.opt.mouse = 'a' - --- Window decorations -vim.opt.title = true -vim.opt.titlestring="%{substitute(getcwd(),$HOME,'~','')} - Neovide" - --- Leader -vim.g.mapleader = ' ' - --- Fonts -vim.opt.guifont = 'Hack:h9.3' - --- Swap / backup / undo -vim.opt.undofile = true - --- Shell (may speed up nvim) -vim.opt.shell = '/bin/bash' - --- Rendering -vim.opt.lazyredraw = true - --- Folding -vim.opt.foldmethod = 'expr' -vim.opt.foldexpr = vim.call('nvim_treesitter#foldexpr') - --- Completion settings --- " Set completeopt to have a better completion experience --- " :help completeopt --- " menuone: popup even 'hen there's only one match --- " noinsert: Do not insert text until a selection is made --- " noselect: Do not select, force user to select one from the menu -vim.opt.completeopt = 'menuone,noinsert,noselect' - --- Avoid showing extra messages when using completion -vim.o.shortmess = vim.o.shortmess .. 'c' - --- Python -vim.g.python3_host_prog = vim.fn.has('macunix') and '/opt/homebrew/bin/python3' or '/usr/bin/python3' - ---Shell -vim.opt.shell = 'fish' - --- Format options -vim.cmd([[set formatoptions+=wantrqlc]]) - --- Neovide settings -vim.g.neovide_scroll_animation_length = 0.3 -- default: 0.3 -vim.g.neovide_cursor_animation_length = 0.06 -vim.g.neovide_cursor_trail_size = 0.2 -- default: 0.8 - -vim.api.nvim_set_hl(0, 'OctoEditable', { bg = '#313131' }) - --- [[ Highlight on yank ]] --- See `:help vim.highlight.on_yank()` -local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) -vim.api.nvim_create_autocmd('TextYankPost', { - callback = function() - vim.highlight.on_yank() - end, - group = highlight_group, - pattern = '*', -}) - -vim.api.nvim_create_autocmd({'BufNewFile', 'BufRead'}, { - command = 'set filetype=ruby', - pattern = {'Podfile', 'Fastfile', 'Matchfile', 'Pluginfile', 'Appfile', 'Deliverfile'}, -}) - -vim.opt.fillchars:append { diff = "╱" } - -vim.api.nvim_command([[colorscheme gruvbox]]) diff --git a/stylua.toml b/stylua.toml new file mode 100644 index 0000000..5d6c50d --- /dev/null +++ b/stylua.toml @@ -0,0 +1,3 @@ +indent_type = "Spaces" +indent_width = 2 +column_width = 120 \ No newline at end of file