diff --git a/flake.lock b/flake.lock index 52285fa..d50386a 100644 --- a/flake.lock +++ b/flake.lock @@ -387,11 +387,11 @@ "nixpkgs-lib": "nixpkgs-lib_2" }, "locked": { - "lastModified": 1726153070, - "narHash": "sha256-HO4zgY0ekfwO5bX0QH/3kJ/h4KvUDFZg8YpkNwIbg1U=", + "lastModified": 1727826117, + "narHash": "sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "bcef6817a8b2aa20a5a6dbb19b43e63c5bf8619a", + "rev": "3d04084d54bedc3d6b8b736c70ef449225c361b1", "type": "github" }, "original": { @@ -709,11 +709,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1728142617, - "narHash": "sha256-iPiCwcslVd+s2z0IoqTOZtP2XPEVB3TCq5zFUrzNA8g=", + "lastModified": 1728223706, + "narHash": "sha256-HrsylIpk+17wwsh/+sgUBmL7VHakF+EWv9v9Dx1268I=", "ref": "refs/heads/main", - "rev": "0ec6072a290051a03ab66cfb9bc616b2f5540e64", - "revCount": 5298, + "rev": "4e41cda27ed4176005082436cb35878335e63fae", + "revCount": 5301, "submodules": true, "type": "git", "url": "https://github.com/hyprwm/Hyprland" @@ -968,11 +968,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1727710043, - "narHash": "sha256-NpTnTg8oOVvntlTi/t8BUe5msrMmkiZFiOW22fc7B+g=", + "lastModified": 1728216729, + "narHash": "sha256-HsisE2yMld0LckvQ3v/00bXFg11E5Q2XI8taPUewDPA=", "owner": "nix-community", "repo": "lib-aggregate", - "rev": "d03a5f88a345d26ca13918071d42dcc960233183", + "rev": "6c4cf448d33ce86bcc06c6d50bcecc33666105ee", "type": "github" }, "original": { @@ -1117,11 +1117,11 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1727571693, - "narHash": "sha256-b7sFVeqMtz8xntCL3tBY3O8suTg5PeF53LTL3eCcKyc=", + "lastModified": 1728176478, + "narHash": "sha256-px3Q0W//c+mZ4kPMXq4poztsjtXM1Ja1rN+825YMDUQ=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "bb58a3bf239e03fca9d51062e2fe028a4ea5a3d1", + "rev": "b61309c3c1b6013d36299bc8285612865b3b9e4c", "type": "github" }, "original": { @@ -1132,14 +1132,14 @@ }, "nixpkgs-lib_2": { "locked": { - "lastModified": 1725233747, - "narHash": "sha256-Ss8QWLXdr2JCBPcYChJhz4xJm+h/xjl4G0c0XlP6a74=", + "lastModified": 1727825735, + "narHash": "sha256-0xHYkMkeLVQAMa7gvkddbPqpxph+hDzdu1XdGPJR+Os=", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz" + "url": "https://github.com/NixOS/nixpkgs/archive/fb192fec7cc7a4c26d51779e9bab07ce6fa5597a.tar.gz" }, "original": { "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz" + "url": "https://github.com/NixOS/nixpkgs/archive/fb192fec7cc7a4c26d51779e9bab07ce6fa5597a.tar.gz" } }, "nixpkgs-stable": { @@ -1160,11 +1160,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1728093190, - "narHash": "sha256-CAZF2NRuHmqTtRTNAruWpHA43Gg2UvuCNEIzabP0l6M=", + "lastModified": 1728217273, + "narHash": "sha256-p/gvyVf24WFs0bted3c71uSQk++ZOYRWbg3bjRoePu4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "e2f08f4d8b3ecb5cf5c9fd9cb2d53bb3c71807da", + "rev": "50b3bd3fed0442bcbf7f58355e990da84af1749d", "type": "github" }, "original": { @@ -1182,11 +1182,11 @@ "nixpkgs": "nixpkgs_9" }, "locked": { - "lastModified": 1728132959, - "narHash": "sha256-IRh0lQNiDsO2xTz8doRnlWimkKZC8rx7dYNSLV8WXDM=", + "lastModified": 1728219351, + "narHash": "sha256-FVXtRvS0IJCvIadkz/ULFKKceNY/d6hhcNZO73E51/A=", "owner": "nix-community", "repo": "nixpkgs-wayland", - "rev": "736b015f480c3e291fdfe8588836822979ab793d", + "rev": "9463b5d319bc79665db902a1007d1846d4218f62", "type": "github" }, "original": { @@ -1325,11 +1325,11 @@ }, "nixpkgs_7": { "locked": { - "lastModified": 1728067476, - "narHash": "sha256-/uJcVXuBt+VFCPQIX+4YnYrHaubJSx4HoNsJVNRgANM=", + "lastModified": 1728193676, + "narHash": "sha256-PbDWAIjKJdlVg+qQRhzdSor04bAPApDqIv2DofTyynk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "6e6b3dd395c3b1eb9be9f2d096383a8d05add030", + "rev": "ecbc1ca8ffd6aea8372ad16be9ebbb39889e55b6", "type": "github" }, "original": { @@ -1450,11 +1450,11 @@ "systems": "systems_12" }, "locked": { - "lastModified": 1728070710, - "narHash": "sha256-ll6rX0UuLVsp7FUuRKQHO7YxgKGCOTo7vnOX6/hIrX0=", + "lastModified": 1728247562, + "narHash": "sha256-ovmRSqdZgwNIrbwenGAym7hXOexPgKsJoo7fta7CG3E=", "owner": "raphamorim", "repo": "rio", - "rev": "f24835486f5b035a4a998e0ccae83a087089b5f1", + "rev": "f27b9a1c1e0cb76be2eecfe59eb962912e5ea09e", "type": "github" }, "original": { @@ -1538,11 +1538,11 @@ "nixpkgs": "nixpkgs_11" }, "locked": { - "lastModified": 1727490462, - "narHash": "sha256-OrrPiNBiikv9BR464XTT75FzOq7tKAvMbMi7YOKVIeg=", + "lastModified": 1728095260, + "narHash": "sha256-X62hA5ivYLY5G5+mXI6l9eUDkgi6Wu/7QUrwXhJ09oo=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "11a13e50debafae4ae802f1d6b8585101516dd93", + "rev": "d1d2532ab267cfe6e40dff73fbaf34436c406d26", "type": "github" }, "original": { @@ -1581,11 +1581,11 @@ ] }, "locked": { - "lastModified": 1728101832, - "narHash": "sha256-0cRtOtkcQvhcKq0vx2C/2uOVUlOmJNZQzcZiK581wto=", + "lastModified": 1728188225, + "narHash": "sha256-3Mf0XHpECwSxVDb7VYmiD7mqcMA3FcVVfqs3LLZHdaA=", "owner": "Gerg-L", "repo": "spicetify-nix", - "rev": "277107c2bc07582899d53e7fc901e93126d944bd", + "rev": "f532f68a72549f8ee585aa2f6f7dbe9e2ce5a45c", "type": "github" }, "original": { diff --git a/modules/home/apps/tools/neovim/config/.gitignore b/modules/home/apps/tools/neovim/config/.gitignore new file mode 100644 index 0000000..cc5457a --- /dev/null +++ b/modules/home/apps/tools/neovim/config/.gitignore @@ -0,0 +1,8 @@ +tt.* +.tests +doc/tags +debug +.repro +foo.* +*.log +data diff --git a/modules/home/apps/tools/neovim/config/.neoconf.json b/modules/home/apps/tools/neovim/config/.neoconf.json new file mode 100644 index 0000000..7c48087 --- /dev/null +++ b/modules/home/apps/tools/neovim/config/.neoconf.json @@ -0,0 +1,15 @@ +{ + "neodev": { + "library": { + "enabled": true, + "plugins": true + } + }, + "neoconf": { + "plugins": { + "lua_ls": { + "enabled": true + } + } + } +} diff --git a/modules/home/apps/tools/neovim/config/LICENSE b/modules/home/apps/tools/neovim/config/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/modules/home/apps/tools/neovim/config/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/modules/home/apps/tools/neovim/config/README.md b/modules/home/apps/tools/neovim/config/README.md index 6833e74..185280b 100644 --- a/modules/home/apps/tools/neovim/config/README.md +++ b/modules/home/apps/tools/neovim/config/README.md @@ -1,26 +1,4 @@ -# nvimrc +# 💤 LazyVim -**NOTE:** Neovim [nightly](https://github.com/neovim/neovim/releases/nightly) is required for inlay hint. - -This repository contains my personal Neovim configuration, designed to be comprehensive and to provide a feature-rich IDE experience with a polished UI. - -It's my daily driver for Rust, Lua and Web stuff. I also have a backup configuration for Vscode Neovim just in case I'll be forced to use Vscode. - -![preview](https://github.com/luckasRanarison/nvimrc/assets/101930730/27e5b421-7869-4a77-b4d3-cf236b78d8b3) - -## Structure - -```shell -. -├── after -├── core -├── lsp -├── plugins -│   ├── editor -│   ├── lsp -│   ├── tools -│   ├── ui -│   └── utils -├── utils -└── vscode -``` +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/modules/home/apps/tools/neovim/config/lua/after/plugin/c.lua b/modules/home/apps/tools/neovim/config/lua/after/plugin/c.lua deleted file mode 100644 index a1efa40..0000000 --- a/modules/home/apps/tools/neovim/config/lua/after/plugin/c.lua +++ /dev/null @@ -1 +0,0 @@ -vim.opt_local.shiftwidth = 4 diff --git a/modules/home/apps/tools/neovim/config/lua/config/autocmds.lua b/modules/home/apps/tools/neovim/config/lua/config/autocmds.lua new file mode 100644 index 0000000..27e9e06 --- /dev/null +++ b/modules/home/apps/tools/neovim/config/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/modules/home/apps/tools/neovim/config/lua/config/keymaps.lua b/modules/home/apps/tools/neovim/config/lua/config/keymaps.lua new file mode 100644 index 0000000..2c134f7 --- /dev/null +++ b/modules/home/apps/tools/neovim/config/lua/config/keymaps.lua @@ -0,0 +1,3 @@ +-- 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 diff --git a/modules/home/apps/tools/neovim/config/lua/config/lazy.lua b/modules/home/apps/tools/neovim/config/lua/config/lazy.lua new file mode 100644 index 0000000..7833bd6 --- /dev/null +++ b/modules/home/apps/tools/neovim/config/lua/config/lazy.lua @@ -0,0 +1,62 @@ +require("lazy").setup({ + spec = { + -- add LazyVim and import its plugins + { "LazyVim/LazyVim", import = "lazyvim.plugins" }, + -- import/override with your plugins + { import = "lazyvim.plugins.extras.lang.rust" }, + { import = "lazyvim.plugins.extras.lang.json" }, + { import = "lazyvim.plugins.extras.lang.astro" }, + { import = "lazyvim.plugins.extras.lang.git" }, + { import = "lazyvim.plugins.extras.lang.docker" }, + { import = "lazyvim.plugins.extras.lang.clangd" }, + { import = "lazyvim.plugins.extras.lang.cmake" }, + { import = "lazyvim.plugins.extras.lang.haskell" }, + { import = "lazyvim.plugins.extras.lang.java" }, + { import = "lazyvim.plugins.extras.lang.markdown" }, + { import = "lazyvim.plugins.extras.lang.nix" }, + { import = "lazyvim.plugins.extras.lang.sql" }, + { import = "lazyvim.plugins.extras.lang.svelte" }, + { import = "lazyvim.plugins.extras.lang.tailwind" }, + { import = "lazyvim.plugins.extras.lang.tex" }, + { import = "lazyvim.plugins.extras.lang.typescript" }, + { import = "lazyvim.plugins.extras.lang.toml" }, + { import = "lazyvim.plugins.extras.lang.angular" }, + + { import = "lazyvim.plugins.extras.formatting.prettier" }, + + { import = "lazyvim.plugins.extras.coding.luasnip" }, + { import = "lazyvim.plugins.extras.coding.yanky" }, + + { import = "lazyvim.plugins.extras.dap.core" }, + { 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, -- check for plugin updates periodically + notify = false, -- notify on update + }, -- automatically check for plugin updates + performance = { + rtp = { + -- disable some rtp plugins + disabled_plugins = { + "gzip", + -- "matchit", + -- "matchparen", + -- "netrwPlugin", + "tarPlugin", + "tohtml", + "tutor", + "zipPlugin", + }, + }, + }, +}) diff --git a/modules/home/apps/tools/neovim/config/lua/config/options.lua b/modules/home/apps/tools/neovim/config/lua/config/options.lua new file mode 100644 index 0000000..3ea1454 --- /dev/null +++ b/modules/home/apps/tools/neovim/config/lua/config/options.lua @@ -0,0 +1,3 @@ +-- Options are automatically loaded before lazy.nvim startup +-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua +-- Add any additional options here diff --git a/modules/home/apps/tools/neovim/config/lua/core/autocmd.lua b/modules/home/apps/tools/neovim/config/lua/core/autocmd.lua deleted file mode 100644 index 7699d9d..0000000 --- a/modules/home/apps/tools/neovim/config/lua/core/autocmd.lua +++ /dev/null @@ -1,21 +0,0 @@ -return { - { - event = "LspAttach", - opts = { - callback = function(args) - local bufnr = args.buf - local client = vim.lsp.get_client_by_id(args.data.client_id) - local lsp = require("lsp.config") - lsp.set_keymaps(client, bufnr) - lsp.set_autocmd(client, bufnr) - end, - }, - }, - { - event = { "FileType" }, - opts = { - pattern = { "help" }, - callback = require("utils.win").open_help_float, - }, - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/core/filetypes.lua b/modules/home/apps/tools/neovim/config/lua/core/filetypes.lua deleted file mode 100644 index f50c35d..0000000 --- a/modules/home/apps/tools/neovim/config/lua/core/filetypes.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - extension = { - ic = "icelang", - rasi = "rasi", - ebnf = "ebnf", - }, - pattern = { - [".*/hypr/.*%.conf"] = "hyprlang", - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/core/keymaps.lua b/modules/home/apps/tools/neovim/config/lua/core/keymaps.lua deleted file mode 100644 index 223e7f5..0000000 --- a/modules/home/apps/tools/neovim/config/lua/core/keymaps.lua +++ /dev/null @@ -1,285 +0,0 @@ -local map = require("utils.mappings") -local f = require("utils.functions") -local fmt = require("utils.icons").fmt -local fn = require("utils.functions") -local l, cmd, rcmd, lua = map.leader, map.cmd, map.rcmd, map.lua -local freeze, freeze_selection = fn.freeze, fn.freeze_selection - -return { - i = { - ["jj"] = { "", "Exit insert mode" }, - }, - n = { - -- utils - ["vv"] = { "V", "Linewise visual" }, - [l("w")] = { cmd("w"), fmt("Save", "Save file") }, - [l("W")] = { cmd("w!"), fmt("Save", "Save file!") }, - [l("q")] = { cmd("q"), fmt("Exit", "Exit window") }, - [l("Q")] = { cmd("q!"), fmt("Exit", "Exit window!") }, - [l("p")] = { '"_dP', fmt("Clipboard", "Paste from clipboard") }, - [l("P")] = { '"+P', fmt("Clipboard", "Paste from clipboard") }, - [l(":")] = { ":lua ", fmt("Lua", "Lua prompt") }, - [l("%")] = { cmd("luafile %"), fmt("Lua", "Luafile") }, - [l(";")] = { f.comment_line, fmt("Comment", "Comment line") }, - [l(" ")] = { cmd("wincmd w"), fmt("Window", "Switch window") }, - - -- UI utils - [l("uw")] = { f.toggle_wrap, fmt("LineWrap", "Toggle wrap") }, - [l("ug")] = { cmd("GuessIndent"), fmt("Indent", "Guess indent") }, - [l("uf")] = { f.set_filetype, fmt("DefaultFile", "Set filetype") }, - [l("ui")] = { f.set_indent, fmt("Indent", "Set indentation") }, - [l("uI")] = { f.set_indent_type, fmt("Indent", "Set indentation type") }, - [l("us")] = { cmd("nohlsearch"), fmt("Clear", "Clear search highlights") }, - - [""] = { cmd("OverseerRun"), "Overseer Run" }, - [""] = { cmd("OverseerToggle"), "Overseer Toggle" }, - -- Neotree - [l("e")] = { cmd("Neotree toggle"), fmt("FileTree", "Toggle Neotree") }, - - -- Neogit - [l("ng")] = { cmd("Neogit"), fmt("Git", "Open Neogit") }, - - -- Cloak - [l("ct")] = { cmd("CloakToggle"), "Cloak Toggle" }, - - -- Freeze - [l("sc")] = { freeze, "Take code screenshot" }, - - -- Rest - [l("rr")] = { cmd("Rest run"), "Run request in Rest" }, - - -- move.nvim - [""] = { cmd("MoveLine(1)"), "Move line down" }, - [""] = { cmd("MoveLine(-1)"), "Move line up" }, - [""] = { cmd("MoveHChar(-1)"), "Move character left" }, - [""] = { cmd("MoveHChar(1)"), "Move character right" }, - - -- ccc - [l("cp")] = { cmd("CccPick"), fmt("ColorPicker", "Pick color") }, - [l("cc")] = { cmd("CccConvert"), fmt("Swap", "Convert color") }, - [l("ce")] = { cmd("CccHighlighterEnable"), fmt("ColorOn", "Enable highlights") }, - [l("cd")] = { cmd("CccHighlighterDisable"), fmt("ColorOff", "Disable highlights") }, - - -- buffer utils - [l("bq")] = { cmd("BufDel"), fmt("Close", "Close current buffer") }, - [l("bQ")] = { cmd("BufDel!"), fmt("Close", "close current buffer!") }, - [l("bb")] = { cmd("BufferLinePick"), fmt("Open", "Pick to open buffer") }, - [l("bd")] = { cmd("BufferLinePickClose"), fmt("Close", "Pick to close buffer") }, - [l("bl")] = { cmd("BufferLineCloseLeft"), fmt("CloseMultiple", "Close buffers to the left") }, - [l("br")] = { cmd("BufferLineCloseRight"), fmt("CloseMultiple", "Close buffers to the right") }, - [l("bn")] = { cmd("BufferLineCycleNext"), fmt("NextBuffer", "Move to next buffer") }, - [l("bp")] = { cmd("BufferLineCyclePrev"), fmt("PrevBuffer", "Move to previous buffer") }, - [l("bi")] = { cmd("BufferLineTogglePin"), fmt("Pin", "Pin buffer") }, - [l("bg")] = { f.first_buffer, fmt("PrevBuffer", "Move to first buffer") }, - [l("bG")] = { f.last_buffer, fmt("NextBuffer", "Move to last buffer") }, - [l("bv")] = { f.buf_vsplit, fmt("Vertical", "Vertical split") }, - [l("bh")] = { f.buf_hsplit, fmt("Horizontal", "Horizontal split") }, - - -- gitsigns - [l("gb")] = { cmd("Gitsigns toggle_current_line_blame"), fmt("GitDiff", "Line blame") }, - [l("gd")] = { cmd("Gitsigns diffthis"), fmt("GitDiff", "Show diff") }, - [l("gD")] = { cmd("Gitsigns toggle_deleted"), fmt("DiffRemoved", "Toggle deleted") }, - [l("gp")] = { cmd("Gitsigns preview_hunk"), fmt("Popup", "Preview hunk") }, - [l("gP")] = { cmd("Gitsigns preview_hunk_inline"), fmt("Popup", "Preview hunk inline") }, - [l("gn")] = { cmd("Gitsigns next_hunk"), fmt("Down", "Next hunk") }, - [l("gN")] = { cmd("Gitsigns prev_hunk"), fmt("Up", "Previous hunk") }, - [l("gr")] = { cmd("Gitsigns reset_hunk"), fmt("Restore", "Revert hunk") }, - [l("gs")] = { cmd("Gitsigns stage_hunk"), fmt("Save", "Stage hunk") }, - [l("gv")] = { cmd("Gitsigns select_hunk"), fmt("Visual", "Select hunk") }, - [l("gw")] = { cmd("Gitsigns toggle_word_diff"), fmt("GitDiff", "Toggle word diff") }, - [l("gg")] = { cmd("Telescope git_status"), fmt("Git", "Git status") }, - - -- toggleterm - [l("th")] = { cmd("ToggleTerm direction=horizontal"), fmt("Horizontal", "Horizontal terminal") }, - [l("tv")] = { - cmd("ToggleTerm direction=vertical size=60"), - fmt("Vertical", "Vertical terminal"), - }, - [l("tf")] = { cmd("ToggleTerm direction=float"), fmt("Window", "Floating terminal") }, - [l("tl")] = { f.open_lazygit, fmt("GitBranch", "Lazygit terminal") }, - [l("tg")] = { f.open_glow, fmt("Markdown", "Glow terminal") }, - - -- wincmd - [""] = { cmd("wincmd h"), "Move right" }, - [""] = { cmd("wincmd j"), "Move down" }, - [""] = { cmd("wincmd k"), "Move up" }, - [""] = { cmd("wincmd l"), "Move left" }, - - -- telescope - [l("ff")] = { cmd("Telescope find_files"), fmt("FileSearch", "Find files") }, - [l("fF")] = { cmd("Telescope find_files hidden=true"), fmt("FileSearch", "Find all files") }, - [l("fg")] = { cmd("Telescope live_grep"), fmt("TextSearch", "Live grep") }, - [l("fb")] = { cmd("Telescope buffers"), fmt("TabSearch", "Find buffer") }, - [l("fh")] = { cmd("Telescope help_tags"), fmt("Help", "Find help") }, - [l("fd")] = { cmd("Telescope diagnostics"), fmt("Warn", "Find diagnostic") }, - [l("fs")] = { cmd("Telescope lsp_document_symbols"), fmt("Braces", "Document symbol") }, - [l("fr")] = { cmd("Telescope resume"), fmt("Run", "Resume search") }, - [l("fn")] = { cmd("Telescope notify"), fmt("Notification", "Show notifications") }, - [l("fo")] = { cmd("Telescope vim_options"), fmt("Config", "Vim options") }, - [l("f:")] = { cmd("Telescope command_history"), fmt("History", "Command history") }, - [l("fm")] = { cmd("Telescope man_pages"), fmt("Info", "Search man") }, - [l("fR")] = { cmd("Telescope reloader"), fmt("Restore", "Reload module") }, - [l("fH")] = { cmd("Telescope highlights"), fmt("Color", "Highlight group") }, - [l("ft")] = { cmd("Telescope treesitter"), fmt("Symbol", "Treesitter") }, - [l("fz")] = { cmd("Telescope current_buffer_fuzzy_find"), fmt("Search", "Buffer fuzzy find") }, - [l("fp")] = { cmd("Telescope registers"), fmt("Clipboard", "Registers") }, - [l("fq")] = { cmd("Telescope quickfix"), fmt("Fix", "Quickfix") }, - [l("gc")] = { cmd("Telescope git_bcommits"), fmt("GitCommit", "Find branch commit") }, - [l("gC")] = { cmd("Telescope git_commits"), fmt("GitCommit", "Find commit") }, - [l("gB")] = { cmd("Telescope git_branches"), fmt("GitBranch", "Find git branch") }, - - -- Lazy - [l("L")] = { cmd("Lazy"), fmt("Package", "Plugin manager") }, - - -- Mason - [l("M")] = { cmd("Mason"), fmt("Package", "Mason") }, - - -- DAP - [l("do")] = { f.open_dapui, fmt("Open", "Open debugger UI") }, - [l("dq")] = { f.close_dapui, fmt("Close", "Close debugger UI") }, - [l("dt")] = { f.toggle_dapui, fmt("Toggle", "Toggle debugger") }, - [l("dc")] = { cmd("DapTerminate"), fmt("Stop", "Terminate session") }, - [l("dr")] = { cmd("DapRestartFrame"), fmt("Restart", "Restart frame") }, - [l("db")] = { cmd("DapToggleBreakpoint"), fmt("Toggle", "Toggle breakpoint") }, - [l("dl")] = { cmd("DapShowLog"), fmt("DefaultFile", "Show logs") }, - [""] = { cmd("DapContinue"), "Continue session" }, - [""] = { cmd("DapToggleBreakpoint"), "Toggle breakpoint" }, - [""] = { cmd("DapStepInto"), "Step into" }, - [""] = { cmd("DapStepOut"), "Step out" }, - [""] = { cmd("DapStepOver"), "Step over" }, - - -- telescope DAP - [l("dB")] = { - lua("require('telescope').extensions.dap.list_breakpoints()"), - fmt("Breakpoint", "List breakpoints"), - }, - [l("dv")] = { - lua("require('telescope').extensions.dap.variables()"), - fmt("Variable", "List variables"), - }, - [l("df")] = { - lua("require('telescope').extensions.dap.frames()"), - fmt("Stack", "List frames"), - }, - [l("dF")] = { - lua("require('telescope').extensions.dap.configurations()"), - fmt("Config", "List configurations"), - }, - [l("dC")] = { - lua("require('telescope').extensions.dap.commands()"), - fmt("Command", "List commands"), - }, - - -- session-manager - [l("Ss")] = { cmd("SessionManager save_current_session"), fmt("Save", "Save session") }, - [l("Sl")] = { cmd("SessionManager load_session"), fmt("Restore", "Load session") }, - [l("SL")] = { cmd("SessionManager load_last_session"), fmt("Restore", "Load last session") }, - [l("Sd")] = { cmd("SessionManager delete_session"), fmt("Trash", "Delete session") }, - [l("SD")] = { - cmd("SessionManager load_current_dir_session"), - fmt("FolderClock", "Load current directory session"), - }, - - -- notify - [l("nn")] = { - lua("require('notify').dismiss()"), - fmt("NotificationDismiss", "Dismiss notifications"), - }, - - -- lspconfig - [l("li")] = { cmd("LspInfo"), fmt("Info", "Server info") }, - [l("lI")] = { cmd("LspLog"), fmt("DefaultFile", "Server logs") }, - [l("lS")] = { ":LspStart ", fmt("Run", "Start server") }, - [l("lq")] = { ":LspStop ", fmt("Stop", "Stop server") }, - [l("lR")] = { cmd("LspRestart"), fmt("Restart", "Restart server") }, - - -- dropbar - [l("ok")] = { lua("require('dropbar.api').goto_context_start()"), fmt("Up", "Context start") }, - [l("oo")] = { lua("require('dropbar.api').pick()"), fmt("Check", "Pick node") }, - - -- DbUI - [l("Dd")] = { cmd("DBUIToggle"), fmt("Toggle", "Toggle DbUI") }, - [l("Da")] = { cmd("DBUIAddConnection"), fmt("Add", "Add connection") }, - - -- nvim-devdocs - [l("v ")] = { cmd("DevdocsToggle"), fmt("Window", "Toggle floating window") }, - [l("vc")] = { cmd("DevdocsOpenCurrentFloat"), fmt("BookmarkSearch", "Open current file docs") }, - [l("vv")] = { cmd("DevdocsOpenFloat"), fmt("BookmarkSearch", "Open in floating window") }, - [l("vV")] = { cmd("DevdocsOpen"), fmt("BookmarkSearch", "Open in a normal buffer") }, - [l("vf")] = { ":DevdocsOpenFloat ", fmt("BookmarkSearch", "Open documentation") }, - [l("vi")] = { ":DevdocsInstall ", fmt("Install", "Install documentation") }, - [l("vu")] = { ":DevdocsUninstall ", fmt("Trash", "Install documentation") }, - - -- crates - [l("Cv")] = { - lua("require('crates').show_versions_popup()"), - fmt("Info", "Show versions popup"), - }, - [l("Cf")] = { - lua("require('crates').show_features_popup()"), - fmt("Stack", "Show features popup"), - }, - [l("Cd")] = { - lua("require('crates').show_dependencies_popup()"), - fmt("Dependencies", "Show dependencies popup"), - }, - [l("Cu")] = { - lua("require('crates').update_crate()"), - fmt("Update", "Update crate"), - }, - [l("CU")] = { - lua("require('crates').update_all_crates()"), - fmt("Update", "Update all crates"), - }, - [l("CD")] = { - lua("require('crates').open_documentation()"), - fmt("DefaultFile", "Open documentation"), - }, - [l("Ch")] = { - lua("require('crates').open_homepage()"), - fmt("Web", "Open homepage"), - }, - [l("Cc")] = { - lua("require('crates').open_crates_io()"), - fmt("Package", "Open crates.io"), - }, - [l("Cr")] = { - lua("require('crates').open_repository()"), - fmt("Github", "Open repository"), - }, - }, - v = { - -- move.nvim - [""] = { rcmd("MoveBlock(-1)"), "Move line up" }, - [""] = { rcmd("MoveBlock(1)"), "Move line down" }, - [""] = { rcmd("MoveHBlock(-1)"), "Move character left" }, - [""] = { rcmd("MoveHBlock(1)"), "Move character right" }, - - -- utils - ["q"] = { "" }, - [l("y")] = { '"+y', fmt("Clipboard", "yank to clipboard") }, - [l("p")] = { '"+p', fmt("Clipboard", "Paste from clipboard") }, - [l("P")] = { '"+P', fmt("Clipboard", "Paste from clipboard") }, - [l(";")] = { f.comment_selection, fmt("Comment", "Comment selection") }, - - -- Freeze - [l("sc")] = { freeze_selection, "Take code screenshot" }, - - -- gitsigns - [l("gr")] = { cmd("Gitsigns reset_hunk"), fmt("Restore", "Revert hunk") }, - - -- crates - [l("Cu")] = { lua("require('crates').update_crates()"), fmt("Update", "Update crates") }, - }, - - t = { - -- toggleterm - [""] = { [[]] }, - - -- wincmd - [""] = { cmd("wincmd h"), "Move right" }, - [""] = { cmd("wincmd j"), "Move down" }, - [""] = { cmd("wincmd k"), "Move up" }, - [""] = { cmd("wincmd l"), "Move left" }, - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/core/options.lua b/modules/home/apps/tools/neovim/config/lua/core/options.lua deleted file mode 100644 index e91d49a..0000000 --- a/modules/home/apps/tools/neovim/config/lua/core/options.lua +++ /dev/null @@ -1,36 +0,0 @@ -return { - opt = { - fileencoding = "utf-8", - cmdheight = 0, - number = true, - relativenumber = true, - history = 100, - termguicolors = true, - filetype = "on", - cursorline = true, - foldenable = true, - foldlevel = 99, - foldlevelstart = 99, - ignorecase = true, - shiftwidth = 2, - showtabline = 0, - tabstop = 2, - expandtab = true, - wrap = false, - writebackup = false, - laststatus = 0, - updatetime = 200, - fillchars = "eob: ", - modeline = false, - conceallevel = 2, - mouse = "n", - clipboard = "unnamedplus", - scrolloff = 15, - }, - - g = { - mapleader = " ", - maplocalleader = "_", - highlighturl_enabled = true, - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/core/signs.lua b/modules/home/apps/tools/neovim/config/lua/core/signs.lua deleted file mode 100644 index 2e5d4ed..0000000 --- a/modules/home/apps/tools/neovim/config/lua/core/signs.lua +++ /dev/null @@ -1,9 +0,0 @@ -local icons = require("utils.icons").icons - -return { - { name = "DiagnosticSignError", text = icons.Error, texthl = "DiagnosticError" }, - { name = "DiagnosticSignHint", text = icons.Hint, texthl = "DiagnosticHint" }, - { name = "DiagnosticSignWarn", text = icons.Warn, texthl = "DiagnosticWarn" }, - { name = "DiagnosticSignInfo", text = icons.Info, texthl = "DiagnosticInfo" }, - { name = "DapBreakpoint", text = icons.Breakpoint, texthl = "Breakpoint" }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/lsp/autocmd.lua b/modules/home/apps/tools/neovim/config/lua/lsp/autocmd.lua deleted file mode 100644 index fa7e718..0000000 --- a/modules/home/apps/tools/neovim/config/lua/lsp/autocmd.lua +++ /dev/null @@ -1,18 +0,0 @@ -local lsp = require("lsp.functions") - -return { - -- ["textDocument/codeLens"] = { - -- event = { "BufEnter", "InsertLeave" }, - -- opts = { - -- group = vim.api.nvim_create_augroup("LspCodelens", {}), - -- callback = lsp.refresh_codelens, - -- }, - -- }, - ["textDocument/formatting"] = { - event = "BufWritePost", - opts = { - group = vim.api.nvim_create_augroup("LspFormatting", {}), - callback = lsp.format, - }, - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/lsp/config.lua b/modules/home/apps/tools/neovim/config/lua/lsp/config.lua deleted file mode 100644 index 4ed2a9f..0000000 --- a/modules/home/apps/tools/neovim/config/lua/lsp/config.lua +++ /dev/null @@ -1,27 +0,0 @@ -local M = {} - -M.set_autocmd = function(client, bufnr) - local capability_map = require("lsp.autocmd") - - for capability, map in pairs(capability_map) do - if client.supports_method(capability) then - vim.api.nvim_clear_autocmds({ group = map.opts.group, buffer = bufnr }) - map.opts.buffer = bufnr - vim.api.nvim_create_autocmd(map.event, map.opts) - end - end -end - -M.set_keymaps = function(client, bufnr) - local capability_map = require("lsp.keymaps") - - for capability, maps in pairs(capability_map) do - if client.supports_method(capability) then - for key, map in pairs(maps) do - vim.keymap.set("n", key, map[1], { desc = map[2], buffer = bufnr }) - end - end - end -end - -return M diff --git a/modules/home/apps/tools/neovim/config/lua/lsp/functions.lua b/modules/home/apps/tools/neovim/config/lua/lsp/functions.lua deleted file mode 100644 index 0e33bff..0000000 --- a/modules/home/apps/tools/neovim/config/lua/lsp/functions.lua +++ /dev/null @@ -1,72 +0,0 @@ -local M = {} - -M.definitions = function() - vim.cmd("Telescope lsp_definitions") -end -M.type_definition = function() - vim.lsp.buf.type_definition() -end -M.declarations = function() - vim.lsp.buf.declaration() -end -M.implementations = function() - vim.cmd("Telescope lsp_implementations") -end -M.references = function() - vim.cmd("Telescope lsp_references") -end -M.hover = function() - vim.lsp.buf.hover() -end -M.rename = function() - vim.lsp.buf.rename() -end -M.signature_help = function() - vim.lsp.buf.signature_help() -end -M.symbols = function() - vim.cmd("Telescope lsp_workspace_symbols") -end -M.refresh_codelens = function() - vim.lsp.codelens.refresh() -end -M.run_codelens = function() - vim.lsp.codelens.run() -end -M.toggle_inlay_hint = function() - vim.lsp.inlay_hint.enable(0, not vim.lsp.inlay_hint.is_enabled(0)) -end - -M.diagnostics = function() - local _, win = vim.diagnostic.open_float() - if win then - vim.api.nvim_win_set_config(win, { border = "rounded" }) - vim.wo[win].signcolumn = "yes:1" - end -end -M.next_diagnostic = function() - vim.diagnostic.goto_next() -end -M.prev_diagnostic = function() - vim.diagnostic.goto_prev() -end - -M.format = function() - vim.api.nvim_create_autocmd("TextChanged", { - group = vim.api.nvim_create_augroup("ApplyFormattingEdit", {}), - buffer = vim.api.nvim_get_current_buf(), - callback = function() - vim.cmd("silent noautocmd update") - vim.diagnostic.show() - vim.api.nvim_del_augroup_by_name("ApplyFormattingEdit") - end, - }) - vim.lsp.buf.format({ - async = true, - filter = function(client) - return client.name == "null-ls" - end, - }) -end - -return M diff --git a/modules/home/apps/tools/neovim/config/lua/lsp/handlers.lua b/modules/home/apps/tools/neovim/config/lua/lsp/handlers.lua deleted file mode 100644 index 3fb0981..0000000 --- a/modules/home/apps/tools/neovim/config/lua/lsp/handlers.lua +++ /dev/null @@ -1,132 +0,0 @@ -local M = {} - -local make_config = function(name, config) - local capabilities = vim.lsp.protocol.make_client_capabilities() - capabilities.textDocument.completion.completionItem.snippetSupport = true - capabilities.textDocument.colorProvider = { dynamicRegistration = true } - local extended_config = vim.tbl_extend("error", { capabilities = capabilities }, config) - - return function() - require("lspconfig")[name].setup(extended_config) - end -end - --- Default handler --- M[1] = function(server_name) --- make_config(server_name, {})() --- end - -M.bashls = make_config("bashls", {}) - -M.lua_ls = make_config("lua_ls", { - settings = { - Lua = { - hint = { - enable = true, - }, - diagnostics = { - globals = { "vim" }, - }, - }, - }, -}) - -M.nil_ls = make_config("nixd", {}) - -M.jdtls = make_config("jdtls", { - settings = { - java = { - signatureHelp = { enabled = true }, - configuration = { - updateBuildConfiguration = "interactive", - -- runtimes = { - -- { - -- name = "JavaSE-11", - -- path = "/usr/lib/jvm/java-11-openjdk/", - -- default = true - -- }, - -- -- { - -- -- name = "JavaSE-17", - -- -- path = "/usr/lib/jvm/java-17-openjdk/", - -- -- }, - -- }, - }, - - eclipse = { - downloadSources = true, - }, - maven = { - downloadSources = true, - }, - implementationsCodeLens = { - enabled = true, - }, - referencesCodeLens = { - enabled = true, - }, - references = { - includeDecompiledSources = true, - }, - inlayHints = { - parameterNames = { - enabled = "all", -- literals, all, none - }, - }, - completion = { - favoriteStaticMembers = { - "org.hamcrest.MatcherAssert.assertThat", - "org.hamcrest.Matchers.*", - "org.hamcrest.CoreMatchers.*", - "org.junit.jupiter.api.Assertions.*", - "java.util.Objects.requireNonNull", - "java.util.Objects.requireNonNullElse", - "org.mockito.Mockito.*", - }, - }, - sources = { - organizeImports = { - starThreshold = 9999, - staticStarThreshold = 9999, - }, - }, - codeGeneration = { - toString = { - template = "${object.className}{${member.name()}=${member.value}, ${otherMembers}}", - }, - useBlocks = true, - }, - }, - }, -}) - -M.cssls = make_config("cssls", { - settings = { - css = { - validate = true, - lint = { - unknownAtRules = "ignore", - }, - }, - }, -}) - -M.texlab = make_config("texlab", {}) -M.astro = make_config("astro", {}) - -M.tailwindcss = make_config("tailwindcss", { - on_attach = function() - local bufnr = vim.api.nvim_get_current_buf() - require("document-color").buf_attach(bufnr) - end, -}) - -M.clangd = make_config("clangd", { - cmd = { - "clangd", - "--offset-encoding=utf-16", - }, -}) - -M.ts_ls = make_config("ts_ls", {}) - -return M diff --git a/modules/home/apps/tools/neovim/config/lua/lsp/keymaps.lua b/modules/home/apps/tools/neovim/config/lua/lsp/keymaps.lua deleted file mode 100644 index d56cc4f..0000000 --- a/modules/home/apps/tools/neovim/config/lua/lsp/keymaps.lua +++ /dev/null @@ -1,52 +0,0 @@ -local map = require("utils.mappings") -local lsp = require("lsp.functions") -local l, cmd = map.leader, map.cmd -local fmt = require("utils.icons").fmt - -return { - ["textDocument/formatting"] = { - [l("lf")] = { lsp.format, fmt("Format", "Format buffer") }, - }, - ["textDocument/publishDiagnostics"] = { - [l("ld")] = { lsp.diagnostics, fmt("Warn", "Hover diagnostic") }, - [""] = { lsp.next_diagnostic, "Next diagnostic" }, - [""] = { lsp.prev_diagnostic, "Previous diagnostic" }, - }, - ["textDocument/codeAction"] = { - [l("a ")] = { cmd("CodeActionToggleLabel"), fmt("Toggle", "Toggle label") }, - }, - ["textDocument/definition"] = { - ["gd"] = { lsp.definitions, "Go to definition" }, - }, - ["textDocument/declaration"] = { - ["gD"] = { lsp.declarations, "Go to declaration" }, - }, - ["textDocument/hover"] = { - ["K"] = { lsp.hover, "Hover info" }, - }, - ["textDocument/implementation"] = { - ["gI"] = { lsp.implementations, "Symbol implementation" }, - }, - ["textDocument/references"] = { - ["gr"] = { lsp.references, "Go to reference" }, - }, - ["textDocument/rename"] = { - ["lr"] = { lsp.rename, fmt("Edit", "Rename symbol") }, - }, - ["textDocument/signatureHelp"] = { - ["lH"] = { lsp.signature_help, fmt("Help", "Signature help") }, - }, - ["textDocument/typeDefinition"] = { - ["gT"] = { lsp.type_definition, "Go to type definition" }, - }, - -- ["textDocument/codeLens"] = { - -- ["ll"] = { lsp.run_codelens, fmt("Run", "Run codelens") }, - -- ["lL"] = { lsp.refresh_codelens, fmt("Restart", "Refresh codelens") }, - -- }, - ["workspace/symbol"] = { - ["ls"] = { lsp.symbols, fmt("Symbol", "Workspace symbols") }, - }, - ["workspace/inlayHint"] = { - ["lh"] = { lsp.toggle_inlay_hint, fmt("Toggle", "Toggle inlay hint") }, - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/core.lua b/modules/home/apps/tools/neovim/config/lua/plugins/core.lua new file mode 100644 index 0000000..1d1ccd1 --- /dev/null +++ b/modules/home/apps/tools/neovim/config/lua/plugins/core.lua @@ -0,0 +1,16 @@ +return { + { + "LazyVim/LazyVim", + opts = { + colorscheme = "catppuccin", + }, + }, + { + "stevearc/conform.nvim", + opts = { + formatters_by_ft = { + nix = { "alejandra" }, + }, + }, + }, +} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/curl.lua b/modules/home/apps/tools/neovim/config/lua/plugins/curl.lua new file mode 100644 index 0000000..929011d --- /dev/null +++ b/modules/home/apps/tools/neovim/config/lua/plugins/curl.lua @@ -0,0 +1,11 @@ +return { + "oysandvik94/curl.nvim", + cmd = { "CurlOpen" }, + keys = { + { "co", "CurlOpen", desc = "Open Curl" }, + }, + dependencies = { + "nvim-lua/plenary.nvim", + }, + config = true, +} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/editor/context.lua b/modules/home/apps/tools/neovim/config/lua/plugins/editor/context.lua deleted file mode 100644 index 9055dce..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/editor/context.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - "nvim-treesitter/nvim-treesitter-context", - event = "BufEnter", - opts = { enable = true, max_lines = 3 }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/editor/core.lua b/modules/home/apps/tools/neovim/config/lua/plugins/editor/core.lua deleted file mode 100644 index 72c2ad6..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/editor/core.lua +++ /dev/null @@ -1,106 +0,0 @@ -local format = require("utils.icons").fmt - -return { - { - "psliwka/vim-smoothie", - keys = { "", "", "zz" }, - }, - - { - "numToStr/Comment.nvim", - dependencies = { "JoosepAlviste/nvim-ts-context-commentstring" }, - keys = { - { "gcc", mode = { "n" }, desc = "Comment line" }, - { "gc", mode = { "v" }, desc = "Comment selection" }, - }, - config = function() - local ft = require("Comment.ft") - - ft.hypr = { "# %s" } - - require("Comment").setup({ - pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(), - }) - end, - }, - - { - "NMAC427/guess-indent.nvim", - event = { "BufReadPost", "BufNewFile" }, - opts = { - autocmd = true, - }, - }, - - { - "ojroques/nvim-bufdel", - cmd = { "BufDel", "BufDelAll", "BufDelOthers" }, - opts = { quit = false }, - }, - - { - "fedepujol/move.nvim", - cmd = { - "MoveLine", - "MoveHChar", - "MoveBlock", - "MoveHBlock", - }, - }, - - { - "windwp/nvim-autopairs", - event = "InsertEnter", - opts = {}, - }, - - { - "kylechui/nvim-surround", - keys = { - { "cs", mode = { "n" }, desc = "Change surrounding pair" }, - { "ds", mode = { "n" }, desc = "Delete surrounding pair" }, - { "ys", mode = { "n" }, desc = "Add surrounding pair" }, - { "S", mode = { "v" }, desc = "Add surrounding pair" }, - }, - config = function() - require("nvim-surround").setup() - end, - }, - - { - "kevinhwang91/nvim-ufo", - event = { "BufReadPost", "BufNewFile" }, - dependencies = { "kevinhwang91/promise-async" }, - opts = { - provider_selector = function() - return { "treesitter", "indent" } - end, - }, - }, - - { - "RRethy/vim-illuminate", - event = { "BufReadPost", "BufNewFile" }, - config = function() - require("illuminate").configure({ - filetypes_denylist = { - "neo-tree", - "dropbar_menu", - "CodeAction", - }, - }) - end, - }, - - { - "Wansmer/treesj", - dependencies = { "nvim-treesitter/nvim-treesitter" }, - keys = { - { "j", mode = { "n" }, ":TSJSplit", desc = format("Down", "Split node") }, - { "J", mode = { "n" }, ":TSJJoin", desc = format("Up", "Join node") }, - }, - opts = { - use_default_keymaps = false, - }, - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/editor/gitsigns.lua b/modules/home/apps/tools/neovim/config/lua/plugins/editor/gitsigns.lua deleted file mode 100644 index 400dedc..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/editor/gitsigns.lua +++ /dev/null @@ -1,17 +0,0 @@ -return { - "lewis6991/gitsigns.nvim", - event = { "BufReadPre", "BufNewFile" }, - opts = { - signs = { - add = { hl = "GitSignsAdd", text = "▎" }, - change = { hl = "GitSignsChange", text = "▎" }, - untracked = { hl = "GitSignsAdd", text = "▎" }, - delete = { hl = "GitSignsDelete", text = "▎" }, - topdelete = { hl = "GitSignsDelete", text = "▎" }, - changedelete = { hl = "GitSignsChange", text = "▎" }, - }, - preview_config = { - border = "none", - }, - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/editor/markview.lua b/modules/home/apps/tools/neovim/config/lua/plugins/editor/markview.lua deleted file mode 100644 index bbb0499..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/editor/markview.lua +++ /dev/null @@ -1,11 +0,0 @@ -return { - "OXY2DEV/markview.nvim", - - dependencies = { - -- You may not need this if you don't lazy load - -- Or if the parsers are in your $RUNTIMEPATH - "nvim-treesitter/nvim-treesitter", - - "nvim-tree/nvim-web-devicons", - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/editor/neogit.lua b/modules/home/apps/tools/neovim/config/lua/plugins/editor/neogit.lua deleted file mode 100644 index 21d5dfb..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/editor/neogit.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - "NeogitOrg/neogit", - branch = "master", - dependencies = { - "nvim-lua/plenary.nvim", -- required - "sindrets/diffview.nvim", -- optional - Diff integration - - -- Only one of these is needed, not both. - "nvim-telescope/telescope.nvim", -- optional - }, - config = true, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/editor/nvim-cmp.lua b/modules/home/apps/tools/neovim/config/lua/plugins/editor/nvim-cmp.lua deleted file mode 100644 index 3c68b38..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/editor/nvim-cmp.lua +++ /dev/null @@ -1,195 +0,0 @@ -return { - { - "L3MON4D3/LuaSnip", - dependencies = { "rafamadriz/friendly-snippets" }, - event = "InsertEnter", - build = "make install_jsregexp", - config = function() - require("luasnip.loaders.from_vscode").lazy_load() - - local ls = require("luasnip") - local s = ls.snippet - local i = ls.insert_node - local t = ls.text_node - local fmt = require("luasnip.extras.fmt").fmt -- Import the fmt function - - -- Define a new snippet for your specific use case - ls.add_snippets("nix", { -- Assuming the snippet is for Nix files, adjust the filetype as necessary - s( - "nixcfg", - fmt( - [[ -{ - lib, - config, - pkgs, - ... -}: -with lib; -with lib.custom; let - cfg = config.<>; -in { - options.<> = with types; { - enable = mkBoolOpt false "<>"; - }; - - config = mkIf cfg.enable { -<> - }; -}]], - { - i(1), -- Cursor point 1, after config. - i(2), -- Cursor point 2, after options. - i(3), -- Cursor point 3, for the option description inside mkBoolOpt - i(4), -- Cursor point 4, inside the mkIf cfg.enable block - }, - { delimiters = "<>" } - ) - ), -- Ensure to specify the delimiters if they differ from the default - }) - end, - }, - - { - "hrsh7th/nvim-cmp", - event = { "InsertEnter", "CmdlineEnter" }, - dependencies = { - "neovim/nvim-lspconfig", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", - "L3MON4D3/LuaSnip", - "saadparwaiz1/cmp_luasnip", - "onsails/lspkind-nvim", - "windwp/nvim-autopairs", - }, - opts = function() - local cmp = require("cmp") - local cmp_autopairs = require("nvim-autopairs.completion.cmp") - local lspkind = require("lspkind") - - cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) - - local function get_lsp_completion_context(completion, source) - local ok, source_name = pcall(function() - return source.source.client.config.name - end) - if not ok then - return nil - end - - if source_name == "tsserver" then - return completion.detail - elseif source_name == "pyright" and completion.labelDetails ~= nil then - return completion.labelDetails.description - elseif source_name == "clang_d" then - local doc = completion.documentation - if doc == nil then - return - end - - local import_str = doc.value - - local i, j = string.find(import_str, '["<].*[">]') - if i == nil then - return - end - - return string.sub(import_str, i, j) - end - end - - cmp.setup.cmdline(":", { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = "path" }, - }, { - { name = "cmdline" }, - }), - }) - - local snip_status_ok, luasnip = pcall(require, "luasnip") - - if not snip_status_ok then - return - end - - return { - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - - window = { - completion = { - winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None", - col_offset = -3, - side_padding = 0, - }, - }, - sources = cmp.config.sources({ - { name = "nvim_lsp", priority = 1000 }, - { name = "crates", priority = 1000 }, - { name = "luasnip", priority = 750 }, - { name = "buffer", priority = 500 }, - { name = "path", priority = 250 }, - { name = "neorg", priority = 250 }, - }), - mapping = { - [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }), - [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }), - [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), - [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), - [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), - [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), - [""] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), - [""] = cmp.config.disable, - [""] = cmp.mapping({ i = cmp.mapping.abort(), c = cmp.mapping.close() }), - [""] = cmp.mapping.confirm({ select = false }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { "i", "s" }), - }, - view = { - entries = { name = "custom", selection_order = "near_cursor" }, - }, - experimental = { - ghost_text = true, - }, - formatting = { - fields = { "kind", "abbr", "menu" }, - format = function(entry, vim_item) - local kind = lspkind.cmp_format({ - mode = "symbol_text", - maxwidth = 50, - })(entry, vim_item) - local strings = vim.split(kind.kind, "%s", { trimempty = true }) - kind.kind = " " .. strings[1] .. " " - kind.menu = " (" .. strings[2] .. ")" - - return kind - end, - }, - } - end, - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/editor/nvim-dap.lua b/modules/home/apps/tools/neovim/config/lua/plugins/editor/nvim-dap.lua deleted file mode 100644 index a224f2b..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/editor/nvim-dap.lua +++ /dev/null @@ -1,17 +0,0 @@ -return { - "mfussenegger/nvim-dap", - keys = { - { "d", mode = { "n" } }, - }, - cmd = { "DapContinue", "DapToggleBreakpoint" }, - dependencies = { - { "rcarriga/nvim-dap-ui", opts = {} }, - { "nvim-neotest/nvim-nio" }, - { - "theHamsta/nvim-dap-virtual-text", - opts = { - virt_text_pos = "eol", - }, - }, - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/editor/nvim-treesitter.lua b/modules/home/apps/tools/neovim/config/lua/plugins/editor/nvim-treesitter.lua deleted file mode 100644 index 2a15cc0..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/editor/nvim-treesitter.lua +++ /dev/null @@ -1,70 +0,0 @@ -return { - "nvim-treesitter/playground", - { - "nvim-treesitter/nvim-treesitter", - dependencies = { "windwp/nvim-ts-autotag" }, - event = { "BufReadPost", "BufNewFile" }, - cmd = { - "TSBufDisable", - "TSBufEnable", - "TSBufToggle", - "TSDisable", - "TSEnable", - "TSToggle", - "TSInstall", - "TSInstallInfo", - "TSInstallSync", - "TSModuleInfo", - "TSUninstall", - "TSUpdate", - "TSUpdateSync", - }, - build = ":TSUpdate", - opts = { - highlight = { - enable = true, - disable = function(_, bufnr) - return vim.api.nvim_buf_line_count(bufnr) > 10000 - end, - }, - incremental_selection = { enable = true }, - indent = { enable = true }, - autotag = { enable = true }, - context_commentstring = { - enable = true, - enable_autocmd = false, - }, - ensure_installed = { - "bash", - "c", - "html", - "css", - "javascript", - "json", - "toml", - "lua", - "luadoc", - "luap", - "markdown", - "markdown_inline", - "python", - "rust", - "tsx", - "typescript", - "vim", - "vimdoc", - "yaml", - "sql", - "query", - "java", - "http", - "rasi", - "haskell", - "ebnf", - }, - }, - config = function(_, opts) - require("nvim-treesitter.configs").setup(opts) - end, - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/editor/overseer.lua b/modules/home/apps/tools/neovim/config/lua/plugins/editor/overseer.lua deleted file mode 100644 index f15503a..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/editor/overseer.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - "stevearc/overseer.nvim", - opts = { - task_list = { - direction = "bottom", - }, - }, - dependencies = { - { - "stevearc/dressing.nvim", - opts = {}, - }, - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/editor/session-manager.lua b/modules/home/apps/tools/neovim/config/lua/plugins/editor/session-manager.lua deleted file mode 100644 index df5ff21..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/editor/session-manager.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - "Shatur/neovim-session-manager", - cmd = { "SessionManager" }, - config = function() - local config = require("session_manager.config") - require("session_manager").setup({ - autoload_mode = config.AutoloadMode.Disabled, - }) - end, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/editor/telescope.lua b/modules/home/apps/tools/neovim/config/lua/plugins/editor/telescope.lua deleted file mode 100644 index f9a98b5..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/editor/telescope.lua +++ /dev/null @@ -1,33 +0,0 @@ -local format = require("utils.icons").fmt - -return { - { - "nvim-telescope/telescope.nvim", - cmd = { "Telescope" }, - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-telescope/telescope-fzf-native.nvim", - "nvim-telescope/telescope-dap.nvim", - }, - opts = { - defaults = { - prompt_prefix = "> ", - selection_caret = "> ", - path_display = { "truncate" }, - sorting_strategy = "ascending", - layout_config = { - horizontal = { prompt_position = "top", preview_width = 0.55 }, - vertical = { mirror = false }, - width = 0.87, - height = 0.80, - preview_cutoff = 120, - }, - }, - extensions = { - fzf = {}, - aerial = {}, - dap = {}, - }, - }, - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/editor/tmux-nav.lua b/modules/home/apps/tools/neovim/config/lua/plugins/editor/tmux-nav.lua deleted file mode 100644 index 767eafb..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/editor/tmux-nav.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - "christoomey/vim-tmux-navigator", - lazy = false, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/editor/todo-comments.lua b/modules/home/apps/tools/neovim/config/lua/plugins/editor/todo-comments.lua deleted file mode 100644 index 0009823..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/editor/todo-comments.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - "folke/todo-comments.nvim", - dependencies = { "nvim-lua/plenary.nvim" }, - opts = {}, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/editor/toggleterm.lua b/modules/home/apps/tools/neovim/config/lua/plugins/editor/toggleterm.lua deleted file mode 100644 index 2206466..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/editor/toggleterm.lua +++ /dev/null @@ -1,17 +0,0 @@ -return { - "akinsho/toggleterm.nvim", - cmd = { "ToggleTerm" }, - opts = { - shade_terminals = false, - direction = "float", - float_opts = { - border = "rounded", - width = 80, - }, - highlights = { - FloatBorder = { - link = "FloatBorder", - }, - }, - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/example.lua b/modules/home/apps/tools/neovim/config/lua/plugins/example.lua new file mode 100644 index 0000000..4ad9825 --- /dev/null +++ b/modules/home/apps/tools/neovim/config/lua/plugins/example.lua @@ -0,0 +1,193 @@ +-- 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 }, + + -- 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 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").lsp.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", + }, + }, + }, +} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/init.lua b/modules/home/apps/tools/neovim/config/lua/plugins/init.lua deleted file mode 100644 index 129d8dd..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/init.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - { import = "plugins.ui" }, - { import = "plugins.editor" }, - { import = "plugins.lsp" }, - { import = "plugins.tools" }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/lsp/otter.lua b/modules/home/apps/tools/neovim/config/lua/plugins/lsp/otter.lua deleted file mode 100644 index 7343d63..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/lsp/otter.lua +++ /dev/null @@ -1,11 +0,0 @@ -return { - "jmbuhr/otter.nvim", - dependencies = { - "hrsh7th/nvim-cmp", - "neovim/nvim-lspconfig", - "nvim-treesitter/nvim-treesitter", - }, - setup = function() - require("otter").activate({ "python", "rust" }, true, true, nil) - end, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/lsp/server-plugins.lua b/modules/home/apps/tools/neovim/config/lua/plugins/lsp/server-plugins.lua deleted file mode 100644 index b894ccf..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/lsp/server-plugins.lua +++ /dev/null @@ -1,23 +0,0 @@ -return { - { "folke/neodev.nvim", ft = "lua", opts = {} }, - { - "b0o/schemastore.nvim", - ft = "json", - config = function() - require("lspconfig").jsonls.setup({ - capabilities = require("lsp.capabilities"), - settings = { - json = { - schemas = require("schemastore").json.schemas(), - validate = { enable = true }, - }, - }, - }) - end, - }, - { - "mrcjkb/rustaceanvim", - version = "^4", -- Recommended - ft = { "rust" }, - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/neogit.lua b/modules/home/apps/tools/neovim/config/lua/plugins/neogit.lua new file mode 100644 index 0000000..1befde7 --- /dev/null +++ b/modules/home/apps/tools/neovim/config/lua/plugins/neogit.lua @@ -0,0 +1,15 @@ +return { + "NeogitOrg/neogit", + cmd = { "Neogit" }, + keys = { + { "ng", "Neogit", desc = "Open Neogit" }, + }, + dependencies = { + "nvim-lua/plenary.nvim", -- required + "sindrets/diffview.nvim", -- optional - Diff integration + + -- Only one of these is needed. + "nvim-telescope/telescope.nvim", -- optional + }, + config = true, +} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/tools/better-ts-errors.lua b/modules/home/apps/tools/neovim/config/lua/plugins/tools/better-ts-errors.lua deleted file mode 100644 index a2559db..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/tools/better-ts-errors.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - "OlegGulevskyy/better-ts-errors.nvim", - dependencies = { "MunifTanjim/nui.nvim" }, - config = { - keymaps = { - toggle = "dd", -- default 'dd' - go_to_definition = "dx", -- default 'dx' - }, - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/tools/blame.lua b/modules/home/apps/tools/neovim/config/lua/plugins/tools/blame.lua deleted file mode 100644 index 8e28521..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/tools/blame.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - "FabijanZulj/blame.nvim", - config = function() - require("blame").setup() - end, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/tools/ccc.lua b/modules/home/apps/tools/neovim/config/lua/plugins/tools/ccc.lua deleted file mode 100644 index 20f4ab2..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/tools/ccc.lua +++ /dev/null @@ -1,13 +0,0 @@ -return { - "uga-rosa/ccc.nvim", - cmd = { - "CccPick", - "CccConvert", - "CccHighlighterEnable", - "CccHighlighterDisable", - "CccHighlighterToggle", - }, - opts = { - alpha_show = "show", - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/tools/clear-action.lua b/modules/home/apps/tools/neovim/config/lua/plugins/tools/clear-action.lua deleted file mode 100644 index a6f51c7..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/tools/clear-action.lua +++ /dev/null @@ -1,44 +0,0 @@ -local format = require("utils.icons").fmt - -return { - "luckasRanarison/clear-action.nvim", - event = "LspAttach", - opts = { - signs = { - show_count = false, - show_label = true, - combine = true, - }, - popup = { - hide_cursor = true, - }, - mappings = { - code_action = { "la", format("Fix", "Code action") }, - apply_first = { "aa", format("Fix", "Apply") }, - quickfix = { "aq", format("Fix", "Quickfix") }, - quickfix_next = { "an", format("Fix", "Quickfix next") }, - quickfix_prev = { "ap", format("Fix", "Quickfix prev") }, - refactor = { "ar", format("Fix", "Refactor") }, - refactor_inline = { "aR", format("Fix", "Refactor inline") }, - actions = { - ["rust_analyzer"] = { - ["Import"] = { "ai", format("Fix", "Import") }, - ["Replace if"] = { "am", format("Fix", "Replace if with match") }, - ["Fill match"] = { "af", format("Fix", "Fill match arms") }, - ["Wrap"] = { "aw", format("Fix", "Wrap") }, - ["Insert `mod"] = { "aM", format("Fix", "Insert mod") }, - ["Insert `pub"] = { "aP", format("Fix", "Insert pub mod") }, - ["Add braces"] = { "ab", format("Fix", "Add braces") }, - }, - }, - }, - quickfix_filters = { - ["rust_analyzer"] = { - ["E0412"] = "Import", - ["E0425"] = "Import", - ["E0433"] = "Import", - ["unused_imports"] = "remove", - }, - }, - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/tools/cloak.lua b/modules/home/apps/tools/neovim/config/lua/plugins/tools/cloak.lua deleted file mode 100644 index 47ec7c4..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/tools/cloak.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - { "laytan/cloak.nvim", lazy = false, opts = { cloak_length = 64 } }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/tools/conform.lua b/modules/home/apps/tools/neovim/config/lua/plugins/tools/conform.lua deleted file mode 100644 index 3e26682..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/tools/conform.lua +++ /dev/null @@ -1,28 +0,0 @@ -return { - "stevearc/conform.nvim", - event = { "BufReadPre", "BufNewFile" }, - opts = { - formatters_by_ft = { - javascript = { "prettierd" }, - typescript = { "prettierd" }, - javascriptreact = { "prettierd", "rustywind" }, - typescriptreact = { "prettierd", "rustywind" }, - svelte = { "prettierd", "rustywind" }, - astro = { "prettier", "rustywind" }, - css = { "prettierd" }, - html = { "prettierd" }, - json = { "prettierd" }, - yaml = { "prettierd" }, - markdown = { "prettierd" }, - graphql = { "prettierd" }, - lua = { "stylua" }, - python = { "black" }, - nix = { "alejandra" }, - }, - format_on_save = { - lsp_fallback = true, - async = false, - timeout_ms = 500, - }, - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/tools/crates.lua b/modules/home/apps/tools/neovim/config/lua/plugins/tools/crates.lua deleted file mode 100644 index 3a1d8d1..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/tools/crates.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - "saecki/crates.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - "jose-elias-alvarez/null-ls.nvim", - }, - event = { "BufRead Cargo.toml" }, - opts = { - null_ls = { - enabled = true, - name = "Crates", - }, - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/tools/curl.lua b/modules/home/apps/tools/neovim/config/lua/plugins/tools/curl.lua deleted file mode 100644 index 5c953c0..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/tools/curl.lua +++ /dev/null @@ -1,35 +0,0 @@ -return { - "oysandvik94/curl.nvim", - cmd = { "CurlOpen" }, - dependencies = { - "nvim-lua/plenary.nvim", - }, - keys = { - { "co", "CurlOpen", desc = "Open Curl" }, - }, - config = function() - local curl = require("curl") - curl.setup({}) - - vim.keymap.set("n", "co", function() - curl.open_global_tab() - end, { desc = "Open a curl tab with gloabl scope" }) - - -- These commands will prompt you for a name for your collection - vim.keymap.set("n", "csc", function() - curl.create_scoped_collection() - end, { desc = "Create or open a collection with a name from user input" }) - - vim.keymap.set("n", "cgc", function() - curl.create_global_collection() - end, { desc = "Create or open a global collection with a name from user input" }) - - vim.keymap.set("n", "fsc", function() - curl.pick_scoped_collection() - end, { desc = "Choose a scoped collection and open it" }) - - vim.keymap.set("n", "fgc", function() - curl.pick_global_collection() - end, { desc = "Choose a global collection and open it" }) - end, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/tools/document-color.lua b/modules/home/apps/tools/neovim/config/lua/plugins/tools/document-color.lua deleted file mode 100644 index b616084..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/tools/document-color.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - "mrshmllow/document-color.nvim", - lazy = true, - opts = {}, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/tools/flash.lua b/modules/home/apps/tools/neovim/config/lua/plugins/tools/flash.lua deleted file mode 100644 index d465fa1..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/tools/flash.lua +++ /dev/null @@ -1,18 +0,0 @@ -local lua = require("utils.mappings").lua - -return { - "folke/flash.nvim", - keys = { - { "f", mode = { "n", "v" } }, - { "F", mode = { "n", "v" } }, - { "t", mode = { "n", "v" } }, - { "T", mode = { "n", "v" } }, - - { "s", mode = { "n", "v" }, lua('require("flash").jump()') }, - { "ß", mode = "n", lua("require('flash').jump({ pattern = vim.fn.expand('') })") }, - { "S", mode = "n", lua("require('flash').treesitter()") }, - { "o", mode = "o", lua("require('flash').jump()"), desc = "Search jump" }, - { "O", mode = "o", lua("require('flash').treesitter()"), desc = "Tresitter jump" }, - }, - opts = {}, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/tools/neorg.lua b/modules/home/apps/tools/neovim/config/lua/plugins/tools/neorg.lua deleted file mode 100644 index 5788388..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/tools/neorg.lua +++ /dev/null @@ -1,39 +0,0 @@ -return { - -- { - -- "nvim-neorg/neorg", - -- dependencies = { "luarocks.nvim" }, - -- lazy = false, - -- version = "*", - -- config = function() - -- require("neorg").setup({ - -- load = { - -- ["core.defaults"] = {}, - -- ["core.concealer"] = {}, - -- ["core.dirman"] = { - -- config = { - -- workspaces = { - -- dev = "~/notes", - -- }, - -- default_workspace = "dev", - -- index = "index.norg", - -- }, - -- }, - -- ["core.completion"] = { - -- config = { - -- engine = "nvim-cmp", - -- }, - -- }, - -- ["core.keybinds"] = {}, - -- ["core.ui.calendar"] = {}, - -- ["core.export"] = {}, - -- ["core.looking-glass"] = {}, - -- ["core.qol.toc"] = {}, - -- ["core.qol.todo_items"] = {}, - -- ["core.esupports.hop"] = {}, - -- ["core.esupports.indent"] = {}, - -- ["core.summary"] = {}, - -- }, - -- }) - -- end, - -- }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/tools/nvim-devdocs.lua b/modules/home/apps/tools/neovim/config/lua/plugins/tools/nvim-devdocs.lua deleted file mode 100644 index f997972..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/tools/nvim-devdocs.lua +++ /dev/null @@ -1,52 +0,0 @@ -return { - -- "luckasRanarison/nvim-devdocs", - dir = "~/Projects/nvim-devdocs", - branch = "master", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-telescope/telescope.nvim", - "nvim-treesitter/nvim-treesitter", - }, - cmd = { - "DevdocsFetch", - "DevdocsInstall", - "DevdocsUninstall", - "DevdocsOpen", - "DevdocsOpenFloat", - "DevdocsOpenCurrent", - "DevdocsOpenCurrentFloat", - "DevdocsUpdate", - "DevdocsUpdateAll", - "DevdocsBuild", - }, - opts = { - format = "markdown", - filetypes = { - javascript = { "html", "javascript" }, - }, - -- use_node = false, - ensure_installed = { - -- "git", - -- "bash", - -- "rust", - -- "lua-5.4", - -- "html", - -- "css", - -- "javascript", - -- "typescript", - -- "react", - -- "web_extensions", - }, - wrap = true, - previewer_cmd = "glow", - cmd_args = { "-s", "auto", "-w", "97" }, - cmd_ignore = {}, - picker_cmd = true, - picker_cmd_args = { "-s", "auto", "-w", "45" }, - mappings = { - open_in_browser = "vb", - toggle_rendering = "vr", - }, - log_level = "debug", - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/tools/vim-dadbod.lua b/modules/home/apps/tools/neovim/config/lua/plugins/tools/vim-dadbod.lua deleted file mode 100644 index 2b6cdc8..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/tools/vim-dadbod.lua +++ /dev/null @@ -1,29 +0,0 @@ -return { - "kristijanhusak/vim-dadbod-ui", - dependencies = { - "tpope/vim-dadbod", - "kristijanhusak/vim-dadbod-completion", - }, - cmd = { - "DBUI", - "DBUIAddConnection", - "DBUIClose", - "DBUIToggle", - "DBUIFindBuffer", - "DBUIRenameBuffer", - "DBUILastQueryInfo", - }, - config = function() - vim.g.db_ui_notification_width = 1 - vim.g.db_ui_debug = 1 - - local cmp = require("cmp") - - cmp.setup.filetype({ "sql" }, { - sources = { - { name = "vim-dadbod-completion" }, - { name = "buffer" }, - }, - }) - end, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/ui/alpha.lua b/modules/home/apps/tools/neovim/config/lua/plugins/ui/alpha.lua deleted file mode 100644 index 8dfb471..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/ui/alpha.lua +++ /dev/null @@ -1,31 +0,0 @@ -local format = require("utils.icons").fmt - -return { - "goolord/alpha-nvim", - config = function() - local alpha = require("alpha") - local dashboard = require("alpha.themes.dashboard") - dashboard.section.header.val = { - [[ ]], - [[ î‚ē ]], - [[ î‚ē████ î‚ē██████î‚ŧ █████ ██î‚ŧ ]], - [[ î‚ē███████████î‚ŧ █████  ]], - [[ î‚ē█████████î‚ŧ î‚ē████████î‚ŧî‚ē███████████ ███ î‚ē███████████ ]], - [[ î‚ē█████████î‚ŧ î‚ē███î‚ŧ î‚ē█████████████ █████ ██████████████ ]], - [[ î‚ē█████████î‚ŧ î‚ē████████î‚ŧî‚ē██î‚ŧ █████████ █████ █████ ████ █████ ]], - [[ î‚ē██████î‚ŧ█████î‚ŧ î‚ē███î‚ŧ î‚ē███ î‚ē█████████ █████ █████ ████ █████ ]], - [[ î‚ē██████î‚ŧ ███î‚ŧî‚ē██████████████████î‚ŧ ████î‚ŧ █████ █████ ████ ██████ ]], - [[ ]], - } - dashboard.section.buttons.val = { - dashboard.button("n", format("NewFile", "New file", 2), ":ene startinsert "), - dashboard.button("f", format("Search", "Find file", 2), ":Telescope find_files"), - dashboard.button("l", format("History", "Recents", 2), ":SessionManager load_session"), - dashboard.button("L", format("FolderOpened", "Last session", 2), ":SessionManager load_last_session"), - dashboard.button("q", format("Exit", "Quit", 2), ":qa"), - } - dashboard.config.layout[1].val = vim.fn.max({ 2, vim.fn.floor(vim.fn.winheight(0) * 0.2) }) - dashboard.config.layout[3].val = 2 - alpha.setup(dashboard.config) - end, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/ui/bufferline.lua b/modules/home/apps/tools/neovim/config/lua/plugins/ui/bufferline.lua deleted file mode 100644 index 0fa5b59..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/ui/bufferline.lua +++ /dev/null @@ -1,58 +0,0 @@ -local format = require("utils.icons").fmt - -return { - "akinsho/bufferline.nvim", - event = { "BufReadPost", "BufNewFile" }, - dependencies = "nvim-tree/nvim-web-devicons", - after = "catppuccin", - opts = { - options = { - diagnostics = "nvim_lsp", - diagnostics_update_in_insert = true, - diagnostics_indicator = nil, - indicator = "none", - offsets = { - { - filetype = "neo-tree", - text = format("Folder", "NeoTree"), - text_align = "left", - separator = "│", - }, - { - filetype = "dapui_watches", - text = format("Debugger", "DapUI"), - text_align = "left", - separator = "│", - }, - { - filetype = "dbui", - text = format("Database", "DbUI"), - text_align = "left", - separator = "│", - }, - }, - }, - }, - config = function(_, opts) - -- local colors = require("tokyonight.colors") - -- - -- vim.opt.showtabline = 2 - -- opts.highlights = { - -- background = { bg = colors.night.bg }, - -- close_button = { bg = colors.night.bg }, - -- separator = { fg = colors.night.bg, bg = colors.night.bg }, - -- offset_separator = { bg = colors.night.bg }, - -- pick = { bg = colors.night.bg }, - -- } - - local mocha = require("catppuccin.palettes").get_palette("mocha") - - opts = { - highlights = require("catppuccin.groups.integrations.bufferline").get({ - styles = { "italic", "bold" }, - }), - } - - require("bufferline").setup(opts) - end, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/ui/catppuccin.lua b/modules/home/apps/tools/neovim/config/lua/plugins/ui/catppuccin.lua deleted file mode 100644 index 283ba6f..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/ui/catppuccin.lua +++ /dev/null @@ -1,86 +0,0 @@ -return { - "catppuccin/nvim", - name = "catppuccin", - init = function() - vim.cmd.colorscheme("catppuccin-macchiato") - end, - opts = { - transparent_background = false, - custom_highlights = function(C) - return { - Pmenu = { bg = C.base }, - CmpItemKindSnippet = { fg = C.base, bg = C.mauve }, - CmpItemKindKeyword = { fg = C.base, bg = C.red }, - CmpItemKindText = { fg = C.base, bg = C.teal }, - CmpItemKindMethod = { fg = C.base, bg = C.blue }, - CmpItemKindConstructor = { fg = C.base, bg = C.blue }, - CmpItemKindFunction = { fg = C.base, bg = C.blue }, - CmpItemKindFolder = { fg = C.base, bg = C.blue }, - CmpItemKindModule = { fg = C.base, bg = C.blue }, - CmpItemKindConstant = { fg = C.base, bg = C.peach }, - CmpItemKindField = { fg = C.base, bg = C.green }, - CmpItemKindProperty = { fg = C.base, bg = C.green }, - CmpItemKindEnum = { fg = C.base, bg = C.green }, - CmpItemKindUnit = { fg = C.base, bg = C.green }, - CmpItemKindClass = { fg = C.base, bg = C.yellow }, - CmpItemKindVariable = { fg = C.base, bg = C.flamingo }, - CmpItemKindFile = { fg = C.base, bg = C.blue }, - CmpItemKindInterface = { fg = C.base, bg = C.yellow }, - CmpItemKindColor = { fg = C.base, bg = C.red }, - CmpItemKindReference = { fg = C.base, bg = C.red }, - CmpItemKindEnumMember = { fg = C.base, bg = C.red }, - CmpItemKindStruct = { fg = C.base, bg = C.blue }, - CmpItemKindValue = { fg = C.base, bg = C.peach }, - CmpItemKindEvent = { fg = C.base, bg = C.blue }, - CmpItemKindOperator = { fg = C.base, bg = C.blue }, - CmpItemKindTypeParameter = { fg = C.base, bg = C.blue }, - CmpItemKindCopilot = { fg = C.base, bg = C.teal }, - TelescopeBorder = { fg = C.base, bg = C.base }, - TelescopeNormal = { bg = C.base }, - TelescopePreviewBorder = { fg = C.base, bg = C.base }, - TelescopePreviewNormal = { bg = C.base }, - TelescopePreviewTitle = { fg = C.base, bg = C.green }, - TelescopePromptBorder = { fg = C.surface0, bg = C.surface0 }, - TelescopePromptNormal = { fg = C.blue, bg = C.surface0 }, - TelescopePromptPrefix = { fg = C.red, bg = C.surface0 }, - TelescopePromptTitle = { fg = C.base, bg = C.red }, - TelescopeResultsBorder = { fg = C.base, bg = C.base }, - TelescopeResultsNormal = { bg = C.base }, - TelescopeResultsTitle = { fg = C.base, bg = C.base }, - } - end, - flavor = "mocha", - integrations = { - cmp = true, - noice = true, - treesitter = true, - neotree = true, - overseer = true, - notify = true, - telescope = { - enabled = true, - style = "nvchad", - }, - which_key = true, - native_lsp = { - enabled = true, - virtual_text = { - errors = { "italic" }, - hints = { "italic" }, - warnings = { "italic" }, - information = { "italic" }, - }, - underlines = { - errors = { "underline" }, - hints = { "underline" }, - warnings = { "underline" }, - information = { "underline" }, - }, - inlay_hints = { - background = true, - }, - }, - }, - }, - priority = 1000, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/ui/dressing.lua b/modules/home/apps/tools/neovim/config/lua/plugins/ui/dressing.lua deleted file mode 100644 index 9b9eee4..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/ui/dressing.lua +++ /dev/null @@ -1,22 +0,0 @@ -return { - "stevearc/dressing.nvim", - event = "VeryLazy", - config = function() - local theme = require("telescope.themes").get_dropdown() - - theme.layout_config = { - width = 60, - height = 17, - } - - require("dressing").setup({ - input = { - enabled = false, - }, - select = { - backend = { "telescope" }, - telescope = theme, - }, - }) - end, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/ui/dropbar.lua b/modules/home/apps/tools/neovim/config/lua/plugins/ui/dropbar.lua deleted file mode 100644 index 7e383e2..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/ui/dropbar.lua +++ /dev/null @@ -1,18 +0,0 @@ -return { - { - "Bekaboo/dropbar.nvim", - event = { "BufRead", "BufNewFile" }, - opts = { - icons = { - enable = true, - kinds = { - use_devicons = false, - symbols = { - File = "", - Folder = "", - }, - }, - }, - }, - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/ui/icons.lua b/modules/home/apps/tools/neovim/config/lua/plugins/ui/icons.lua deleted file mode 100644 index dfef8fc..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/ui/icons.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - "rachartier/tiny-devicons-auto-colors.nvim", - dependencies = { - "nvim-tree/nvim-web-devicons", - }, - event = "VeryLazy", - config = function() - require("tiny-devicons-auto-colors").setup() - end, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/ui/indent-blankline.lua b/modules/home/apps/tools/neovim/config/lua/plugins/ui/indent-blankline.lua deleted file mode 100644 index 242a0cd..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/ui/indent-blankline.lua +++ /dev/null @@ -1,41 +0,0 @@ -return { - "lukas-reineke/indent-blankline.nvim", - event = { "BufReadPost", "BufNewFile" }, - main = "ibl", - opts = { - exclude = { - buftypes = { - "nofile", - "terminal", - }, - filetypes = { - "help", - "startify", - "aerial", - "alpha", - "dashboard", - "lazy", - "neogitstatus", - "neo-tree", - "Trouble", - "dbout", - "TelescopePrompt", - }, - }, - scope = { - show_start = false, - show_end = false, - highlight = { "@keyword" }, - char = "▏", - include = { - node_type = { - lua = { "table_constructor" }, - }, - }, - }, - whitespace = { - remove_blankline_trail = true, - }, - indent = { char = "▏" }, - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/ui/lualine.lua b/modules/home/apps/tools/neovim/config/lua/plugins/ui/lualine.lua deleted file mode 100644 index 86bbd97..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/ui/lualine.lua +++ /dev/null @@ -1,26 +0,0 @@ -local sources = require("plugins.utils.lualine_sources") - -return { - "nvim-lualine/lualine.nvim", - event = { "BufReadPost", "BufNewFile" }, - dependencies = { "nvim-tree/nvim-web-devicons", "folke/noice.nvim" }, - config = function(_, opts) - opts.options.theme = "catppuccin" - - require("lualine").setup(opts) - end, - opts = { - options = { - component_separators = { left = "", right = "" }, - section_separators = { left = "", right = "" }, - }, - sections = { - lualine_a = { sources.mode }, - lualine_b = { sources.branch, sources.diff }, - lualine_c = { sources.filetype, sources.macro }, - lualine_x = { sources.lsp, sources.diagnostics }, - lualine_y = { sources.indentation, sources.encoding, sources.fileformat }, - lualine_z = { sources.progress, sources.location }, - }, - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/ui/neo-tree.lua b/modules/home/apps/tools/neovim/config/lua/plugins/ui/neo-tree.lua deleted file mode 100644 index cf1a43e..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/ui/neo-tree.lua +++ /dev/null @@ -1,84 +0,0 @@ -local icons = require("utils.icons").icons - -return { - { - "nvim-neo-tree/neo-tree.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - "MunifTanjim/nui.nvim", - "nvim-tree/nvim-web-devicons", - "luckasRanarison/neo-rename.nvim", - }, - cmd = "Neotree", - opts = { - enable_git_status = true, - close_if_last_window = true, - auto_clean_after_session_restore = true, - window = { - width = 30, - mappings = { - [""] = false, - ["s"] = false, - ["l"] = "open", - ["v"] = "open_vsplit", - ["gA"] = "git_add_all", - ["ga"] = "git_add_file", - ["gu"] = "git_unstage_file", - ["gr"] = "git_revert_file", - }, - }, - filesystem = { - follow_current_file = { enabled = true }, - hijack_netrw_behavior = "open_current", - use_libuv_file_watcher = true, - }, - default_component_configs = { - icon = { - folder_empty = icons.EmptyFolder, - default = icons.DefaultFile, - }, - indent = { - padding = 0, - indent_size = 1, - }, - modified = { - symbol = icons.SmallDot, - }, - name = { - use_git_status_colors = true, - }, - git_status = { - symbols = { - deleted = "D", - renamed = "R", - modified = "M", - added = "A", - untracked = "U", - ignored = "", - staged = "", - unstaged = "!", - conflict = "C", - }, - }, - diagnostics = { - symbols = { - hint = icons.Hint, - info = icons.Info, - warn = icons.Warn, - error = icons.Error, - }, - highlights = { - hint = "DiagnosticSignHint", - info = "DiagnosticSignInfo", - warn = "DiagnosticSignWarn", - error = "DiagnosticSignError", - }, - }, - }, - }, - config = function(_, opts) - require("neo-tree").setup(opts) - require("neo-rename").setup() - end, - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/ui/noice.lua b/modules/home/apps/tools/neovim/config/lua/plugins/ui/noice.lua deleted file mode 100644 index f5a6f35..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/ui/noice.lua +++ /dev/null @@ -1,34 +0,0 @@ -local icons = require("utils.icons").icons - -return { - "folke/noice.nvim", - event = "VeryLazy", - dependencies = { - "MunifTanjim/nui.nvim", - { "rcarriga/nvim-notify" }, - }, - opts = { - cmdline = { - format = { - cmdline = { pattern = "^:", icon = icons.Command, lang = "vim" }, - }, - }, - lsp = { - override = { - ["vim.lsp.util.convert_input_to_markdown_lines"] = true, - ["vim.lsp.util.stylize_markdown"] = true, - ["cmp.entry.get_documentation"] = true, - }, - hover = { - silent = true, - }, - }, - presets = { - bottom_search = false, - command_palette = true, - long_message_to_split = true, - inc_rename = false, - lsp_doc_border = "rounded", - }, - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/ui/which-key.lua b/modules/home/apps/tools/neovim/config/lua/plugins/ui/which-key.lua deleted file mode 100644 index 735102e..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/ui/which-key.lua +++ /dev/null @@ -1,37 +0,0 @@ -local format = require("utils.icons").fmt - -return { - "folke/which-key.nvim", - event = "VeryLazy", - init = function() - require("which-key").add({ - { "C", group = format("Package", "Crates") }, - { "D", group = format("Database", "DbUI") }, - { "S", group = format("FolderClock", "Session") }, - { "a", group = format("Fix", "Actions") }, - { "b", group = format("Windows", "Buffers") }, - { "c", group = format("Color", "Color") }, - { "d", group = format("Debugger", "Debugger") }, - { "f", group = format("Search", "Telescope") }, - { "g", group = format("Git", "Git") }, - { "l", group = format("Braces", "LSP") }, - { "n", group = format("Notification", "Notification") }, - { "o", group = format("DropDown", "Dropbar") }, - { "r", group = format("Code", "SnipRun") }, - { "t", group = format("Terminal", "Terminal") }, - { "u", group = format("Windows", "UI") }, - { "v", group = format("Book", "DevDocs") }, - }) - end, - opts = { - replace = { - [""] = " ", - }, - icons = { - group = "", - }, - win = { - border = "rounded", - }, - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/plugins/utils/lualine_sources.lua b/modules/home/apps/tools/neovim/config/lua/plugins/utils/lualine_sources.lua deleted file mode 100644 index 53790db..0000000 --- a/modules/home/apps/tools/neovim/config/lua/plugins/utils/lualine_sources.lua +++ /dev/null @@ -1,169 +0,0 @@ -local icons = require("utils.icons").icons -local fmt = require("utils.icons").fmt -local M = {} - -M.mode = { - "mode", - fmt = function(name) - local map = { - NORMAL = icons.Normal, - INSERT = icons.Insert, - TERMINAL = icons.Terminal, - VISUAL = icons.Visual, - ["V-LINE"] = icons.Visual, - ["V-BLOCK"] = icons.Visual, - ["O-PENDING"] = icons.Ellipsis, - COMMAND = icons.Command, - REPLACE = icons.Edit, - SELECT = icons.Visual, - } - local icon = map[name] and map[name] or icons.Vim - return icon .. " " .. name - end, - color = function() - local colors = require("catppuccin.palettes").get_palette() - local mode = vim.fn.mode() - local map = { - n = colors.sapphire, - i = colors.green, - c = colors.yellow, - t = colors.mauve, - R = colors.maroon, - v = colors.lavender, - V = colors.lavender, - s = colors.sky, - S = colors.sky, - } - return { - fg = colors.base, - bg = map[mode] or colors.blue, - } - end, -} - -M.branch = { - "branch", - icon = icons.GitBranch, - color = function() - local colors = require("catppuccin.palettes").get_palette() - - return { bg = nil } - end, -} - -M.diff = { - "diff", - symbols = { - added = fmt("Add", ""), - modified = fmt("Modified", ""), - removed = fmt("Removed", ""), - }, - color = function() - local colors = require("catppuccin.palettes").get_palette() - return { bg = colors.base } - end, -} - -M.filetype = { "filetype" } - -M.diagnostics = { - "diagnostics", - color = function() - local colors = require("catppuccin.palettes").get_palette() - return { bg = colors.base } - end, -} - -M.encoding = { - "encoding", - color = function() - local colors = require("catppuccin.palettes").get_palette() - return { fg = colors.blue, bg = colors.base } - end, -} - -M.fileformat = { - "fileformat", - color = function() - local colors = require("catppuccin.palettes").get_palette() - return { fg = colors.blue, bg = colors.base } - end, -} - -M.indentation = { - "indentation", - fmt = function() - local type = vim.bo[0].expandtab and "spaces" or "tabs" - local value = vim.bo[0].shiftwidth - return type .. ": " .. value - end, - color = function() - local colors = require("catppuccin.palettes").get_palette() - return { fg = colors.blue, bg = colors.base } - end, -} - -M.progress = { - "progress", - fmt = function(location) - return vim.trim(location) - end, - color = function() - local colors = require("catppuccin.palettes").get_palette() - return { fg = colors.lavender, bg = colors.base } - end, -} - -M.location = { - "location", - fmt = function(location) - return vim.trim(location) - end, - color = function() - local colors = require("catppuccin.palettes").get_palette() - return { fg = colors.lavender, bg = colors.base } - end, -} - -M.macro = { - function() - return vim.fn.reg_recording() - end, - icon = icons.Recording, - color = function() - local colors = require("catppuccin.palettes").get_palette() - return { fg = colors.red, bg = colors.base } - end, -} - -M.lsp = { - function() - local bufnr = vim.api.nvim_get_current_buf() - local clients = vim.lsp.get_clients({ bufnr = bufnr }) - if next(clients) == nil then - return "" - end - local attached_clients = vim.tbl_map(function(client) - return client.name - end, clients) - return table.concat(attached_clients, ", ") - end, - icon = icons.Braces, - color = function() - local colors = require("catppuccin.palettes").get_palette() - return { fg = colors.overlay0, bg = colors.base } - end, -} - -M.gap = { - function() - return " " - end, - color = function() - local colors = require("catppuccin.palettes").get_palette() - return { bg = colors.base } - end, - padding = 0, -} - -return M diff --git a/modules/home/apps/tools/neovim/config/lua/utils/configurer.lua b/modules/home/apps/tools/neovim/config/lua/utils/configurer.lua deleted file mode 100644 index a892b5d..0000000 --- a/modules/home/apps/tools/neovim/config/lua/utils/configurer.lua +++ /dev/null @@ -1,48 +0,0 @@ -local M = {} - -local set_options = function(options) - for prop, variables in pairs(options) do - for key, value in pairs(variables) do - vim[prop][key] = value - end - end -end - -local set_keymaps = function(keymaps) - for mode, maps in pairs(keymaps) do - for key, map in pairs(maps) do - vim.keymap.set(mode, key, map[1], { desc = map[2] }) - end - end -end - -local set_autocmd = function(autocmd) - for _, cmd in ipairs(autocmd) do - vim.api.nvim_create_autocmd(cmd.event, cmd.opts) - end -end - -local set_signs = function(signs) - for _, sign in ipairs(signs) do - vim.fn.sign_define(sign.name, sign) - end -end - -local init_lazy = function(spec) - local opts = { - ui = { border = "rounded" }, - spec = { import = spec }, - } - - require("lazy").setup(opts) -end - -M.setup = function(opts) - set_options(opts.options or {}) - set_keymaps(opts.keymaps or {}) - set_autocmd(opts.autocmd or {}) - set_signs(opts.signs or {}) - init_lazy(opts.spec) -end - -return M diff --git a/modules/home/apps/tools/neovim/config/lua/utils/functions.lua b/modules/home/apps/tools/neovim/config/lua/utils/functions.lua deleted file mode 100644 index 59d3137..0000000 --- a/modules/home/apps/tools/neovim/config/lua/utils/functions.lua +++ /dev/null @@ -1,170 +0,0 @@ -local M = {} - -local input = function(prompt, callback) - local value = vim.fn.input(prompt) - if value:len() ~= 0 then - callback(value) - end -end - -local select = function(prompt, callback) - vim.ui.select({ "tabs", "spaces" }, { - prompt = prompt, - }, function(choice) - if choice then - callback(choice) - end - end) -end - -M.freeze = function() - local path = "./._freeze.png" - - vim.cmd("Freeze") - - -- Run the shell command 'wl-copy ' after 'Freeze' completes - vim.fn.system("wl-copy < " .. path) - vim.fn.system("rm " .. path) -end - -M.freeze_selection = function() - local path = "./._freeze.png" - - vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("", false, true, true), "nx", false) - -- Retrieve buffer ID for the current buffer - local buf = vim.api.nvim_get_current_buf() - - -- Get positions of the start ('<') and end ('>') of the visual selection - local start_pos = vim.api.nvim_buf_get_mark(buf, "<") - local end_pos = vim.api.nvim_buf_get_mark(buf, ">") - - -- Retrieve the line numbers from the positions - local start_line = start_pos[1] - local end_line = end_pos[1] - - -- Execute the 'Freeze' command on the selected range - vim.cmd(start_line .. "," .. end_line .. "Freeze") - - -- Run the shell command 'wl-copy ' after 'Freeze' completes - vim.fn.system("wl-copy < " .. path) - vim.fn.system("rm " .. path) -end - -M.set_filetype = function() - input("Set filetype: ", function(value) - vim.bo[0].filetype = value - vim.notify("Filetype set to " .. value) - end) -end - -M.set_indent = function() - input("Set indentation: ", function(value) - local type = vim.bo[0].expandtab and "spaces" or "tabs" - local parsed = tonumber(value) - - if parsed then - vim.bo[0].shiftwidth = parsed - vim.notify("Indentation set to " .. value .. " " .. type) - else - vim.notify("Invalid value", vim.log.levels.ERROR) - end - end) -end - -M.set_indent_type = function() - select("Indent using: ", function(choice) - if choice == "spaces" then - vim.o.expandtab = true - else - vim.o.expandtab = false - end - - vim.notify("Indentation using " .. choice) - end) -end - -M.toggle_wrap = function() - vim.wo.wrap = not vim.wo.wrap - vim.wo.linebreak = not vim.wo.linebreak -end - -M.comment_line = function() - require("Comment.api").toggle.linewise.count(vim.v.count > 0 and vim.v.count or 1) -end - -M.comment_selection = function() - vim.cmd("normal ") - require("Comment.api").toggle.linewise(vim.fn.visualmode()) -end - -M.first_buffer = function() - require("bufferline").go_to(1) -end -M.last_buffer = function() - require("bufferline").go_to(-1) -end - -M.buf_hsplit = function() - require("bufferline.pick").choose_then(function(id) - local name = vim.api.nvim_buf_get_name(id) - vim.cmd("sp" .. name) - vim.cmd("wincmd x") - vim.cmd("wincmd w") - end) -end - -M.buf_vsplit = function() - require("bufferline.pick").choose_then(function(id) - local name = vim.api.nvim_buf_get_name(id) - vim.cmd("vsp" .. name) - vim.cmd("wincmd x") - vim.cmd("wincmd w") - end) -end - -M.open_lazygit = function() - require("toggleterm.terminal").Terminal - :new({ - cmd = "lazygit", - hidden = true, - float_opts = { - width = 100, - height = 25, - }, - on_close = function() - if package.loaded["neo-tree"] then - require("neo-tree.events").fire_event("git_event") - end - end, - }) - :open() -end - -M.open_glow = function() - require("toggleterm.terminal").Terminal - :new({ - cmd = "glow", - hidden = true, - float_opts = { - width = 100, - height = 25, - }, - }) - :open() -end - -M.open_dapui = function() - require("neo-tree").close_all() - require("dapui").open() -end - -M.close_dapui = function() - require("dapui").close() -end - -M.toggle_dapui = function() - vim.cmd("NeoTreeShowToggle") - require("dapui").toggle() -end - -return M diff --git a/modules/home/apps/tools/neovim/config/lua/utils/icons.lua b/modules/home/apps/tools/neovim/config/lua/utils/icons.lua deleted file mode 100644 index 78a19f2..0000000 --- a/modules/home/apps/tools/neovim/config/lua/utils/icons.lua +++ /dev/null @@ -1,113 +0,0 @@ -local M = {} - -M.icons = { - Vim = "", - Config = "", - Normal = "ķ°Ą›", - Insert = "ķ°ŒŒ", - Terminal = "", - Visual = "ķ°‰¸", - Command = "", - Save = "ķ°ŗģ", - NotSaved = "ķą™ƒ", - Restore = "", - Trash = "ī’Ž", - Fedora = "", - Lua = "", - Github = "ī‚›", - Git = "ķ°Šĸ", - GitDiff = "îĢĄ", - GitBranch = "îœĨ", - GitCommit = "", - Add = "ķ°•", - Modified = "ķ°œĨ", - Removed = "ķ°´", - DiffRemoved = "î̟", - Error = "ķ°…š", - Info = "ķ°‹Ŋ", - Warn = "îŠŦ", - Hint = "", - Package = "ķ°–", - FileTree = "ķ°™…", - Folder = "īģ", - EmptyFolder = "", - FolderClock = "ķ°Ēģ", - FolderOpened = "î̎", - File = "ī…›", - NewFile = "îŠŋ", - DefaultFile = "ķ°ˆ™", - Color = "", - ColorPicker = "ķ°´ą", - ColorOn = "ķ°Œ", - ColorOff = "ķ°šŠ", - Swap = "ķ°“Ą", - Minimap = "", - Window = "î­ŋ", - Windows = "îŦŖ", - Ellipsis = "â€Ļ", - Search = "", - TextSearch = "ķąŠž", - TabSearch = "ķąĻž", - FileSearch = "ķ°ąŧ", - Clear = "îĒŋ", - Braces = "ķ°…Š", - Exit = "", - Debugger = "", - Breakpoint = "īŠŽ", - History = "îĒ‚", - Check = "ķ°„ĩ", - SmallDot = "ķ°§ž", - Dots = "ķ°‡˜", - Install = "", - Help = "ķ°‹–", - Clipboard = "ķ°…Œ", - Indent = "ī€ŧ", - LineWrap = "ķ°–ļ", - Comment = "ķą‹„", - Close = "ķ°…˜", - Open = "ķ°‹", - Toggle = "ķ°”Ą", - Stop = "īŠ", - Restart = "îĢ’", - CloseMultiple = "ķ°ąž", - NextBuffer = "ķ°Žą,", - PrevBuffer = "ķ°Žŗ", - FoldClose = "ī“š", - FoldOpen = "ī“™", - Popup = "ķ°•›", - Vertical = "", - Horizontal = "", - Markdown = "ķ°Ŋ›", - Up = "", - Down = "īƒ—", - Left = "īƒ™", - Right = "", - Variable = "îLj", - Symbol = "", - Stack = "ī”ž", - Format = "ķ°‰Ŗ", - Edit = "ķ°¤Œ", - Fix = "î­Ĩ", - Run = "ķ°", - Twilight = "ķ°–š", - Recording = "ķ°‘‹", - Notification = "ķ°ĸ", - NotificationDismiss = "ķą™", - NotificationLog = "ķ°Š", - Code = "ī„Ą", - DropDown = "ķ°Š", - Web = "ķ°–Ÿ", - Dependencies = "", - Update = "ķ°š°", - Database = "", - Pin = "īĩ", - Book = "ķ°‚Ŋ", - BookmarkSearch = "ķ°ē„", - Download = "ķ°‡š", -} - -M.fmt = function(icon, text, space) - return M.icons[icon] .. string.rep(" ", space or 1) .. text -end - -return M diff --git a/modules/home/apps/tools/neovim/config/lua/utils/mappings.lua b/modules/home/apps/tools/neovim/config/lua/utils/mappings.lua deleted file mode 100644 index 044f6a6..0000000 --- a/modules/home/apps/tools/neovim/config/lua/utils/mappings.lua +++ /dev/null @@ -1,19 +0,0 @@ -local M = {} - -M.leader = function(key) - return "" .. key -end -M.cmd = function(cmd) - return "" .. cmd .. "" -end -M.rcmd = function(cmd) - return ":" .. cmd .. "" -end -M.lua = function(cmd) - return "lua " .. cmd .. "" -end -M.notify = function(cmd) - return M.cmd("call VSCodeNotify('" .. cmd .. "')") -end - -return M diff --git a/modules/home/apps/tools/neovim/config/lua/utils/win.lua b/modules/home/apps/tools/neovim/config/lua/utils/win.lua deleted file mode 100644 index b3d2f20..0000000 --- a/modules/home/apps/tools/neovim/config/lua/utils/win.lua +++ /dev/null @@ -1,61 +0,0 @@ -local M = {} - -local make_float_config = function(minimal) - local ui = vim.api.nvim_list_uis()[1] - local width = 80 - local height = 25 - local row = (ui.height - height) * 0.4 - local col = (ui.width - width) * 0.5 - - return { - col = col, - row = row, - width = width, - height = height, - border = "rounded", - relative = "editor", - style = minimal and "minimal" or nil, - zindex = 10, - } -end - -M.open_help_float = function() - local win = vim.api.nvim_get_current_win() - local buf = vim.api.nvim_win_get_buf(win) - local config = make_float_config(true) - - vim.api.nvim_win_set_config(win, config) - vim.api.nvim_create_autocmd("WinClosed", { - pattern = tostring(win), - callback = function() - vim.api.nvim_buf_delete(buf, {}) - end, - }) -end - -M.open_lua_win = function() - local buf = vim.api.nvim_create_buf(true, false) - local config = make_float_config(false) - local temp = vim.fn.tempname() - local win = vim.api.nvim_open_win(buf, true, config) - - vim.bo[buf].ft = "lua" - vim.api.nvim_buf_set_name(buf, temp) - vim.cmd("silent w") - - vim.keymap.set("n", "w", function() - vim.cmd("w") - vim.cmd("luafile %") - vim.lsp.buf.format({ async = true }) - end, { buffer = buf, remap = true, silent = true }) - - vim.api.nvim_create_autocmd("WinClosed", { - pattern = tostring(win), - callback = function() - vim.fn.delete(temp) - vim.api.nvim_buf_delete(buf, { force = true }) - end, - }) -end - -return M diff --git a/modules/home/apps/tools/neovim/config/lua/vscode/keymaps.lua b/modules/home/apps/tools/neovim/config/lua/vscode/keymaps.lua deleted file mode 100644 index 461569c..0000000 --- a/modules/home/apps/tools/neovim/config/lua/vscode/keymaps.lua +++ /dev/null @@ -1,50 +0,0 @@ -local map = require("utils.mappings") -local l, cmd, rcmd, notify = map.leader, map.cmd, map.rcmd, map.notify - -return { - n = { - -- utils - [l("p")] = { '"+p' }, - [l("P")] = { '"+P' }, - [l(":")] = { ":lua " }, - - [l("us")] = { cmd("nohlsearch") }, - [l(";")] = { cmd("VSCodeCommentary") }, - - -- vscode actions - [l("w")] = { notify("workbench.action.files.save") }, - [l("e")] = { notify("workbench.view.explorer") }, - [l("bq")] = { notify("workbench.action.closeActiveEditor") }, - [l("bn")] = { notify("workbench.action.nextEditorInGroup") }, - [l("bp")] = { notify("workbench.action.previousEditorInGroup") }, - [l("um")] = { notify("editor.action.toggleMinimap") }, - [l("ff")] = { notify("workbench.action.quickOpen") }, - [l("fs")] = { notify("workbench.action.gotoSymbol") }, - [l("nn")] = { notify("notifications.clearAll") }, - [l("nl")] = { notify("notifications.showList") }, - - ["gr"] = { notify("editor.action.goToReferences") }, - [l("lr")] = { notify("editor.action.rename") }, - - -- move.nvim - [""] = { cmd("MoveLine(1)") }, - [""] = { cmd("MoveLine(-1)") }, - [""] = { cmd("MoveHChar(-1)") }, - [""] = { cmd("MoveHChar(1)") }, - }, - v = { - -- utils - ["q"] = { "" }, - [l("y")] = { '"+y' }, - [l("p")] = { '"+p' }, - [l("P")] = { '"+P' }, - - [l(";")] = { cmd("VSCodeCommentary") }, - - -- move.nvim - [""] = { rcmd("MoveBlock(1)") }, - [""] = { rcmd("MoveBlock(-1)") }, - [""] = { rcmd("MoveHBlock(-1)") }, - [""] = { rcmd("MoveHBlock(1)") }, - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/vscode/options.lua b/modules/home/apps/tools/neovim/config/lua/vscode/options.lua deleted file mode 100644 index 1ce3a71..0000000 --- a/modules/home/apps/tools/neovim/config/lua/vscode/options.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - g = { - mapleader = " ", - }, -} diff --git a/modules/home/apps/tools/neovim/config/lua/vscode/plugins.lua b/modules/home/apps/tools/neovim/config/lua/vscode/plugins.lua deleted file mode 100644 index 97bda15..0000000 --- a/modules/home/apps/tools/neovim/config/lua/vscode/plugins.lua +++ /dev/null @@ -1,38 +0,0 @@ -local lua = require("utils.mappings").lua - -return { - { - "kylechui/nvim-surround", - keys = { - { "cs", mode = { "n" } }, - { "ds", mode = { "n" } }, - { "ys", mode = { "n" } }, - { "S", mode = { "v" } }, - }, - opts = {}, - }, - { - "fedepujol/move.nvim", - cmd = { - "MoveLine", - "MoveHChar", - "MoveBlock", - "MoveHBlock", - }, - }, - { - "folke/flash.nvim", - keys = { - { "f", mode = { "n", "v" } }, - { "F", mode = { "n", "v" } }, - { "t", mode = { "n", "v" } }, - { "T", mode = { "n", "v" } }, - { "s", mode = { "n", "v" }, lua('require("flash").jump()') }, - { "ß", mode = "n", lua("require('flash').jump({ pattern = vim.fn.expand('') })") }, - { "S", mode = "n", lua("require('flash').treesitter()") }, - { "o", mode = "o", lua("require('flash').jump()"), desc = "Search jump" }, - { "O", mode = "o", lua("require('flash').treesitter()"), desc = "Tresitter jump" }, - }, - opts = {}, - }, -} diff --git a/modules/home/apps/tools/neovim/config/stylua.toml b/modules/home/apps/tools/neovim/config/stylua.toml new file mode 100644 index 0000000..5d6c50d --- /dev/null +++ b/modules/home/apps/tools/neovim/config/stylua.toml @@ -0,0 +1,3 @@ +indent_type = "Spaces" +indent_width = 2 +column_width = 120 \ No newline at end of file diff --git a/modules/home/apps/tools/neovim/default.nix b/modules/home/apps/tools/neovim/default.nix index 639cd16..e979073 100644 --- a/modules/home/apps/tools/neovim/default.nix +++ b/modules/home/apps/tools/neovim/default.nix @@ -41,23 +41,36 @@ in { package = inputs.neovim-nightly-overlay.packages.${pkgs.system}.default; extraPackages = with pkgs; [ # Formatters + alejandra # Nix black # Python prettierd # Multi-language shfmt - shellcheck isort + stylua rustywind # LSP - # vscode-langservers-extracted + lua-language-server + nixd + rust-analyzer + vscode-langservers-extracted nodePackages.vscode-json-languageserver nodePackages.typescript-language-server + #nodePackages.astro-language-server + nodePackages.bash-language-server + nodePackages.svelte-language-server + tailwindcss-language-server + taplo + docker-compose-language-service + dockerfile-language-server-nodejs + haskellPackages.hadolint + shellcheck + markdownlint-cli2 + shfmt + sqlfluff + tailwindcss-language-server clang - pkgs-unstable.bash-language-server - - curl - jq # Tools git @@ -119,54 +132,7 @@ in { end vim.opt.rtp:prepend(lazypath) - local filetypes = require("core.filetypes") - local configurer = require("utils.configurer") - local opts = {} - - if vim.g.vscode then - -- VSCode Neovim - opts.spec = "vscode.plugins" - opts.options = require("vscode.options") - opts.keymaps = require("vscode.keymaps") - else - -- Normal Neovim - opts.spec = "plugins" - opts.options = require("core.options") - opts.keymaps = require("core.keymaps") - opts.autocmd = require("core.autocmd") - opts.signs = require("core.signs") - end - - configurer.setup(opts) - - local handlers = require("lsp.handlers") -- Adjust the path as necessary - - local function setup_all_servers() - for server, setup_fn in pairs(handlers) do - if type(setup_fn) == "function" then - -- Call the setup function for each server - setup_fn() - end - end - end - - setup_all_servers() - - vim.keymap.set("n", "", 'echo "Use h to move!!"') - vim.keymap.set("n", "", 'echo "Use l to move!!"') - vim.keymap.set("n", "", 'echo "Use k to move!!"') - vim.keymap.set("n", "", 'echo "Use j to move!!"') - - vim.keymap.set("i", "", 'echo "Use h to move!!"') - vim.keymap.set("i", "", 'echo "Use l to move!!"') - vim.keymap.set("i", "", 'echo "Use k to move!!"') - vim.keymap.set("i", "", 'echo "Use j to move!!"') - -- Neovide config - vim.o.guifont = "Iosevka Nerd Font Mono:h14" - vim.g.neovide_transparency = 0.75 - - -- vim.lsp.log.set_level(vim.lsp.log_levels.INFO) - vim.filetype.add(filetypes) + require('config.lazy') ''; }; diff --git a/modules/home/shells/zsh/default.nix b/modules/home/shells/zsh/default.nix index 961a422..714b2c8 100644 --- a/modules/home/shells/zsh/default.nix +++ b/modules/home/shells/zsh/default.nix @@ -54,6 +54,8 @@ in { in '' ${plugins} + export NIX_LD=$(nix eval --impure --raw --expr 'let pkgs = import {}; NIX_LD = pkgs.lib.fileContents "${pkgs.stdenv.cc}/nix-support/dynamic-linker"; in NIX_LD') + bindkey "^[[1;5C" forward-word bindkey "^[[1;5D" backward-word ''; diff --git a/shells/default/default.nix b/shells/default/default.nix index 96bbe8a..805411f 100644 --- a/shells/default/default.nix +++ b/shells/default/default.nix @@ -5,7 +5,7 @@ }: mkShell { packages = with pkgs; [ - nixd + nil alejandra stylua lua-language-server diff --git a/systems/x86_64-linux/earth/default.nix b/systems/x86_64-linux/earth/default.nix index f6ad16a..8c29a1e 100644 --- a/systems/x86_64-linux/earth/default.nix +++ b/systems/x86_64-linux/earth/default.nix @@ -26,6 +26,8 @@ hardware.audio.enable = true; hardware.nvidia.enable = true; + nprograms.nix-ld.enable = true; + programs.steam.enable = true; programs.steam.gamescopeSession.enable = true; programs.gamemode.enable = true; diff --git a/systems/x86_64-linux/earth/hardware-configuration.nix b/systems/x86_64-linux/earth/hardware-configuration.nix index 304a7f7..20fbb46 100644 --- a/systems/x86_64-linux/earth/hardware-configuration.nix +++ b/systems/x86_64-linux/earth/hardware-configuration.nix @@ -27,6 +27,11 @@ fsType = "vfat"; }; + fileSystems."/mnt/lul/" = { + device = "/dev/disk/by-partuuid/2b7f6948-57a6-4fef-a931-b3aa962faee3"; + fsType = "ntfs-3g"; + }; + swapDevices = [ {device = "/dev/disk/by-uuid/a2b1acdb-b17b-4d17-b671-73d1696fe79a";} ]; diff --git a/systems/x86_64-linux/pluto/default.nix b/systems/x86_64-linux/pluto/default.nix index cc7a545..680b55d 100644 --- a/systems/x86_64-linux/pluto/default.nix +++ b/systems/x86_64-linux/pluto/default.nix @@ -30,6 +30,8 @@ boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; + programs.nix-ld.enable = true; + networking.hostName = "pluto"; # Define your hostname. services.web.nginx.enable = true;