From e64b39b8961d308eed53ef657559087a271c009c Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Mon, 3 Jun 2024 17:25:35 -0400 Subject: [PATCH] feat: initial nixvim configuration --- flake.lock | 298 +++++++++- flake.nix | 11 +- overlays/default.nix | 6 +- pkgs/default.nix | 3 +- pkgs/nvim/config/bufferlines/bufferline.nix | 125 +++++ pkgs/nvim/config/colorschemes/base16.nix | 8 + pkgs/nvim/config/colorschemes/catppuccin.nix | 48 ++ pkgs/nvim/config/colorschemes/rose-pine.nix | 14 + pkgs/nvim/config/completion/cmp.nix | 130 +++++ pkgs/nvim/config/completion/copilot.nix | 46 ++ pkgs/nvim/config/completion/lspkind.nix | 12 + pkgs/nvim/config/dap/dap.nix | 222 ++++++++ pkgs/nvim/config/default.nix | 84 +++ pkgs/nvim/config/filetrees/neo-tree.nix | 64 +++ pkgs/nvim/config/git/diffview.nix | 5 + pkgs/nvim/config/git/gitsigns.nix | 92 +++ pkgs/nvim/config/git/lazygit.nix | 20 + pkgs/nvim/config/git/neogit.nix | 12 + pkgs/nvim/config/keymaps.nix | 526 ++++++++++++++++++ pkgs/nvim/config/languages/nvim-jdtls.nix | 81 +++ pkgs/nvim/config/languages/nvim-lint.nix | 16 + .../treesitter/treesitter-context.nix | 5 + .../treesitter/treesitter-textobjects.nix | 50 ++ .../languages/treesitter/treesitter.nix | 8 + .../languages/treesitter/ts-autotag.nix | 5 + .../treesitter/ts-context-commentstring.nix | 6 + .../languages/typescript-tools-nvim.nix | 47 ++ pkgs/nvim/config/lsp/conform.nix | 92 +++ pkgs/nvim/config/lsp/fidget.nix | 99 ++++ pkgs/nvim/config/lsp/lsp.nix | 167 ++++++ pkgs/nvim/config/lsp/lspsaga.nix | 186 +++++++ pkgs/nvim/config/lsp/trouble.nix | 52 ++ pkgs/nvim/config/none-ls/none-ls.nix | 73 +++ pkgs/nvim/config/sets.nix | 145 +++++ pkgs/nvim/config/snippets/luasnip.nix | 19 + pkgs/nvim/config/statusline/lualine.nix | 33 ++ pkgs/nvim/config/statusline/staline.nix | 65 +++ pkgs/nvim/config/telescope/telescope.nix | 178 ++++++ pkgs/nvim/config/ui/alpha.nix | 191 +++++++ pkgs/nvim/config/ui/dressing-nvim.nix | 171 ++++++ pkgs/nvim/config/ui/indent-blankline.nix | 32 ++ pkgs/nvim/config/ui/noice.nix | 36 ++ pkgs/nvim/config/ui/nui.nix | 3 + pkgs/nvim/config/ui/nvim-notify.nix | 44 ++ pkgs/nvim/config/utils/better-escape.nix | 7 + pkgs/nvim/config/utils/flash.nix | 56 ++ pkgs/nvim/config/utils/hardtime.nix | 26 + pkgs/nvim/config/utils/harpoon.nix | 17 + pkgs/nvim/config/utils/illuminate.nix | 17 + pkgs/nvim/config/utils/markdown-preview.nix | 19 + pkgs/nvim/config/utils/mini.nix | 15 + pkgs/nvim/config/utils/neocord.nix | 27 + pkgs/nvim/config/utils/neodev.nix | 11 + pkgs/nvim/config/utils/neotest.nix | 133 +++++ pkgs/nvim/config/utils/nvim-autopairs.nix | 5 + pkgs/nvim/config/utils/nvim-colorizer.nix | 5 + pkgs/nvim/config/utils/nvim-surround.nix | 9 + pkgs/nvim/config/utils/oil.nix | 54 ++ pkgs/nvim/config/utils/persistence.nix | 5 + pkgs/nvim/config/utils/plenary.nix | 5 + pkgs/nvim/config/utils/project-nvim.nix | 6 + pkgs/nvim/config/utils/sidebar.nix | 55 ++ pkgs/nvim/config/utils/tmux-navigator.nix | 5 + pkgs/nvim/config/utils/todo-comments.nix | 5 + pkgs/nvim/config/utils/toggleterm.nix | 57 ++ pkgs/nvim/config/utils/ultimate-autopair.nix | 17 + pkgs/nvim/config/utils/undotree.nix | 26 + pkgs/nvim/config/utils/vim-be-good.nix | 5 + pkgs/nvim/config/utils/wakatime.nix | 5 + pkgs/nvim/config/utils/whichkey.nix | 19 + pkgs/nvim/config/utils/wilder.nix | 43 ++ pkgs/nvim/default.nix | 13 + 72 files changed, 4176 insertions(+), 21 deletions(-) create mode 100644 pkgs/nvim/config/bufferlines/bufferline.nix create mode 100644 pkgs/nvim/config/colorschemes/base16.nix create mode 100644 pkgs/nvim/config/colorschemes/catppuccin.nix create mode 100644 pkgs/nvim/config/colorschemes/rose-pine.nix create mode 100644 pkgs/nvim/config/completion/cmp.nix create mode 100644 pkgs/nvim/config/completion/copilot.nix create mode 100644 pkgs/nvim/config/completion/lspkind.nix create mode 100644 pkgs/nvim/config/dap/dap.nix create mode 100644 pkgs/nvim/config/default.nix create mode 100644 pkgs/nvim/config/filetrees/neo-tree.nix create mode 100644 pkgs/nvim/config/git/diffview.nix create mode 100644 pkgs/nvim/config/git/gitsigns.nix create mode 100644 pkgs/nvim/config/git/lazygit.nix create mode 100644 pkgs/nvim/config/git/neogit.nix create mode 100644 pkgs/nvim/config/keymaps.nix create mode 100644 pkgs/nvim/config/languages/nvim-jdtls.nix create mode 100644 pkgs/nvim/config/languages/nvim-lint.nix create mode 100644 pkgs/nvim/config/languages/treesitter/treesitter-context.nix create mode 100644 pkgs/nvim/config/languages/treesitter/treesitter-textobjects.nix create mode 100644 pkgs/nvim/config/languages/treesitter/treesitter.nix create mode 100644 pkgs/nvim/config/languages/treesitter/ts-autotag.nix create mode 100644 pkgs/nvim/config/languages/treesitter/ts-context-commentstring.nix create mode 100644 pkgs/nvim/config/languages/typescript-tools-nvim.nix create mode 100644 pkgs/nvim/config/lsp/conform.nix create mode 100644 pkgs/nvim/config/lsp/fidget.nix create mode 100644 pkgs/nvim/config/lsp/lsp.nix create mode 100644 pkgs/nvim/config/lsp/lspsaga.nix create mode 100644 pkgs/nvim/config/lsp/trouble.nix create mode 100644 pkgs/nvim/config/none-ls/none-ls.nix create mode 100644 pkgs/nvim/config/sets.nix create mode 100644 pkgs/nvim/config/snippets/luasnip.nix create mode 100644 pkgs/nvim/config/statusline/lualine.nix create mode 100644 pkgs/nvim/config/statusline/staline.nix create mode 100644 pkgs/nvim/config/telescope/telescope.nix create mode 100644 pkgs/nvim/config/ui/alpha.nix create mode 100644 pkgs/nvim/config/ui/dressing-nvim.nix create mode 100644 pkgs/nvim/config/ui/indent-blankline.nix create mode 100644 pkgs/nvim/config/ui/noice.nix create mode 100644 pkgs/nvim/config/ui/nui.nix create mode 100644 pkgs/nvim/config/ui/nvim-notify.nix create mode 100644 pkgs/nvim/config/utils/better-escape.nix create mode 100644 pkgs/nvim/config/utils/flash.nix create mode 100644 pkgs/nvim/config/utils/hardtime.nix create mode 100644 pkgs/nvim/config/utils/harpoon.nix create mode 100644 pkgs/nvim/config/utils/illuminate.nix create mode 100644 pkgs/nvim/config/utils/markdown-preview.nix create mode 100644 pkgs/nvim/config/utils/mini.nix create mode 100644 pkgs/nvim/config/utils/neocord.nix create mode 100644 pkgs/nvim/config/utils/neodev.nix create mode 100644 pkgs/nvim/config/utils/neotest.nix create mode 100644 pkgs/nvim/config/utils/nvim-autopairs.nix create mode 100644 pkgs/nvim/config/utils/nvim-colorizer.nix create mode 100644 pkgs/nvim/config/utils/nvim-surround.nix create mode 100644 pkgs/nvim/config/utils/oil.nix create mode 100644 pkgs/nvim/config/utils/persistence.nix create mode 100644 pkgs/nvim/config/utils/plenary.nix create mode 100644 pkgs/nvim/config/utils/project-nvim.nix create mode 100644 pkgs/nvim/config/utils/sidebar.nix create mode 100644 pkgs/nvim/config/utils/tmux-navigator.nix create mode 100644 pkgs/nvim/config/utils/todo-comments.nix create mode 100644 pkgs/nvim/config/utils/toggleterm.nix create mode 100644 pkgs/nvim/config/utils/ultimate-autopair.nix create mode 100644 pkgs/nvim/config/utils/undotree.nix create mode 100644 pkgs/nvim/config/utils/vim-be-good.nix create mode 100644 pkgs/nvim/config/utils/wakatime.nix create mode 100644 pkgs/nvim/config/utils/whichkey.nix create mode 100644 pkgs/nvim/config/utils/wilder.nix create mode 100644 pkgs/nvim/default.nix diff --git a/flake.lock b/flake.lock index 66d9a01..4d6dab4 100644 --- a/flake.lock +++ b/flake.lock @@ -87,6 +87,28 @@ "type": "github" } }, + "devshell": { + "inputs": { + "flake-utils": "flake-utils_4", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1713532798, + "narHash": "sha256-wtBhsdMJA3Wa32Wtm1eeo84GejtI43pMrFrmwLXrsEc=", + "owner": "numtide", + "repo": "devshell", + "rev": "12e914740a25ea1891ec619bb53cf5e6ca922e40", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -119,6 +141,72 @@ "type": "github" } }, + "flake-compat_3": { + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "revCount": 57, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" + } + }, + "flake-compat_4": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1715865404, + "narHash": "sha256-/GJvTdTpuDjNn84j82cU6bXztE0MSkdnTWClUCRub78=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "8dc45382d5206bd292f9c2768b8058a8fd8311d9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-root": { + "locked": { + "lastModified": 1713493429, + "narHash": "sha256-ztz8JQkI08tjKnsTpfLqzWoKFQF4JGu2LRz8bkdnYUk=", + "owner": "srid", + "repo": "flake-root", + "rev": "bc748b93b86ee76e2032eecda33440ceb2532fcd", + "type": "github" + }, + "original": { + "owner": "srid", + "repo": "flake-root", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems_3" @@ -177,6 +265,24 @@ "inputs": { "systems": "systems_6" }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_5": { + "inputs": { + "systems": "systems_7" + }, "locked": { "lastModified": 1705309234, "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", @@ -191,9 +297,9 @@ "type": "github" } }, - "flake-utils_5": { + "flake-utils_6": { "inputs": { - "systems": "systems_8" + "systems": "systems_9" }, "locked": { "lastModified": 1681202837, @@ -209,6 +315,55 @@ "type": "github" } }, + "git-hooks": { + "inputs": { + "flake-compat": "flake-compat_4", + "gitignore": "gitignore", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ], + "nixpkgs-stable": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1716213921, + "narHash": "sha256-xrsYFST8ij4QWaV6HEokCUNIZLjjLP1bYC60K8XiBVA=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "0e8fcc54b842ad8428c9e705cb5994eaf05c26a0", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "nixvim", + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -251,6 +406,27 @@ "type": "github" } }, + "home-manager_3": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1717052710, + "narHash": "sha256-LRhOxzXmOza5SymhOgnEzA8EAQp+94kkeUYWKKpLJ/U=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "29c69d9a466e41d46fd3a7a9d0591ef9c113c2ae", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, "hyprcursor": { "inputs": { "hyprlang": [ @@ -290,11 +466,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1717362715, - "narHash": "sha256-EnkKVUYqVfYqJso4t8ScuuMNEge7eybpdvtPCy4uwlc=", + "lastModified": 1717442018, + "narHash": "sha256-GhL4f5CedZE0UiuzUFkMwGXD+zqlhrzo0y4FC4wQLTM=", "ref": "refs/heads/main", - "rev": "358e59e69d27a69381bc0872b5b8d1184bc6b6a1", - "revCount": 4756, + "rev": "5517cc506b2754cb2485b1bf3e46918ee638ea6d", + "revCount": 4760, "submodules": true, "type": "git", "url": "https://github.com/hyprwm/Hyprland" @@ -392,11 +568,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1717346559, - "narHash": "sha256-SpwWUYctOViUjTp3e7x8VxwxntS1tNtpfef7YJKikgs=", + "lastModified": 1717443201, + "narHash": "sha256-a0ZXSNQvklHhUkCnX+4wGN8Bu5WkG+I85h7NcKlehdk=", "owner": "JakeStanger", "repo": "ironbar", - "rev": "5d1054abd8ab5e538073b75450bc1618bd537a7b", + "rev": "6e921eb567164f4ad46a7c74d665b3dc6223f928", "type": "github" }, "original": { @@ -423,6 +599,27 @@ "type": "github" } }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1716993688, + "narHash": "sha256-vo5k2wQekfeoq/2aleQkBN41dQiQHNTniZeVONWiWLs=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "c0d5b8c54d6828516c97f6be9f2d00c63a363df4", + "type": "github" + }, + "original": { + "owner": "lnl7", + "repo": "nix-darwin", + "type": "github" + } + }, "nix-vscode-extensions": { "inputs": { "flake-compat": "flake-compat", @@ -542,13 +739,41 @@ "type": "github" } }, + "nixvim": { + "inputs": { + "devshell": "devshell", + "flake-compat": "flake-compat_3", + "flake-parts": "flake-parts", + "flake-root": "flake-root", + "git-hooks": "git-hooks", + "home-manager": "home-manager_3", + "nix-darwin": "nix-darwin", + "nixpkgs": [ + "nixpkgs" + ], + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1717444597, + "narHash": "sha256-8enVHsN7hLn1hPkY1U5Cfr3rzij4FsWRUx4jjHUHZQE=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "b7a8b0319098fdbaa719ef4dc375337ec4543c6e", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixvim", + "type": "github" + } + }, "nur": { "locked": { - "lastModified": 1717429509, - "narHash": "sha256-c7mqDqNUP5BVtUZLTeglj5NjM1jvncUZy9fhydhB8RQ=", + "lastModified": 1717443933, + "narHash": "sha256-hKPYAOnbqvy/eZMsp85KRHn5+K3QkGeU8cyLiXtxT48=", "owner": "nix-community", "repo": "NUR", - "rev": "963de5e47dbd9550a36d90c9075b40002000547a", + "rev": "0122b0f415811dd2a367f362a595070b6451ff9a", "type": "github" }, "original": { @@ -567,6 +792,7 @@ "nix-vscode-extensions": "nix-vscode-extensions", "nixos-wsl": "nixos-wsl", "nixpkgs": "nixpkgs_4", + "nixvim": "nixvim", "nur": "nur", "rust-overlay": "rust-overlay_2", "unstable": "unstable", @@ -598,15 +824,15 @@ }, "rust-overlay_2": { "inputs": { - "flake-utils": "flake-utils_4", + "flake-utils": "flake-utils_5", "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1717406456, - "narHash": "sha256-voWbxOZu1DM6hLOlOkLqSrZ8BsOY6F9h/tYB9C0jOXs=", + "lastModified": 1717442957, + "narHash": "sha256-w0fqHofxM2hf3pGDXCPSdH0A09v6FgHm6I38nCWA96k=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "711ff40be18b09bf096930f52e1fb2fcbee9adf0", + "rev": "025e1742de4fa75b3fb63818bd9726d17da6a102", "type": "github" }, "original": { @@ -735,6 +961,42 @@ "type": "github" } }, + "systems_9": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1715940852, + "narHash": "sha256-wJqHMg/K6X3JGAE9YLM0LsuKrKb4XiBeVaoeMNlReZg=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "2fba33a182602b9d49f0b2440513e5ee091d838b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, "unstable": { "locked": { "lastModified": 1717196966, @@ -752,7 +1014,7 @@ }, "utils": { "inputs": { - "systems": "systems_7" + "systems": "systems_8" }, "locked": { "lastModified": 1710146030, @@ -770,7 +1032,7 @@ }, "vscode-server": { "inputs": { - "flake-utils": "flake-utils_5", + "flake-utils": "flake-utils_6", "nixpkgs": [ "nixpkgs" ] diff --git a/flake.nix b/flake.nix index ddb8074..6906103 100644 --- a/flake.nix +++ b/flake.nix @@ -18,6 +18,11 @@ }; utils.url = "github:numtide/flake-utils"; + nixvim = { + # url = "github:nix-community/nixvim/nixos-24.05"; + url = "github:nix-community/nixvim"; + inputs.nixpkgs.follows = "nixpkgs"; + }; rust-overlay.url = "github:oxalica/rust-overlay"; nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions"; hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; @@ -67,7 +72,11 @@ in { # Your custom packages # Accessible through 'nix build', 'nix shell', etc - packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system}); + packages = forAllSystems (system: + import ./pkgs { + pkgs = nixpkgs.legacyPackages.${system}; + inherit inputs; + }); overlays = import ./overlays {inherit inputs;}; diff --git a/overlays/default.nix b/overlays/default.nix index 85e4b9f..b9cb445 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -3,7 +3,11 @@ vscode-extensions = inputs.nix-vscode-extensions.overlays.default; # This one brings our custom packages from the 'pkgs' directory - additions = final: _prev: import ../pkgs final.pkgs; + additions = final: _prev: + import ../pkgs { + pkgs = final.pkgs; + inherit inputs; + }; # This one contains whatever you want to overlay # You can change versions, add patches, set compilation flags, anything really. diff --git a/pkgs/default.nix b/pkgs/default.nix index 7894653..bb4c612 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,4 +1,5 @@ -pkgs: { +{pkgs, ...} @ args: { homer = pkgs.callPackage ./homer {}; keycloak-theme-keywind = pkgs.callPackage ./keywind {}; + nvim-custom = import ./nvim/default.nix args; } diff --git a/pkgs/nvim/config/bufferlines/bufferline.nix b/pkgs/nvim/config/bufferlines/bufferline.nix new file mode 100644 index 0000000..9b717cd --- /dev/null +++ b/pkgs/nvim/config/bufferlines/bufferline.nix @@ -0,0 +1,125 @@ +{ + plugins = { + bufferline = { + enable = true; + separatorStyle = "thick"; # “slant”, “padded_slant”, “slope”, “padded_slope”, “thick”, “thin” + offsets = [ + { + filetype = "neo-tree"; + text = "Neo-tree"; + highlight = "Directory"; + text_align = "left"; + } + ]; + }; + }; + keymaps = [ + { + mode = "n"; + key = ""; + action = "BufferLineCycleNext"; + options = { + desc = "Cycle to next buffer"; + }; + } + + { + mode = "n"; + key = ""; + action = "BufferLineCyclePrev"; + options = { + desc = "Cycle to previous buffer"; + }; + } + + { + mode = "n"; + key = ""; + action = "BufferLineCycleNext"; + options = { + desc = "Cycle to next buffer"; + }; + } + + { + mode = "n"; + key = ""; + action = "BufferLineCyclePrev"; + options = { + desc = "Cycle to previous buffer"; + }; + } + + { + mode = "n"; + key = "bd"; + action = "bdelete"; + options = { + desc = "Delete buffer"; + }; + } + + { + mode = "n"; + key = "bb"; + action = "e #"; + options = { + desc = "Switch to Other Buffer"; + }; + } + + # { + # mode = "n"; + # key = "`"; + # action = "e #"; + # options = { + # desc = "Switch to Other Buffer"; + # }; + # } + + { + mode = "n"; + key = "br"; + action = "BufferLineCloseRight"; + options = { + desc = "Delete buffers to the right"; + }; + } + + { + mode = "n"; + key = "bl"; + action = "BufferLineCloseLeft"; + options = { + desc = "Delete buffers to the left"; + }; + } + + { + mode = "n"; + key = "bo"; + action = "BufferLineCloseOthers"; + options = { + desc = "Delete other buffers"; + }; + } + + { + mode = "n"; + key = "bp"; + action = "BufferLineTogglePin"; + options = { + desc = "Toggle pin"; + }; + } + + { + mode = "n"; + key = "bP"; + action = "BufferLineGroupClose ungrouped"; + options = { + desc = "Delete non-pinned buffers"; + }; + } + ]; +} diff --git a/pkgs/nvim/config/colorschemes/base16.nix b/pkgs/nvim/config/colorschemes/base16.nix new file mode 100644 index 0000000..ffea1b3 --- /dev/null +++ b/pkgs/nvim/config/colorschemes/base16.nix @@ -0,0 +1,8 @@ +{ + colorschemes = { + base16 = { + enable = false; + colorscheme = "mountain"; + }; + }; +} diff --git a/pkgs/nvim/config/colorschemes/catppuccin.nix b/pkgs/nvim/config/colorschemes/catppuccin.nix new file mode 100644 index 0000000..312d28a --- /dev/null +++ b/pkgs/nvim/config/colorschemes/catppuccin.nix @@ -0,0 +1,48 @@ +{ + colorschemes = { + catppuccin = { + enable = true; + settings = { + background = { + light = "macchiato"; + dark = "mocha"; + }; + flavour = "mocha"; # "latte", "mocha", "frappe", "macchiato" or raw lua code + disable_bold = false; + disable_italic = false; + disable_underline = false; + transparent_background = true; + term_colors = true; + integrations = { + cmp = true; + noice = true; + notify = true; + neotree = true; + harpoon = true; + gitsigns = true; + which_key = true; + illuminate = { + enabled = true; + }; + treesitter = true; + treesitter_context = true; + telescope.enabled = true; + indent_blankline.enabled = true; + mini.enabled = true; + native_lsp = { + enabled = true; + inlay_hints = { + background = true; + }; + underlines = { + errors = ["underline"]; + hints = ["underline"]; + information = ["underline"]; + warnings = ["underline"]; + }; + }; + }; + }; + }; + }; +} diff --git a/pkgs/nvim/config/colorschemes/rose-pine.nix b/pkgs/nvim/config/colorschemes/rose-pine.nix new file mode 100644 index 0000000..2077010 --- /dev/null +++ b/pkgs/nvim/config/colorschemes/rose-pine.nix @@ -0,0 +1,14 @@ +{ + colorschemes = { + rose-pine = { + enable = false; + settings = { + styles = { + italic = true; + bold = true; + transparency = false; + }; + }; + }; + }; +} diff --git a/pkgs/nvim/config/completion/cmp.nix b/pkgs/nvim/config/completion/cmp.nix new file mode 100644 index 0000000..012ff9e --- /dev/null +++ b/pkgs/nvim/config/completion/cmp.nix @@ -0,0 +1,130 @@ +{ + plugins = { + cmp-nvim-lsp = {enable = true;}; # lsp + cmp-buffer = {enable = true;}; + copilot-cmp = {enable = true;}; # copilot suggestions + cmp-path = {enable = true;}; # file system paths + cmp_luasnip = {enable = true;}; # snippets + cmp-cmdline = {enable = false;}; # autocomplete for cmdline + cmp = { + enable = true; + autoEnableSources = false; + settings = { + experimental = { + ghost_text = true; + }; + }; + settings = { + mapping = { + __raw = '' + cmp.mapping.preset.insert({ + [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.abort(), + + [''] = cmp.mapping.scroll_docs(-4), + + [''] = cmp.mapping.scroll_docs(4), + + [''] = cmp.mapping.complete(), + + [''] = cmp.mapping.confirm({ select = true }), + + [''] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }), + }) + ''; + }; + snippet = { + expand = "function(args) require('luasnip').lsp_expand(args.body) end"; + }; + sources = { + __raw = '' + cmp.config.sources({ + {name = 'nvim_lsp'}, + {name = 'copilot'}, + {name = 'path'}, + {name = 'luasnip'}, + {name = 'cmdline'}, + }, { + {name = 'buffer'}, + }) + ''; + }; + performance = { + debounce = 60; + fetching_timeout = 200; + max_view_entries = 30; + }; + window = { + completion = { + border = "rounded"; + winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:Visual,Search:None"; + }; + documentation = { + border = "rounded"; + }; + }; + formatting = { + fields = ["kind" "abbr" "menu"]; + expandable_indicator = true; + }; + }; + }; + }; + extraConfigLua = '' + luasnip = require("luasnip") + kind_icons = { + Text = "󰊄", + Method = "", + Function = "󰡱", + Constructor = "", + Field = "", + Variable = "󱀍", + Class = "", + Interface = "", + Module = "󰕳", + Property = "", + Unit = "", + Value = "", + Enum = "", + Keyword = "", + Snippet = "", + Color = "", + File = "", + Reference = "", + Folder = "", + EnumMember = "", + Constant = "", + Struct = "", + Event = "", + Operator = "", + TypeParameter = "", + } + + local cmp = require'cmp' + + -- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline({'/', "?" }, { + sources = { + { name = 'buffer' } + } + }) + + -- Set configuration for specific filetype. + cmp.setup.filetype('gitcommit', { + sources = cmp.config.sources({ + { name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it. + }, { + { name = 'buffer' }, + }) + }) + + -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline(':', { + sources = cmp.config.sources({ + { name = 'path' } + }, { + { name = 'cmdline' } + }), + }) ''; +} diff --git a/pkgs/nvim/config/completion/copilot.nix b/pkgs/nvim/config/completion/copilot.nix new file mode 100644 index 0000000..4f8be48 --- /dev/null +++ b/pkgs/nvim/config/completion/copilot.nix @@ -0,0 +1,46 @@ +{ + plugins.copilot-lua = { + enable = true; + panel = { + enabled = false; + autoRefresh = true; + keymap = { + jumpPrev = "[["; + jumpNext = "]]"; + accept = ""; + refresh = "gr"; + open = ""; + }; + layout = { + position = "bottom"; # | top | left | right + ratio = 0.4; + }; + }; + suggestion = { + enabled = false; + autoTrigger = true; + debounce = 75; + keymap = { + accept = ""; + acceptWord = false; + acceptLine = false; + next = ""; + prev = ""; + dismiss = ""; + }; + }; + filetypes = { + yaml = false; + markdown = false; + help = false; + gitcommit = false; + gitrebase = false; + hgcommit = false; + svn = false; + cvs = false; + "." = false; + }; + copilotNodeCommand = "node"; # Node.js version must be > 18.x + serverOptsOverrides = {}; + }; +} diff --git a/pkgs/nvim/config/completion/lspkind.nix b/pkgs/nvim/config/completion/lspkind.nix new file mode 100644 index 0000000..69e8f78 --- /dev/null +++ b/pkgs/nvim/config/completion/lspkind.nix @@ -0,0 +1,12 @@ +{ + plugins.lspkind = { + enable = true; + symbolMap = { + Copilot = ""; + }; + extraOptions = { + maxwidth = 50; + ellipsis_char = "..."; + }; + }; +} diff --git a/pkgs/nvim/config/dap/dap.nix b/pkgs/nvim/config/dap/dap.nix new file mode 100644 index 0000000..20fe615 --- /dev/null +++ b/pkgs/nvim/config/dap/dap.nix @@ -0,0 +1,222 @@ +{ + plugins.dap = { + enable = true; + signs = { + dapBreakpoint = { + text = "●"; + texthl = "DapBreakpoint"; + }; + dapBreakpointCondition = { + text = "●"; + texthl = "DapBreakpointCondition"; + }; + dapLogPoint = { + text = "◆"; + texthl = "DapLogPoint"; + }; + }; + extensions = { + dap-python = { + enable = true; + }; + dap-ui = { + enable = true; + floating.mappings = { + close = ["" "q"]; + }; + }; + dap-virtual-text = { + enable = true; + }; + }; + configurations = { + java = [ + { + type = "java"; + request = "launch"; + name = "Debug (Attach) - Remote"; + hostName = "127.0.0.1"; + port = 5005; + } + ]; + }; + }; + + keymaps = [ + { + mode = "n"; + key = "dB"; + action = " + lua require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: ')) + "; + options = { + silent = true; + desc = "Breakpoint Condition"; + }; + } + { + mode = "n"; + key = "db"; + action = ":DapToggleBreakpoint"; + options = { + silent = true; + desc = "Toggle Breakpoint"; + }; + } + { + mode = "n"; + key = "dc"; + action = ":DapContinue"; + options = { + silent = true; + desc = "Continue"; + }; + } + { + mode = "n"; + key = "da"; + action = "lua require('dap').continue({ before = get_args })"; + options = { + silent = true; + desc = "Run with Args"; + }; + } + { + mode = "n"; + key = "dC"; + action = "lua require('dap').run_to_cursor()"; + options = { + silent = true; + desc = "Run to cursor"; + }; + } + { + mode = "n"; + key = "dg"; + action = "lua require('dap').goto_()"; + options = { + silent = true; + desc = "Go to line (no execute)"; + }; + } + { + mode = "n"; + key = "di"; + action = ":DapStepInto"; + options = { + silent = true; + desc = "Step into"; + }; + } + { + mode = "n"; + key = "dj"; + action = " + lua require('dap').down() + "; + options = { + silent = true; + desc = "Down"; + }; + } + { + mode = "n"; + key = "dk"; + action = "lua require('dap').up()"; + options = { + silent = true; + desc = "Up"; + }; + } + { + mode = "n"; + key = "dl"; + action = "lua require('dap').run_last()"; + options = { + silent = true; + desc = "Run Last"; + }; + } + { + mode = "n"; + key = "do"; + action = ":DapStepOut"; + options = { + silent = true; + desc = "Step Out"; + }; + } + { + mode = "n"; + key = "dO"; + action = ":DapStepOver"; + options = { + silent = true; + desc = "Step Over"; + }; + } + { + mode = "n"; + key = "dp"; + action = "lua require('dap').pause()"; + options = { + silent = true; + desc = "Pause"; + }; + } + { + mode = "n"; + key = "dr"; + action = ":DapToggleRepl"; + options = { + silent = true; + desc = "Toggle REPL"; + }; + } + { + mode = "n"; + key = "ds"; + action = "lua require('dap').session()"; + options = { + silent = true; + desc = "Session"; + }; + } + { + mode = "n"; + key = "dt"; + action = ":DapTerminate"; + options = { + silent = true; + desc = "Terminate"; + }; + } + { + mode = "n"; + key = "du"; + action = "lua require('dapui').toggle()"; + options = { + silent = true; + desc = "Dap UI"; + }; + } + { + mode = "n"; + key = "dw"; + action = "lua require('dap.ui.widgets').hover()"; + options = { + silent = true; + desc = "Widgets"; + }; + } + { + mode = ["n" "v"]; + key = "de"; + action = "lua require('dapui').eval()"; + options = { + silent = true; + desc = "Eval"; + }; + } + ]; +} diff --git a/pkgs/nvim/config/default.nix b/pkgs/nvim/config/default.nix new file mode 100644 index 0000000..ff983f7 --- /dev/null +++ b/pkgs/nvim/config/default.nix @@ -0,0 +1,84 @@ +{ + # Import all your configuration modules here + imports = [ + ./sets.nix + ./keymaps.nix + + ./bufferlines/bufferline.nix + + ./colorschemes/base16.nix + ./colorschemes/catppuccin.nix + ./colorschemes/rose-pine.nix + + ./completion/cmp.nix + ./completion/copilot.nix + ./completion/lspkind.nix + + ./dap/dap.nix + + ./filetrees/neo-tree.nix + ./git/gitsigns.nix + ./git/diffview.nix + # ./git/lazygit.nix + ./git/neogit.nix + + ./languages/nvim-jdtls.nix + ./languages/nvim-lint.nix + ./languages/typescript-tools-nvim.nix + ./languages/treesitter/treesitter.nix + ./languages/treesitter/treesitter-context.nix + ./languages/treesitter/treesitter-textobjects.nix + ./languages/treesitter/ts-autotag.nix + ./languages/treesitter/ts-context-commentstring.nix + + ./lsp/conform.nix + ./lsp/fidget.nix + ./lsp/lsp.nix + ./lsp/lspsaga.nix + ./lsp/trouble.nix + + ./none-ls/none-ls.nix + + ./snippets/luasnip.nix + + ./statusline/lualine.nix + ./statusline/staline.nix + + ./telescope/telescope.nix + + ./ui/alpha.nix + ./ui/dressing-nvim.nix + ./ui/indent-blankline.nix + ./ui/noice.nix + ./ui/nvim-notify.nix + ./ui/nui.nix + + ./utils/better-escape.nix + ./utils/neocord.nix + ./utils/flash.nix + ./utils/hardtime.nix + ./utils/harpoon.nix + ./utils/illuminate.nix + ./utils/markdown-preview.nix + ./utils/mini.nix + ./utils/neodev.nix + ./utils/neotest.nix + ./utils/nvim-autopairs.nix + ./utils/nvim-colorizer.nix + ./utils/nvim-surround.nix + ./utils/oil.nix + ./utils/persistence.nix + ./utils/plenary.nix + ./utils/project-nvim.nix + ./utils/sidebar.nix + ./utils/tmux-navigator.nix + ./utils/todo-comments.nix + ./utils/toggleterm.nix + ./utils/ultimate-autopair.nix + ./utils/undotree.nix + ./utils/vim-be-good.nix + ./utils/wakatime.nix + ./utils/whichkey.nix + ./utils/wilder.nix + ]; +} diff --git a/pkgs/nvim/config/filetrees/neo-tree.nix b/pkgs/nvim/config/filetrees/neo-tree.nix new file mode 100644 index 0000000..c83589e --- /dev/null +++ b/pkgs/nvim/config/filetrees/neo-tree.nix @@ -0,0 +1,64 @@ +{ + plugins.neo-tree = { + enable = false; + enableDiagnostics = true; + enableGitStatus = true; + enableModifiedMarkers = true; + enableRefreshOnWrite = true; + closeIfLastWindow = true; + popupBorderStyle = "rounded"; # Type: null or one of “NC”, “double”, “none”, “rounded”, “shadow”, “single”, “solid” or raw lua code + buffers = { + bindToCwd = false; + followCurrentFile = { + enabled = true; + }; + }; + window = { + width = 40; + height = 15; + autoExpandWidth = false; + mappings = { + "" = "none"; + }; + }; + }; + + # keymaps = [ + # { + # mode = "n"; + # key = "e"; + # action = ":Neotree toggle reveal_force_cwd"; + # options = { + # silent = true; + # desc = "Explorer NeoTree (root dir)"; + # }; + # } + # { + # mode = "n"; + # key = "E"; + # action = "Neotree toggle"; + # options = { + # silent = true; + # desc = "Explorer NeoTree (cwd)"; + # }; + # } + # { + # mode = "n"; + # key = "be"; + # action = ":Neotree buffers"; + # options = { + # silent = true; + # desc = "Buffer explorer"; + # }; + # } + # { + # mode = "n"; + # key = "ge"; + # action = ":Neotree git_status"; + # options = { + # silent = true; + # desc = "Git explorer"; + # }; + # } + # ]; +} diff --git a/pkgs/nvim/config/git/diffview.nix b/pkgs/nvim/config/git/diffview.nix new file mode 100644 index 0000000..fa672d0 --- /dev/null +++ b/pkgs/nvim/config/git/diffview.nix @@ -0,0 +1,5 @@ +{ + plugins.diffview = { + enable = true; + }; +} diff --git a/pkgs/nvim/config/git/gitsigns.nix b/pkgs/nvim/config/git/gitsigns.nix new file mode 100644 index 0000000..67814df --- /dev/null +++ b/pkgs/nvim/config/git/gitsigns.nix @@ -0,0 +1,92 @@ +{ + plugins.gitsigns = { + enable = true; + settings = { + trouble = true; + current_line_blame = false; + }; + }; + keymaps = [ + { + mode = ["n" "v"]; + key = "gh"; + action = "gitsigns"; + options = { + silent = true; + desc = "+hunks"; + }; + } + { + mode = "n"; + key = "ghb"; + action = ":Gitsigns blame_line"; + options = { + silent = true; + desc = "Blame line"; + }; + } + { + mode = "n"; + key = "ghd"; + action = ":Gitsigns diffthis"; + options = { + silent = true; + desc = "Diff This"; + }; + } + { + mode = "n"; + key = "ghp"; + action = ":Gitsigns preview_hunk"; + options = { + silent = true; + desc = "Preview hunk"; + }; + } + { + mode = "n"; + key = "ghR"; + action = ":Gitsigns reset_buffer"; + options = { + silent = true; + desc = "Reset Buffer"; + }; + } + { + mode = ["n" "v"]; + key = "ghr"; + action = ":Gitsigns reset_hunk"; + options = { + silent = true; + desc = "Reset Hunk"; + }; + } + { + mode = ["n" "v"]; + key = "ghs"; + action = ":Gitsigns stage_hunk"; + options = { + silent = true; + desc = "Stage Hunk"; + }; + } + { + mode = "n"; + key = "ghS"; + action = ":Gitsigns stage_buffer"; + options = { + silent = true; + desc = "Stage Buffer"; + }; + } + { + mode = "n"; + key = "ghu"; + action = ":Gitsigns undo_stage_hunk"; + options = { + silent = true; + desc = "Undo Stage Hunk"; + }; + } + ]; +} diff --git a/pkgs/nvim/config/git/lazygit.nix b/pkgs/nvim/config/git/lazygit.nix new file mode 100644 index 0000000..4ad017a --- /dev/null +++ b/pkgs/nvim/config/git/lazygit.nix @@ -0,0 +1,20 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimPlugins; [ + lazygit-nvim + ]; + + extraConfigLua = '' + require("telescope").load_extension("lazygit") + ''; + + keymaps = [ + { + mode = "n"; + key = "gg"; + action = "LazyGit"; + options = { + desc = "LazyGit (root dir)"; + }; + } + ]; +} diff --git a/pkgs/nvim/config/git/neogit.nix b/pkgs/nvim/config/git/neogit.nix new file mode 100644 index 0000000..a39a9ea --- /dev/null +++ b/pkgs/nvim/config/git/neogit.nix @@ -0,0 +1,12 @@ +{ + plugins.neogit = { + enable = true; + }; + keymaps = [ + { + mode = "n"; + key = "gg"; + action = "Neogit"; + } + ]; +} diff --git a/pkgs/nvim/config/keymaps.nix b/pkgs/nvim/config/keymaps.nix new file mode 100644 index 0000000..64dd1bb --- /dev/null +++ b/pkgs/nvim/config/keymaps.nix @@ -0,0 +1,526 @@ +# Thanks for the keybinds primeagen and folke! +{ + globals.mapleader = " "; + + # TODO: Move general mappings to which-key + keymaps = [ + # Disable arrow keys + { + mode = ["n" "i"]; + key = ""; + action = ""; + options = { + silent = true; + noremap = true; + desc = "Disable Up arrow key"; + }; + } + { + mode = ["n" "i"]; + key = ""; + action = ""; + options = { + silent = true; + noremap = true; + desc = "Disable Down arrow key"; + }; + } + { + mode = ["n" "i"]; + key = ""; + action = ""; + options = { + silent = true; + noremap = true; + desc = "Disable Right arrow key"; + }; + } + { + mode = ["n" "i"]; + key = ""; + action = ""; + options = { + silent = true; + noremap = true; + desc = "Disable Left arrow key"; + }; + } + + # General maps + { + mode = "n"; + key = "f"; + action = "+find/file"; + } + + { + mode = "n"; + key = "s"; + action = "+search"; + } + + { + mode = "n"; + key = "q"; + action = "+quit/session"; + } + + { + mode = ["n" "v"]; + key = "g"; + action = "+git"; + } + + { + mode = "n"; + key = "u"; + action = "+ui"; + } + + { + mode = "n"; + key = "w"; + action = "+windows"; + } + + { + mode = "n"; + key = ""; + action = "+tab"; + } + + { + mode = ["n" "v"]; + key = "d"; + action = "+debug"; + } + + { + mode = ["n" "v"]; + key = "c"; + action = "+code"; + } + + { + mode = ["n" "v"]; + key = "t"; + action = "+test"; + } + + # Tabs + { + mode = "n"; + key = "l"; + action = "tablast"; + options = { + silent = true; + desc = "Last tab"; + }; + } + + { + mode = "n"; + key = "f"; + action = "tabfirst"; + options = { + silent = true; + desc = "First Tab"; + }; + } + + { + mode = "n"; + key = ""; + action = "tabnew"; + options = { + silent = true; + desc = "New Tab"; + }; + } + + { + mode = "n"; + key = "]"; + action = "tabnext"; + options = { + silent = true; + desc = "Next Tab"; + }; + } + + { + mode = "n"; + key = "d"; + action = "tabclose"; + options = { + silent = true; + desc = "Close tab"; + }; + } + + { + mode = "n"; + key = "["; + action = "tabprevious"; + options = { + silent = true; + desc = "Previous Tab"; + }; + } + + # Windows + { + mode = "n"; + key = "ww"; + action = "p"; + options = { + silent = true; + desc = "Other window"; + }; + } + + { + mode = "n"; + key = "wd"; + action = "c"; + options = { + silent = true; + desc = "Delete window"; + }; + } + + { + mode = "n"; + key = "w-"; + action = "s"; + options = { + silent = true; + desc = "Split window below"; + }; + } + + { + mode = "n"; + key = "w|"; + action = "v"; + options = { + silent = true; + desc = "Split window right"; + }; + } + + # { + # mode = "n"; + # key = "-"; + # action = "s"; + # options = { + # silent = true; + # desc = "Split window below"; + # }; + # } + + # { + # mode = "n"; + # key = "|"; + # action = "v"; + # options = { + # silent = true; + # desc = "Split window right"; + # }; + # } + + { + mode = "n"; + key = ""; + action = "w"; + options = { + silent = true; + desc = "Save file"; + }; + } + + # Quit/Session + { + mode = "n"; + key = "qq"; + action = "quitall"; + options = { + silent = true; + desc = "Quit all"; + }; + } + + { + mode = "n"; + key = "qs"; + action = ":lua require('persistence').load()"; + options = { + silent = true; + desc = "Restore session"; + }; + } + + { + mode = "n"; + key = "ql"; + action = "lua require('persistence').load({ last = true })"; + options = { + silent = true; + desc = "Restore last session"; + }; + } + + { + mode = "n"; + key = "qd"; + action = "lua require('persistence').stop()"; + options = { + silent = true; + desc = "Don't save current session"; + }; + } + + { + mode = "n"; + key = "ul"; + action = ":lua ToggleLineNumber()"; + options = { + silent = true; + desc = "Toggle Line Numbers"; + }; + } + + { + mode = "n"; + key = "uL"; + action = ":lua ToggleRelativeLineNumber()"; + options = { + silent = true; + desc = "Toggle Relative Line Numbers"; + }; + } + + { + mode = "n"; + key = "uw"; + action = ":lua ToggleWrap()"; + options = { + silent = true; + desc = "Toggle Line Wrap"; + }; + } + + { + mode = "v"; + key = "J"; + action = ":m '>+1gv=gv"; + options = { + silent = true; + desc = "Move up when line is highlighted"; + }; + } + + { + mode = "v"; + key = "K"; + action = ":m '<-2gv=gv"; + options = { + silent = true; + desc = "Move down when line is highlighted"; + }; + } + + { + mode = "n"; + key = "J"; + action = "mzJ`z"; + options = { + silent = true; + desc = "Allow cursor to stay in the same place after appeding to current line"; + }; + } + + { + mode = "v"; + key = "<"; + action = " + y or just y to have it just in vim + { + mode = ["n" "v"]; + key = "y"; + action = "\"+y"; + options = { + desc = "Copy to system clipboard"; + }; + } + + { + mode = ["n" "v"]; + key = "Y"; + action = "\"+Y"; + options = { + desc = "Copy to system clipboard"; + }; + } + + # Delete to void register + { + mode = ["n" "v"]; + key = "D"; + action = "\"_d"; + options = { + desc = "Delete to void register"; + }; + } + + # instead of pressing esc just because + { + mode = "i"; + key = ""; + action = ""; + } + + { + mode = "n"; + key = ""; + action = "!tmux new tmux-sessionizer"; + options = { + desc = "Switch between projects"; + }; + } + ]; + extraConfigLua = '' + local notify = require("notify") + + local function show_notification(message, level) + notify(message, level, { title = "conform.nvim" }) + end + + function ToggleLineNumber() + if vim.wo.number then + vim.wo.number = false + show_notification("Line numbers disabled", "info") + else + vim.wo.number = true + vim.wo.relativenumber = false + show_notification("Line numbers enabled", "info") + end + end + + function ToggleRelativeLineNumber() + if vim.wo.relativenumber then + vim.wo.relativenumber = false + show_notification("Relative line numbers disabled", "info") + else + vim.wo.relativenumber = true + vim.wo.number = false + show_notification("Relative line numbers enabled", "info") + end + end + + function ToggleWrap() + if vim.wo.wrap then + vim.wo.wrap = false + show_notification("Wrap disabled", "info") + else + vim.wo.wrap = true + vim.wo.number = false + show_notification("Wrap enabled", "info") + end + end + + if vim.lsp.inlay_hint then + vim.keymap.set('n', 'uh', function() + vim.lsp.inlay_hint(0, nil) + end, { desc = 'Toggle Inlay Hints' }) + end + ''; +} diff --git a/pkgs/nvim/config/languages/nvim-jdtls.nix b/pkgs/nvim/config/languages/nvim-jdtls.nix new file mode 100644 index 0000000..b3d4d0a --- /dev/null +++ b/pkgs/nvim/config/languages/nvim-jdtls.nix @@ -0,0 +1,81 @@ +let + javaTestPath = "/nix/store/j3nvmhvj2pmnykw5pbm51dn0bz4cv6j3-vscode-extension-vscjava-vscode-java-test-0.38.2023032402/share/vscode/extensions/vscjava.vscode-java-test/server/com.microsoft.java.test.plugin-0.38.2.jar + "; +in { + plugins.nvim-jdtls = { + enable = true; + cmd = [ + "/nix/store/20h2hjjm94gbskqhbwikbgxbblv1xpf2-jdt-language-server-1.31.0/bin/jdtls" + ]; + # configuration = "/path/to/configuration"; + data = "~/.cache/jdtls/workspace"; + settings = { + java = { + signatureHelp = true; + completion = true; + }; + }; + initOptions = { + bundles = [ + "/nix/store/b9ib40q36wxjl4xs5lng263lflz1fsi7-vscode-extension-vscjava-vscode-java-debug-0.49.2023032407/share/vscode/extensions/vscjava.vscode-java-debug/server/com.microsoft.java.debug.plugin-0.44.0.jar" + "${javaTestPath}" + ]; + }; + }; +} +# +# extraConfigLua = '' +# local jdtls = require("jdtls") +# local cmp_nvim_lsp = require("cmp_nvim_lsp") +# +# local root_dir = require("jdtls.setup").find_root({ "packageInfo" }, "Config") +# local home = os.getenv("HOME") +# local eclipse_workspace = home .. "/.local/share/eclipse/" .. vim.fn.fnamemodify(root_dir, ":p:h:t") +# +# local ws_folders_jdtls = {} +# if root_dir then +# local file = io.open(root_dir .. "/.bemol/ws_root_folders") +# if file then +# for line in file:lines() do +# table.insert(ws_folders_jdtls, "file://" .. line) +# end +# file:close() +# end +# end +# +# -- for completions +# local client_capabilities = vim.lsp.protocol.make_client_capabilities() +# local capabilities = cmp_nvim_lsp.default_capabilities(client_capabilities) +# +# local config = { +# capabilities = capabilities, +# cmd = { +# "${pkgs.jdt-language-server}/bin/jdt-language-server", +# "--jvm-arg=-javaagent:" .. home .. "/Developer/lombok.jar", +# "-data", +# eclipse_workspace, +# "--add-modules=ALL-SYSTEM", +# }, +# root_dir = root_dir, +# init_options = { +# workspaceFolders = ws_folders_jdtls, +# }, +# settings = { +# java = { +# signatureHelp = { enabled = true}, +# completion = { enabled = true }, +# }, +# }, +# on_attach = function(client, bufnr) +# local opts = { silent = true, buffer = bufnr } +# vim.keymap.set('n', "lo", jdtls.organize_imports, { desc = 'Organize imports', buffer = bufnr }) +# vim.keymap.set('n', "df", jdtls.test_class, opts) +# vim.keymap.set('n', "dn", jdtls.test_nearest_method, opts) +# vim.keymap.set('n', 'rv', jdtls.extract_variable_all, { desc = 'Extract variable', buffer = bufnr }) +# vim.keymap.set('n', 'rc', jdtls.extract_constant, { desc = 'Extract constant', buffer = bufnr }) +# end +# } +# +# jdtls.start_or_attach(config) +# ''; + diff --git a/pkgs/nvim/config/languages/nvim-lint.nix b/pkgs/nvim/config/languages/nvim-lint.nix new file mode 100644 index 0000000..db8f109 --- /dev/null +++ b/pkgs/nvim/config/languages/nvim-lint.nix @@ -0,0 +1,16 @@ +{ + plugins.lint = { + enable = true; + lintersByFt = { + nix = ["statix"]; + lua = ["selene"]; + python = ["flake8"]; + javascript = ["eslint_d"]; + javascriptreact = ["eslint_d"]; + typescript = ["eslint_d"]; + typescriptreact = ["eslint_d"]; + json = ["jsonlint"]; + java = ["checkstyle"]; + }; + }; +} diff --git a/pkgs/nvim/config/languages/treesitter/treesitter-context.nix b/pkgs/nvim/config/languages/treesitter/treesitter-context.nix new file mode 100644 index 0000000..b588c8f --- /dev/null +++ b/pkgs/nvim/config/languages/treesitter/treesitter-context.nix @@ -0,0 +1,5 @@ +{ + plugins.treesitter-context = { + enable = true; + }; +} diff --git a/pkgs/nvim/config/languages/treesitter/treesitter-textobjects.nix b/pkgs/nvim/config/languages/treesitter/treesitter-textobjects.nix new file mode 100644 index 0000000..29820cf --- /dev/null +++ b/pkgs/nvim/config/languages/treesitter/treesitter-textobjects.nix @@ -0,0 +1,50 @@ +{ + plugins.treesitter-textobjects = { + enable = false; + select = { + enable = true; + lookahead = true; + keymaps = { + "aa" = "@parameter.outer"; + "ia" = "@parameter.inner"; + "af" = "@function.outer"; + "if" = "@function.inner"; + "ac" = "@class.outer"; + "ic" = "@class.inner"; + "ii" = "@conditional.inner"; + "ai" = "@conditional.outer"; + "il" = "@loop.inner"; + "al" = "@loop.outer"; + "at" = "@comment.outer"; + }; + }; + move = { + enable = true; + gotoNextStart = { + "]m" = "@function.outer"; + "]]" = "@class.outer"; + }; + gotoNextEnd = { + "]M" = "@function.outer"; + "][" = "@class.outer"; + }; + gotoPreviousStart = { + "[m" = "@function.outer"; + "[[" = "@class.outer"; + }; + gotoPreviousEnd = { + "[M" = "@function.outer"; + "[]" = "@class.outer"; + }; + }; + swap = { + enable = true; + swapNext = { + "a" = "@parameters.inner"; + }; + swapPrevious = { + "A" = "@parameter.outer"; + }; + }; + }; +} diff --git a/pkgs/nvim/config/languages/treesitter/treesitter.nix b/pkgs/nvim/config/languages/treesitter/treesitter.nix new file mode 100644 index 0000000..8ff420f --- /dev/null +++ b/pkgs/nvim/config/languages/treesitter/treesitter.nix @@ -0,0 +1,8 @@ +{ + plugins.treesitter = { + enable = true; + indent = true; + folding = true; + nixvimInjections = true; + }; +} diff --git a/pkgs/nvim/config/languages/treesitter/ts-autotag.nix b/pkgs/nvim/config/languages/treesitter/ts-autotag.nix new file mode 100644 index 0000000..9fa6d84 --- /dev/null +++ b/pkgs/nvim/config/languages/treesitter/ts-autotag.nix @@ -0,0 +1,5 @@ +{ + plugins.ts-autotag = { + enable = true; + }; +} diff --git a/pkgs/nvim/config/languages/treesitter/ts-context-commentstring.nix b/pkgs/nvim/config/languages/treesitter/ts-context-commentstring.nix new file mode 100644 index 0000000..aad1ce0 --- /dev/null +++ b/pkgs/nvim/config/languages/treesitter/ts-context-commentstring.nix @@ -0,0 +1,6 @@ +{ + plugins.ts-context-commentstring = { + enable = true; + disableAutoInitialization = false; + }; +} diff --git a/pkgs/nvim/config/languages/typescript-tools-nvim.nix b/pkgs/nvim/config/languages/typescript-tools-nvim.nix new file mode 100644 index 0000000..8134073 --- /dev/null +++ b/pkgs/nvim/config/languages/typescript-tools-nvim.nix @@ -0,0 +1,47 @@ +{ + plugins.typescript-tools = { + enable = true; + onAttach = '' + function(client, bufnr) + client.server_capabilities.documentFormattingProvider = false + client.server_capabilities.documentRangeFormattingProvider = false + + if vim.lsp.inlay_hint then + vim.lsp.inlay_hint(bufnr, true) + end + end + ''; + settings = { + tsserverFilePreferences = { + # Inlay Hints + includeInlayParameterNameHints = "all"; + includeInlayParameterNameHintsWhenArgumentMatchesName = true; + includeInlayFunctionParameterTypeHints = true; + includeInlayVariableTypeHints = true; + includeInlayVariableTypeHintsWhenTypeMatchesName = true; + includeInlayPropertyDeclarationTypeHints = true; + includeInlayFunctionLikeReturnTypeHints = true; + includeInlayEnumMemberValueHints = true; + }; + }; + }; + + keymaps = [ + { + mode = "n"; + key = "co"; + action = "TSToolsOrganizeImports"; + options = { + desc = "Organize Imports"; + }; + } + { + mode = "n"; + key = "cR"; + action = "TSToolsRemoveUnusedImports"; + options = { + desc = "Remove Unused Imports"; + }; + } + ]; +} diff --git a/pkgs/nvim/config/lsp/conform.nix b/pkgs/nvim/config/lsp/conform.nix new file mode 100644 index 0000000..d252da6 --- /dev/null +++ b/pkgs/nvim/config/lsp/conform.nix @@ -0,0 +1,92 @@ +{ + plugins.conform-nvim = { + enable = true; + notifyOnError = true; + formattersByFt = { + html = [["prettierd" "prettier"]]; + css = [["prettierd" "prettier"]]; + javascript = [["prettierd" "prettier"]]; + javascriptreact = [["prettierd" "prettier"]]; + typescript = [["prettierd" "prettier"]]; + typescriptreact = [["prettierd" "prettier"]]; + java = ["google-java-format"]; + python = ["black"]; + lua = ["stylua"]; + nix = ["alejandra"]; + markdown = [["prettierd" "prettier"]]; + rust = ["rustfmt"]; + }; + }; + + keymaps = [ + { + mode = "n"; + key = "uf"; + action = ":FormatToggle"; + options = { + desc = "Toggle Format"; + silent = true; + }; + } + { + mode = "n"; + key = "cf"; + action = "lua require('conform').format()"; + options = { + silent = true; + desc = "Format Buffer"; + }; + } + + { + mode = "v"; + key = "cF"; + action = "lua require('conform').format()"; + options = { + silent = true; + desc = "Format Lines"; + }; + } + ]; + + extraConfigLua = '' + local conform = require("conform") + local notify = require("notify") + + conform.setup({ + format_on_save = function(bufnr) + -- Disable with a global or buffer-local variable + if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then + return + end + return { timeout_ms = 500, lsp_fallback = true } + end, + }) + + local function show_notification(message, level) + notify(message, level, { title = "conform.nvim" }) + end + + vim.api.nvim_create_user_command("FormatToggle", function(args) + local is_global = not args.bang + if is_global then + vim.g.disable_autoformat = not vim.g.disable_autoformat + if vim.g.disable_autoformat then + show_notification("Autoformat-on-save disabled globally", "info") + else + show_notification("Autoformat-on-save enabled globally", "info") + end + else + vim.b.disable_autoformat = not vim.b.disable_autoformat + if vim.b.disable_autoformat then + show_notification("Autoformat-on-save disabled for this buffer", "info") + else + show_notification("Autoformat-on-save enabled for this buffer", "info") + end + end + end, { + desc = "Toggle autoformat-on-save", + bang = true, + }) + ''; +} diff --git a/pkgs/nvim/config/lsp/fidget.nix b/pkgs/nvim/config/lsp/fidget.nix new file mode 100644 index 0000000..868f386 --- /dev/null +++ b/pkgs/nvim/config/lsp/fidget.nix @@ -0,0 +1,99 @@ +{ + plugins.fidget = { + enable = true; + logger = { + level = "warn"; # “off”, “error”, “warn”, “info”, “debug”, “trace” + floatPrecision = 0.01; # Limit the number of decimals displayed for floats + }; + progress = { + pollRate = 0; # How and when to poll for progress messages + suppressOnInsert = true; # Suppress new messages while in insert mode + ignoreDoneAlready = false; # Ignore new tasks that are already complete + ignoreEmptyMessage = false; # Ignore new tasks that don't contain a message + clearOnDetach = + # Clear notification group when LSP server detaches + '' + function(client_id) + local client = vim.lsp.get_client_by_id(client_id) + return client and client.name or nil + end + ''; + notificationGroup = + # How to get a progress message's notification group key + '' + function(msg) return msg.lsp_client.name end + ''; + ignore = []; # List of LSP servers to ignore + lsp = { + progressRingbufSize = 0; # Configure the nvim's LSP progress ring buffer size + }; + display = { + renderLimit = 16; # How many LSP messages to show at once + doneTtl = 3; # How long a message should persist after completion + doneIcon = "✔"; # Icon shown when all LSP progress tasks are complete + doneStyle = "Constant"; # Highlight group for completed LSP tasks + progressTtl = "math.huge"; # How long a message should persist when in progress + progressIcon = { + pattern = "dots"; + period = 1; + }; # Icon shown when LSP progress tasks are in progress + progressStyle = "WarningMsg"; # Highlight group for in-progress LSP tasks + groupStyle = "Title"; # Highlight group for group name (LSP server name) + iconStyle = "Question"; # Highlight group for group icons + priority = 30; # Ordering priority for LSP notification group + skipHistory = true; # Whether progress notifications should be omitted from history + formatMessage = '' + require ("fidget.progress.display").default_format_message + ''; # How to format a progress message + formatAnnote = '' + function (msg) return msg.title end + ''; # How to format a progress annotation + formatGroupName = '' + function (group) return tostring (group) end + ''; # How to format a progress notification group's name + overrides = { + rust_analyzer = { + name = "rust-analyzer"; + }; + }; # Override options from the default notification config + }; + }; + notification = { + pollRate = 10; # How frequently to update and render notifications + filter = "info"; # “off”, “error”, “warn”, “info”, “debug”, “trace” + historySize = 128; # Number of removed messages to retain in history + overrideVimNotify = true; + redirect = '' + function(msg, level, opts) + if opts and opts.on_open then + return require("fidget.integration.nvim-notify").delegate(msg, level, opts) + end + end + ''; + configs = { + default = "require('fidget.notification').default_config"; + }; + + window = { + normalHl = "Comment"; + winblend = 0; + border = "none"; # none, single, double, rounded, solid, shadow + zindex = 45; + maxWidth = 0; + maxHeight = 0; + xPadding = 1; + yPadding = 0; + align = "bottom"; + relative = "editor"; + }; + view = { + stackUpwards = true; # Display notification items from bottom to top + iconSeparator = " "; # Separator between group name and icon + groupSeparator = "---"; # Separator between notification groups + groupSeparatorHl = + # Highlight group used for group separator + "Comment"; + }; + }; + }; +} diff --git a/pkgs/nvim/config/lsp/lsp.nix b/pkgs/nvim/config/lsp/lsp.nix new file mode 100644 index 0000000..4568642 --- /dev/null +++ b/pkgs/nvim/config/lsp/lsp.nix @@ -0,0 +1,167 @@ +{ + plugins = { + lsp-format = { + enable = false; # Enable it if you want lsp-format integration for none-ls + }; + lsp = { + enable = true; + capabilities = "offsetEncoding = 'utf-16'"; + servers = { + clangd = {enable = true;}; + lua-ls = { + enable = true; + extraOptions = { + settings = { + Lua = { + completion = { + callSnippet = "Replace"; + }; + telemetry = { + enabled = false; + }; + hint = {enable = true;}; + }; + }; + }; + }; + nil_ls = {enable = true;}; + tsserver = { + enable = false; + filetypes = ["javascript" "javascriptreact" "typescript" "typescriptreact"]; + extraOptions = { + settings = { + javascript = { + inlayHints = { + includeInlayEnumMemberValueHints = true; + includeInlayFunctionLikeReturnTypeHints = true; + includeInlayFunctionParameterTypeHints = true; + includeInlayParameterNameHints = "all"; + includeInlayParameterNameHintsWhenArgumentMatchesName = true; + includeInlayPropertyDeclarationTypeHints = true; + includeInlayVariableTypeHints = true; + }; + }; + typescript = { + inlayHints = { + includeInlayEnumMemberValueHints = true; + includeInlayFunctionLikeReturnTypeHints = true; + includeInlayFunctionParameterTypeHints = true; + includeInlayParameterNameHints = "all"; + includeInlayParameterNameHintsWhenArgumentMatchesName = true; + includeInlayPropertyDeclarationTypeHints = true; + includeInlayVariableTypeHints = true; + }; + }; + }; + }; + }; + eslint = {enable = true;}; + pyright = {enable = true;}; + ruff-lsp = {enable = true;}; + + rust-analyzer = { + enable = true; + installCargo = true; + installRustc = true; + settings = { + checkOnSave = true; + check = { + command = "clippy"; + }; + # inlayHints = { + # enable = true; + # showParameterNames = true; + # parameterHintsPrefix = "<- "; + # otherHintsPrefix = "=> "; + # }; + procMacro = { + enable = true; + }; + }; + }; + }; + # keymaps = { + # silent = true; + # lspBuf = { + # gd = { + # action = "definition"; + # desc = "Goto Definition"; + # }; + # gr = { + # action = "references"; + # desc = "Goto References"; + # }; + # gD = { + # action = "declaration"; + # desc = "Goto Declaration"; + # }; + # gI = { + # action = "implementation"; + # desc = "Goto Implementation"; + # }; + # gT = { + # action = "type_definition"; + # desc = "Type Definition"; + # }; + # K = { + # action = "hover"; + # desc = "Hover"; + # }; + # "cw" = { + # action = "workspace_symbol"; + # desc = "Workspace Symbol"; + # }; + # "cr" = { + # action = "rename"; + # desc = "Rename"; + # }; + # "ca" = { + # action = "code_action"; + # desc = "Code Action"; + # }; + # "" = { + # action = "signature_help"; + # desc = "Signature Help"; + # }; + # }; + # diagnostic = { + # "cd" = { + # action = "open_float"; + # desc = "Line Diagnostics"; + # }; + # "[d" = { + # action = "goto_next"; + # desc = "Next Diagnostic"; + # }; + # "]d" = { + # action = "goto_prev"; + # desc = "Previous Diagnostic"; + # }; + # }; + # }; + }; + }; + extraConfigLua = '' + local _border = "rounded" + + vim.lsp.handlers["textDocument/hover"] = vim.lsp.with( + vim.lsp.handlers.hover, { + border = _border + } + ) + + vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( + vim.lsp.handlers.signature_help, { + border = _border + } + ) + + vim.diagnostic.config{ + float={border=_border} + }; + + require('lspconfig.ui.windows').default_options = { + border = _border + } + ''; +} diff --git a/pkgs/nvim/config/lsp/lspsaga.nix b/pkgs/nvim/config/lsp/lspsaga.nix new file mode 100644 index 0000000..6fdf5d9 --- /dev/null +++ b/pkgs/nvim/config/lsp/lspsaga.nix @@ -0,0 +1,186 @@ +{ + plugins.lspsaga = { + enable = true; + beacon = { + enable = true; + }; + ui = { + border = "rounded"; # One of none, single, double, rounded, solid, shadow + codeAction = "💡"; # Can be any symbol you want 💡 + }; + hover = { + openCmd = "!floorp"; # Choose your browser + openLink = "gx"; + }; + diagnostic = { + borderFollow = true; + diagnosticOnlyCurrent = false; + showCodeAction = true; + }; + symbolInWinbar = { + enable = true; # Breadcrumbs + }; + codeAction = { + extendGitSigns = false; + showServerName = true; + onlyInCursor = true; + numShortcut = true; + keys = { + exec = ""; + quit = ["" "q"]; + }; + }; + lightbulb = { + enable = false; + sign = false; + virtualText = true; + }; + implement = { + enable = false; + }; + rename = { + autoSave = false; + keys = { + exec = ""; + quit = ["" ""]; + select = "x"; + }; + }; + outline = { + autoClose = true; + autoPreview = true; + closeAfterJump = true; + layout = "normal"; # normal or float + winPosition = "right"; # left or right + keys = { + jump = "e"; + quit = "q"; + toggleOrJump = "o"; + }; + }; + scrollPreview = { + scrollDown = ""; + scrollUp = ""; + }; + }; + keymaps = [ + { + mode = "n"; + key = "gd"; + action = "Lspsaga finder def"; + options = { + desc = "Goto Definition"; + silent = true; + }; + } + { + mode = "n"; + key = "gr"; + action = "Lspsaga finder ref"; + options = { + desc = "Goto References"; + silent = true; + }; + } + + # { + # mode = "n"; + # key = "gD"; + # action = "Lspsaga show_line_diagnostics"; + # options = { + # desc = "Goto Declaration"; + # silent = true; + # }; + # } + + { + mode = "n"; + key = "gI"; + action = "Lspsaga finder imp"; + options = { + desc = "Goto Implementation"; + silent = true; + }; + } + + { + mode = "n"; + key = "gT"; + action = "Lspsaga peek_type_definition"; + options = { + desc = "Type Definition"; + silent = true; + }; + } + + { + mode = "n"; + key = "K"; + action = "Lspsaga hover_doc"; + options = { + desc = "Hover"; + silent = true; + }; + } + + { + mode = "n"; + key = "cw"; + action = "Lspsaga outline"; + options = { + desc = "Outline"; + silent = true; + }; + } + + { + mode = "n"; + key = "cr"; + action = "Lspsaga rename"; + options = { + desc = "Rename"; + silent = true; + }; + } + + { + mode = "n"; + key = "ca"; + action = "Lspsaga code_action"; + options = { + desc = "Code Action"; + silent = true; + }; + } + + { + mode = "n"; + key = "cd"; + action = "Lspsaga show_line_diagnostics"; + options = { + desc = "Line Diagnostics"; + silent = true; + }; + } + + { + mode = "n"; + key = "[d"; + action = "Lspsaga diagnostic_jump_next"; + options = { + desc = "Next Diagnostic"; + silent = true; + }; + } + + { + mode = "n"; + key = "]d"; + action = "Lspsaga diagnostic_jump_prev"; + options = { + desc = "Previous Diagnostic"; + silent = true; + }; + } + ]; +} diff --git a/pkgs/nvim/config/lsp/trouble.nix b/pkgs/nvim/config/lsp/trouble.nix new file mode 100644 index 0000000..783aa08 --- /dev/null +++ b/pkgs/nvim/config/lsp/trouble.nix @@ -0,0 +1,52 @@ +{ + plugins.trouble = { + enable = true; + settings = { + auto_close = true; + }; + }; + # TODO: Add keybinds to close trouble (q would be nice), rn I need to use :x to close it... + keymaps = [ + { + mode = "n"; + key = "x"; + action = "+diagnostics/quickfix"; + } + { + mode = "n"; + key = "xx"; + action = "TroubleToggle"; + options = { + silent = true; + desc = "Document Diagnostics (Trouble)"; + }; + } + { + mode = "n"; + key = "xX"; + action = "TroubleToggle workspace_diagnostics"; + options = { + silent = true; + desc = "Workspace Diagnostics (Trouble)"; + }; + } + { + mode = "n"; + key = "xt"; + action = "TroubleToggle todo"; + options = { + silent = true; + desc = "Todo (Trouble)"; + }; + } + { + mode = "n"; + key = "xQ"; + action = "TodoQuickFix"; + options = { + silent = true; + desc = "Quickfix List (Trouble)"; + }; + } + ]; +} diff --git a/pkgs/nvim/config/none-ls/none-ls.nix b/pkgs/nvim/config/none-ls/none-ls.nix new file mode 100644 index 0000000..5eaaf6d --- /dev/null +++ b/pkgs/nvim/config/none-ls/none-ls.nix @@ -0,0 +1,73 @@ +{ + plugins.none-ls = { + enable = false; + enableLspFormat = false; + updateInInsert = false; + onAttach = '' + function(client, bufnr) + if client.supports_method "textDocument/formatting" then + vim.api.nvim_clear_autocmds { group = augroup, buffer = bufnr } + vim.api.nvim_create_autocmd("BufWritePre", { + group = augroup, + buffer = bufnr, + callback = function() + vim.lsp.buf.format { bufnr = bufnr } + end, + }) + end + end + ''; + sources = { + code_actions = { + gitsigns.enable = true; + statix.enable = true; + }; + diagnostics = { + checkstyle = { + enable = true; + }; + statix = { + enable = true; + }; + }; + formatting = { + alejandra = { + enable = true; + }; + prettier = { + enable = true; + withArgs = '' + { + extra_args = { "--no-semi", "--single-quote" }, + } + ''; + }; + google_java_format = { + enable = true; + }; + stylua = { + enable = true; + }; + black = { + enable = true; + withArgs = '' + { + extra_args = { "--fast" }, + } + ''; + }; + }; + }; + }; + # keymaps = [ + # { + # mode = [ "n" "v" ]; + # key = "cf"; + # action = "lua vim.lsp.buf.format()"; + # options = { + # silent = true; + # desc = "Format"; + # }; + # } + # ]; +} diff --git a/pkgs/nvim/config/sets.nix b/pkgs/nvim/config/sets.nix new file mode 100644 index 0000000..d50f286 --- /dev/null +++ b/pkgs/nvim/config/sets.nix @@ -0,0 +1,145 @@ +{ + pkgs, + lib, + config, + ... +}: { + config = { + opts = { + # Enable relative line numbers + number = true; + relativenumber = true; + + # Set tabs to 2 spaces + tabstop = 2; + softtabstop = 2; + showtabline = 2; + expandtab = true; + + # Enable auto indenting and set it to spaces + smartindent = true; + shiftwidth = 2; + + # Enable smart indenting (see https://stackoverflow.com/questions/1204149/smart-wrap-in-vim) + breakindent = true; + + # Enable incremental searching + hlsearch = true; + incsearch = true; + + # Enable text wrap + wrap = true; + + # Better splitting + splitbelow = true; + splitright = true; + + # Enable mouse mode + mouse = "a"; # Mouse + + # Enable ignorecase + smartcase for better searching + ignorecase = true; + smartcase = true; # Don't ignore case with capitals + grepprg = "rg --vimgrep"; + grepformat = "%f:%l:%c:%m"; + + # Decrease updatetime + updatetime = 50; # faster completion (4000ms default) + + # Set completeopt to have a better completion experience + completeopt = ["menuone" "noselect" "noinsert"]; # mostly just for cmp + + # Enable persistent undo history + swapfile = false; + backup = false; + undofile = true; + + # Enable 24-bit colors + termguicolors = true; + + # Enable the sign column to prevent the screen from jumping + signcolumn = "yes"; + + # Enable cursor line highlight + cursorline = true; # Highlight the line where the cursor is located + + # Set fold settings + # These options were reccommended by nvim-ufo + # See: https://github.com/kevinhwang91/nvim-ufo#minimal-configuration + foldcolumn = "0"; + foldlevel = 99; + foldlevelstart = 99; + foldenable = true; + + # Always keep 8 lines above/below cursor unless at start/end of file + scrolloff = 8; + + # Place a column line + colorcolumn = "80"; + + # Reduce which-key timeout to 10ms + timeoutlen = 10; + + # Set encoding type + encoding = "utf-8"; + fileencoding = "utf-8"; + + # Change cursor options + guicursor = [ + "n-v-c:block" # Normal, visual, command-line: block cursor + "i-ci-ve:block" # Insert, command-line insert, visual-exclude: vertical bar cursor with block cursor, use "ver25" for 25% width + "r-cr:hor20" # Replace, command-line replace: horizontal bar cursor with 20% height + "o:hor50" # Operator-pending: horizontal bar cursor with 50% height + "a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor" # All modes: blinking settings + "sm:block-blinkwait175-blinkoff150-blinkon175" # Showmatch: block cursor with specific blinking settings + ]; + + # Enable chars list + list = true; # Show invisible characters (tabs, eol, ...) + listchars = "eol:↲,tab:|->,lead:·,space: ,trail:•,extends:→,precedes:←,nbsp:␣"; + + # More space in the neovim command line for displaying messages + cmdheight = 2; + + # We don't need to see things like INSERT anymore + showmode = false; + + # Maximum number of items to show in the popup menu (0 means "use available screen space") + pumheight = 0; + + # Use conform-nvim for gq formatting. ('formatexpr' is set to vim.lsp.formatexpr(), so you can format lines via gq if the language server supports it) + formatexpr = "v:lua.require'conform'.formatexpr()"; + + laststatus = 3; # (https://neovim.io/doc/user/options.html#'laststatus') + }; + + extraConfigLua = '' + local opt = vim.opt + local g = vim.g + local o = vim.o + -- Neovide + if g.neovide then + -- Neovide options + g.neovide_fullscreen = false + g.neovide_hide_mouse_when_typing = false + g.neovide_refresh_rate = 165 + g.neovide_cursor_vfx_mode = "ripple" + g.neovide_cursor_animate_command_line = true + g.neovide_cursor_animate_in_insert_mode = true + g.neovide_cursor_vfx_particle_lifetime = 5.0 + g.neovide_cursor_vfx_particle_density = 14.0 + g.neovide_cursor_vfx_particle_speed = 12.0 + g.neovide_transparency = 0.8 + + -- Neovide Fonts + o.guifont = "MonoLisa Trial:Medium:h15" + -- o.guifont = "CommitMono:Medium:h15" + -- o.guifont = "JetBrainsMono Nerd Font:h14:Medium:i" + -- o.guifont = "FiraMono Nerd Font:Medium:h14" + -- o.guifont = "CaskaydiaCove Nerd Font:h14:b:i" + -- o.guifont = "BlexMono Nerd Font Mono:h14:Medium:i" + -- o.guifont = "Liga SFMono Nerd Font:b:h15" + end + ''; + }; +} diff --git a/pkgs/nvim/config/snippets/luasnip.nix b/pkgs/nvim/config/snippets/luasnip.nix new file mode 100644 index 0000000..02d9ee0 --- /dev/null +++ b/pkgs/nvim/config/snippets/luasnip.nix @@ -0,0 +1,19 @@ +{ + pkgs, + config, + ... +}: { + plugins.luasnip = { + enable = true; + extraConfig = { + enable_autosnippets = true; + store_selection_keys = ""; + }; + fromVscode = [ + { + lazyLoad = true; + paths = "${pkgs.vimPlugins.friendly-snippets}"; + } + ]; + }; +} diff --git a/pkgs/nvim/config/statusline/lualine.nix b/pkgs/nvim/config/statusline/lualine.nix new file mode 100644 index 0000000..1a2d424 --- /dev/null +++ b/pkgs/nvim/config/statusline/lualine.nix @@ -0,0 +1,33 @@ +{ + plugins.lualine = { + enable = false; + alwaysDivideMiddle = true; + globalstatus = true; + ignoreFocus = ["neo-tree"]; + extensions = ["fzf"]; + theme = "auto"; + componentSeparators = { + left = "|"; + right = "|"; + }; + sectionSeparators = { + left = "█"; #  + right = "█"; #  + }; + sections = { + lualine_a = ["mode"]; + lualine_b = [ + { + name = "branch"; + icon = ""; + } + "diff" + "diagnostics" + ]; + lualine_c = ["filename"]; + lualine_x = ["filetype"]; + lualine_y = ["progress"]; + lualine_z = [''" " .. os.date("%R")'']; + }; + }; +} diff --git a/pkgs/nvim/config/statusline/staline.nix b/pkgs/nvim/config/statusline/staline.nix new file mode 100644 index 0000000..ae07bb8 --- /dev/null +++ b/pkgs/nvim/config/statusline/staline.nix @@ -0,0 +1,65 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimUtils; [ + (buildVimPlugin { + pname = "staline.nvim"; + version = "2024-02-05"; + src = pkgs.fetchFromGitHub { + owner = "tamton-aquib"; + repo = "staline.nvim"; + rev = "a53f869278b8b186a5afd6f21680cd103c381599"; + hash = "sha256-GDMKzxFDtQk5LL+rMsxTGTyLv69w5NUd+u19noeO5ws="; + }; + }) + ]; + extraConfigLua = '' + require("staline").setup({ + sections = { + left = { "-mode", " ", "branch" }, + mid = { "lsp_name" }, + right = { "file_name", "line_column" }, + }, + inactive_sections = { + left = { "-mode", " ", "branch" }, + mid = { "lsp_name" }, + right = { "file_name", "line_column" }, + }, + defaults = { + left_separator = " ", + right_separator = " ", + branch_symbol = " ", + mod_symbol = "", + line_column = "[%l/%L]", + inactive_color = "#80a6f2", --#303030 is the default + inactive_bgcolor = "none", + }, + special_table = { + lazy = { "Plugins", "💤 " }, + TelescopePrompt = { "Telescope", " " }, + oil = { "Oil", "󰏇 " }, + lazygit = { "LazyGit", " " }, + }, + mode_icons = { + ["n"] = "NORMAL", + ["no"] = "NORMAL", + ["nov"] = "NORMAL", + ["noV"] = "NORMAL", + ["niI"] = "NORMAL", + ["niR"] = "NORMAL", + ["niV"] = "NORMAL", + ["i"] = "INSERT", + ["ic"] = "INSERT", + ["ix"] = "INSERT", + ["s"] = "INSERT", + ["S"] = "INSERT", + ["v"] = "VISUAL", + ["V"] = "VISUAL", + [""] = "VISUAL", + ["r"] = "REPLACE", + ["r?"] = "REPLACE", + ["R"] = "REPLACE", + ["c"] = "COMMAND", + ["t"] = "TERMINAL", + }, + }) + ''; +} diff --git a/pkgs/nvim/config/telescope/telescope.nix b/pkgs/nvim/config/telescope/telescope.nix new file mode 100644 index 0000000..508521c --- /dev/null +++ b/pkgs/nvim/config/telescope/telescope.nix @@ -0,0 +1,178 @@ +{ + plugins.telescope = { + enable = true; + + extensions = { + fzf-native = { + enable = true; + }; + ui-select = { + settings = { + specific_opts = { + codeactions = true; + }; + }; + }; + undo = { + enable = true; + }; + }; + # If you'd prefer Telescope not to enter a normal-like mode when hitting escape (and instead exiting), you can map to do so via: + settings = { + defaults = { + mappings = { + i = { + "" = { + __raw = '' + function(...) + return require("telescope.actions").close(...) + end''; + }; + }; + }; + }; + }; + keymaps = { + "" = { + action = "find_files, {}"; + options.desc = "Find project files"; + }; + "/" = { + action = "live_grep"; + options.desc = "Grep (root dir)"; + }; + ":" = { + action = "command_history, {}"; + options.desc = "Command History"; + }; + "b" = { + action = "buffers, {}"; + options.desc = "+buffer"; + }; + "ff" = { + action = "find_files, {}"; + options.desc = "Find project files"; + }; + "fr" = { + action = "oldfiles, {}"; + options.desc = "Recent"; + }; + "fb" = { + action = "buffers, {}"; + options.desc = "Buffers"; + }; + "" = { + action = "git_files, {}"; + options.desc = "Search git files"; + }; + "gc" = { + action = "git_commits, {}"; + options.desc = "Commits"; + }; + "gs" = { + action = "git_status, {}"; + options.desc = "Status"; + }; + "sa" = { + action = "autocommands, {}"; + options.desc = "Auto Commands"; + }; + "sb" = { + action = "current_buffer_fuzzy_find, {}"; + options.desc = "Buffer"; + }; + "sc" = { + action = "command_history, {}"; + options.desc = "Command History"; + }; + "sC" = { + action = "commands, {}"; + options.desc = "Commands"; + }; + "sD" = { + action = "diagnostics, {}"; + options.desc = "Workspace diagnostics"; + }; + "sh" = { + action = "help_tags, {}"; + options.desc = "Help pages"; + }; + "sH" = { + action = "highlights, {}"; + options.desc = "Search Highlight Groups"; + }; + "sk" = { + action = "keymaps, {}"; + options.desc = "Keymaps"; + }; + "sM" = { + action = "man_pages, {}"; + options.desc = "Man pages"; + }; + "sm" = { + action = "marks, {}"; + options.desc = "Jump to Mark"; + }; + "so" = { + action = "vim_options, {}"; + options.desc = "Options"; + }; + "sR" = { + action = "resume, {}"; + options.desc = "Resume"; + }; + "uC" = { + action = "colorscheme, {}"; + options.desc = "Colorscheme preview"; + }; + }; + }; + keymaps = [ + { + mode = "n"; + key = "fp"; + action = "Telescope projects"; + options = { + desc = "Projects"; + }; + } + + { + mode = "n"; + key = "sd"; + action = "Telescope diagnostics bufnr=0"; + options = { + desc = "Document diagnostics"; + }; + } + + { + mode = "n"; + key = "st"; + action = "TodoTelescope"; + options = { + silent = true; + desc = "Todo (Telescope)"; + }; + } + + # { + # mode = "n"; + # key = ","; + # action = "Telescope buffers sort_mru=true sort_lastused=true"; + # options = { + # desc = "Switch Buffer"; + # }; + # } + ]; + extraConfigLua = '' + local telescope = require('telescope') + telescope.setup{ + pickers = { + colorscheme = { + enable_preview = true + } + } + } + ''; +} diff --git a/pkgs/nvim/config/ui/alpha.nix b/pkgs/nvim/config/ui/alpha.nix new file mode 100644 index 0000000..69658ae --- /dev/null +++ b/pkgs/nvim/config/ui/alpha.nix @@ -0,0 +1,191 @@ +{ + plugins.alpha = { + enable = true; + theme = null; + iconsEnabled = true; + layout = let + padding = val: { + type = "padding"; + inherit val; + }; + in [ + (padding 4) + { + opts = { + hl = "AlphaHeader"; + position = "center"; + }; + type = "text"; + val = [ + " ██▀███ ▓█████ ▓█████▄▓██ ██▓ █████▒ " + " ▓██ ▒ ██▒▓█ ▀ ▒██▀ ██▌▒██ ██▒▓██ ▒ " + " ▓██ ░▄█ ▒▒███ ░██ █▌ ▒██ ██░▒████ ░ " + " ▒██▀▀█▄ ▒▓█ ▄ ░▓█▄ ▌ ░ ▐██▓░░▓█▒ ░ " + " ░██▓ ▒██▒░▒████▒░▒████▓ ░ ██▒▓░░▒█░ " + " ░ ▒▓ ░▒▓░░░ ▒░ ░ ▒▒▓ ▒ ██▒▒▒ ▒ ░ " + " ░▒ ░ ▒░ ░ ░ ░ ░ ▒ ▒ ▓██ ░▒░ ░ " + " ░░ ░ ░ ░ ░ ░ ▒ ▒ ░░ ░ ░ " + " ░ ░ ░ ░ ░ ░ " + " " + " git@github.com:redyf " + ]; + } + (padding 2) + { + type = "button"; + val = " Find File"; + on_press.raw = "require('telescope.builtin').find_files"; + opts = { + # hl = "comment"; + keymap = [ + "n" + "f" + ":Telescope find_files " + { + noremap = true; + silent = true; + nowait = true; + } + ]; + shortcut = "f"; + + position = "center"; + cursor = 3; + width = 38; + align_shortcut = "right"; + hl_shortcut = "Keyword"; + }; + } + (padding 1) + { + type = "button"; + val = " New File"; + on_press.__raw = "function() vim.cmd[[ene]] end"; + opts = { + # hl = "comment"; + keymap = [ + "n" + "n" + ":ene startinsert " + { + noremap = true; + silent = true; + nowait = true; + } + ]; + shortcut = "n"; + + position = "center"; + cursor = 3; + width = 38; + align_shortcut = "right"; + hl_shortcut = "Keyword"; + }; + } + (padding 1) + { + type = "button"; + val = "󰈚 Recent Files"; + on_press.raw = "require('telescope.builtin').oldfiles"; + opts = { + # hl = "comment"; + keymap = [ + "n" + "r" + ":Telescope oldfiles " + { + noremap = true; + silent = true; + nowait = true; + } + ]; + shortcut = "r"; + + position = "center"; + cursor = 3; + width = 38; + align_shortcut = "right"; + hl_shortcut = "Keyword"; + }; + } + (padding 1) + { + type = "button"; + val = "󰈭 Find Word"; + on_press.raw = "require('telescope.builtin').live_grep"; + opts = { + # hl = "comment"; + keymap = [ + "n" + "g" + ":Telescope live_grep " + { + noremap = true; + silent = true; + nowait = true; + } + ]; + shortcut = "g"; + + position = "center"; + cursor = 3; + width = 38; + align_shortcut = "right"; + hl_shortcut = "Keyword"; + }; + } + (padding 1) + { + type = "button"; + val = " Restore Session"; + on_press.raw = "require('persistence').load()"; + opts = { + # hl = "comment"; + keymap = [ + "n" + "s" + ":lua require('persistence').load()" + { + noremap = true; + silent = true; + nowait = true; + } + ]; + shortcut = "s"; + + position = "center"; + cursor = 3; + width = 38; + align_shortcut = "right"; + hl_shortcut = "Keyword"; + }; + } + (padding 1) + { + type = "button"; + val = " Quit Neovim"; + on_press.__raw = "function() vim.cmd[[qa]] end"; + opts = { + # hl = "comment"; + keymap = [ + "n" + "q" + ":qa" + { + noremap = true; + silent = true; + nowait = true; + } + ]; + shortcut = "q"; + + position = "center"; + cursor = 3; + width = 38; + align_shortcut = "right"; + hl_shortcut = "Keyword"; + }; + } + ]; + }; +} diff --git a/pkgs/nvim/config/ui/dressing-nvim.nix b/pkgs/nvim/config/ui/dressing-nvim.nix new file mode 100644 index 0000000..9f4374b --- /dev/null +++ b/pkgs/nvim/config/ui/dressing-nvim.nix @@ -0,0 +1,171 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimPlugins; [ + dressing-nvim + ]; + extraConfigLua = '' + require("dressing").setup({ + input = { + -- Set to false to disable the vim.ui.input implementation + enabled = true, + + -- Default prompt string + default_prompt = "Input", + + -- Trim trailing `:` from prompt + trim_prompt = true, + + -- Can be 'left', 'right', or 'center' + title_pos = "left", + + -- When true, will close the modal + insert_only = true, + + -- When true, input will start in insert mode. + start_in_insert = true, + + -- These are passed to nvim_open_win + border = "rounded", + -- 'editor' and 'win' will default to being centered + relative = "cursor", + + -- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) + prefer_width = 40, + width = nil, + -- min_width and max_width can be a list of mixed types. + -- min_width = {20, 0.2} means "the greater of 20 columns or 20% of total" + max_width = { 140, 0.9 }, + min_width = { 20, 0.2 }, + + buf_options = {}, + win_options = { + -- Disable line wrapping + wrap = false, + -- Indicator for when text exceeds window + list = true, + listchars = "precedes:…,extends:…", + -- Increase this for more context when text scrolls off the window + sidescrolloff = 0, + }, + + -- Set to `false` to disable + mappings = { + n = { + [""] = "Close", + [""] = "Confirm", + }, + i = { + [""] = "Close", + [""] = "Confirm", + [""] = "HistoryPrev", + [""] = "HistoryNext", + }, + }, + + override = function(conf) + -- This is the config that will be passed to nvim_open_win. + -- Change values here to customize the layout + return conf + end, + + -- see :help dressing_get_config + get_config = nil, + }, + select = { + -- Set to false to disable the vim.ui.select implementation + enabled = true, + + -- Priority list of preferred vim.select implementations + backend = { "telescope", "fzf_lua", "fzf", "builtin", "nui" }, + + -- Trim trailing `:` from prompt + trim_prompt = true, + + -- Options for telescope selector + -- These are passed into the telescope picker directly. Can be used like: + -- telescope = require('telescope.themes').get_ivy({...}) + telescope = nil, + + -- Options for fzf selector + fzf = { + window = { + width = 0.5, + height = 0.4, + }, + }, + + -- Options for fzf-lua + fzf_lua = { + -- winopts = { + -- height = 0.5, + -- width = 0.5, + -- }, + }, + + -- Options for nui Menu + nui = { + position = "50%", + size = nil, + relative = "editor", + border = { + style = "rounded", + }, + buf_options = { + swapfile = false, + filetype = "DressingSelect", + }, + win_options = { + winblend = 0, + }, + max_width = 80, + max_height = 40, + min_width = 40, + min_height = 10, + }, + + -- Options for built-in selector + builtin = { + -- Display numbers for options and set up keymaps + show_numbers = true, + -- These are passed to nvim_open_win + border = "rounded", + -- 'editor' and 'win' will default to being centered + relative = "editor", + + buf_options = {}, + win_options = { + cursorline = true, + cursorlineopt = "both", + }, + + -- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) + -- the min_ and max_ options can be a list of mixed types. + -- max_width = {140, 0.8} means "the lesser of 140 columns or 80% of total" + width = nil, + max_width = { 140, 0.8 }, + min_width = { 40, 0.2 }, + height = nil, + max_height = 0.9, + min_height = { 10, 0.2 }, + + -- Set to `false` to disable + mappings = { + [""] = "Close", + [""] = "Close", + [""] = "Confirm", + }, + + override = function(conf) + -- This is the config that will be passed to nvim_open_win. + -- Change values here to customize the layout + return conf + end, + }, + + -- Used to override format_item. See :help dressing-format + format_item_override = {}, + + -- see :help dressing_get_config + get_config = nil, + }, + }) ''; +} diff --git a/pkgs/nvim/config/ui/indent-blankline.nix b/pkgs/nvim/config/ui/indent-blankline.nix new file mode 100644 index 0000000..1c382c8 --- /dev/null +++ b/pkgs/nvim/config/ui/indent-blankline.nix @@ -0,0 +1,32 @@ +{ + plugins = { + indent-blankline = { + enable = true; + settings = { + indent = { + char = "│"; # "│" or "▎" + }; + scope = { + enabled = true; + show_start = true; + }; + exclude = { + buftypes = ["terminal" "nofile"]; + filetypes = [ + "help" + "alpha" + "dashboard" + "neo-tree" + "Trouble" + "trouble" + "lazy" + "mason" + "notify" + "toggleterm" + "lazyterm" + ]; + }; + }; + }; + }; +} diff --git a/pkgs/nvim/config/ui/noice.nix b/pkgs/nvim/config/ui/noice.nix new file mode 100644 index 0000000..51db89d --- /dev/null +++ b/pkgs/nvim/config/ui/noice.nix @@ -0,0 +1,36 @@ +{ + plugins.noice = { + enable = true; + notify = { + enabled = false; + }; + messages = { + enabled = true; # Adds a padding-bottom to neovim statusline when set to false for some reason + }; + lsp = { + message = { + enabled = true; + }; + progress = { + enabled = false; + view = "mini"; + }; + }; + popupmenu = { + enabled = true; + backend = "nui"; + }; + format = { + filter = { + pattern = [":%s*%%s*s:%s*" ":%s*%%s*s!%s*" ":%s*%%s*s/%s*" "%s*s:%s*" ":%s*s!%s*" ":%s*s/%s*"]; + icon = ""; + lang = "regex"; + }; + replace = { + pattern = [":%s*%%s*s:%w*:%s*" ":%s*%%s*s!%w*!%s*" ":%s*%%s*s/%w*/%s*" "%s*s:%w*:%s*" ":%s*s!%w*!%s*" ":%s*s/%w*/%s*"]; + icon = "󱞪"; + lang = "regex"; + }; + }; + }; +} diff --git a/pkgs/nvim/config/ui/nui.nix b/pkgs/nvim/config/ui/nui.nix new file mode 100644 index 0000000..f2710a3 --- /dev/null +++ b/pkgs/nvim/config/ui/nui.nix @@ -0,0 +1,3 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimPlugins; [nui-nvim]; +} diff --git a/pkgs/nvim/config/ui/nvim-notify.nix b/pkgs/nvim/config/ui/nvim-notify.nix new file mode 100644 index 0000000..30441ce --- /dev/null +++ b/pkgs/nvim/config/ui/nvim-notify.nix @@ -0,0 +1,44 @@ +{ + plugins.notify = { + enable = true; + backgroundColour = "#000000"; + fps = 60; + render = "default"; + timeout = 500; + topDown = true; + }; + keymaps = [ + { + mode = "n"; + key = "un"; + action = '' + lua require("notify").dismiss({ silent = true, pending = true }) + ''; + options = { + desc = "Dismiss All Notifications"; + }; + } + ]; + extraConfigLua = '' + local notify = require("notify") + local filtered_message = { "No information available" } + + -- Override notify function to filter out messages + ---@diagnostic disable-next-line: duplicate-set-field + vim.notify = function(message, level, opts) + local merged_opts = vim.tbl_extend("force", { + on_open = function(win) + local buf = vim.api.nvim_win_get_buf(win) + vim.api.nvim_buf_set_option(buf, "filetype", "markdown") + end, + }, opts or {}) + + for _, msg in ipairs(filtered_message) do + if message == msg then + return + end + end + return notify(message, level, merged_opts) + end + ''; +} diff --git a/pkgs/nvim/config/utils/better-escape.nix b/pkgs/nvim/config/utils/better-escape.nix new file mode 100644 index 0000000..22b136c --- /dev/null +++ b/pkgs/nvim/config/utils/better-escape.nix @@ -0,0 +1,7 @@ +{ + plugins.better-escape = { + enable = true; + clearEmptyLines = true; + timeout = 200; + }; +} diff --git a/pkgs/nvim/config/utils/flash.nix b/pkgs/nvim/config/utils/flash.nix new file mode 100644 index 0000000..b531743 --- /dev/null +++ b/pkgs/nvim/config/utils/flash.nix @@ -0,0 +1,56 @@ +{ + plugins.flash = { + enable = false; + labels = "asdfghjklqwertyuiopzxcvbnm"; + search = { + mode = "fuzzy"; + }; + jump = { + autojump = true; + }; + label = { + uppercase = false; + rainbow = { + enabled = false; + shade = 5; + }; + }; + }; + # keymaps = [ + # { + # mode = [ "n" "x" "o" ]; + # key = "s"; + # action = "lua require('flash').jump()"; + # options = { + # desc = "Flash"; + # }; + # } + # + # { + # mode = [ "n" "x" "o" ]; + # key = "S"; + # action = "lua require('flash').treesitter()"; + # options = { + # desc = "Flash Treesitter"; + # }; + # } + # + # { + # mode = "o"; + # key = "r"; + # action = "lua require('flash').remote()"; + # options = { + # desc = "Remote Flash"; + # }; + # } + # + # { + # mode = [ "x" "o" ]; + # key = "R"; + # action = "lua require('flash').treesitter_search()"; + # options = { + # desc = "Treesitter Search"; + # }; + # } + # ]; +} diff --git a/pkgs/nvim/config/utils/hardtime.nix b/pkgs/nvim/config/utils/hardtime.nix new file mode 100644 index 0000000..e4bfef4 --- /dev/null +++ b/pkgs/nvim/config/utils/hardtime.nix @@ -0,0 +1,26 @@ +{ + plugins.hardtime = { + enable = true; + enabled = false; + disableMouse = true; + disabledFiletypes = ["neo-tree" "qf" "netrw" "NvimTree"]; + hint = true; + maxCount = 4; + maxTime = 1000; + restrictionMode = "hint"; + restrictedKeys = { + "h" = ["n" "x"]; + "j" = ["n" "x"]; + "k" = ["n" "x"]; + "l" = ["n" "x"]; + "-" = ["n" "x"]; + "+" = ["n" "x"]; + "gj" = ["n" "x"]; + "gk" = ["n" "x"]; + "" = ["n" "x"]; + "" = ["n" "x"]; + "" = ["n" "x"]; + "" = ["n" "x"]; + }; + }; +} diff --git a/pkgs/nvim/config/utils/harpoon.nix b/pkgs/nvim/config/utils/harpoon.nix new file mode 100644 index 0000000..b55df68 --- /dev/null +++ b/pkgs/nvim/config/utils/harpoon.nix @@ -0,0 +1,17 @@ +{ + plugins.harpoon = { + enable = true; + enableTelescope = true; + keymapsSilent = true; + keymaps = { + addFile = "ha"; + toggleQuickMenu = ""; + navFile = { + "1" = "hj"; + "2" = "hk"; + "3" = "hl"; + "4" = "hm"; + }; + }; + }; +} diff --git a/pkgs/nvim/config/utils/illuminate.nix b/pkgs/nvim/config/utils/illuminate.nix new file mode 100644 index 0000000..c05bc15 --- /dev/null +++ b/pkgs/nvim/config/utils/illuminate.nix @@ -0,0 +1,17 @@ +{ + plugins.illuminate = { + enable = false; + underCursor = false; + filetypesDenylist = [ + "DressingSelect" + "Outline" + "TelescopePrompt" + "alpha" + "harpoon" + "toggleterm" + "neo-tree" + "Spectre" + "reason" + ]; + }; +} diff --git a/pkgs/nvim/config/utils/markdown-preview.nix b/pkgs/nvim/config/utils/markdown-preview.nix new file mode 100644 index 0000000..00df5e6 --- /dev/null +++ b/pkgs/nvim/config/utils/markdown-preview.nix @@ -0,0 +1,19 @@ +{ + plugins.markdown-preview = { + enable = true; + settings = { + browser = "floorp"; + theme = "dark"; + }; + }; + keymaps = [ + { + mode = "n"; + key = "cp"; + action = "MarkdownPreview"; + options = { + desc = "Markdown Preview"; + }; + } + ]; +} diff --git a/pkgs/nvim/config/utils/mini.nix b/pkgs/nvim/config/utils/mini.nix new file mode 100644 index 0000000..f688f3f --- /dev/null +++ b/pkgs/nvim/config/utils/mini.nix @@ -0,0 +1,15 @@ +{ + plugins.mini = { + enable = true; + modules = { + comment = { + options = { + customCommentString = '' + lua require("ts_context_commentstring.internal").calculate_commentstring() or vim.bo.commentstring + ''; + }; + }; + cursorword = {}; + }; + }; +} diff --git a/pkgs/nvim/config/utils/neocord.nix b/pkgs/nvim/config/utils/neocord.nix new file mode 100644 index 0000000..2886367 --- /dev/null +++ b/pkgs/nvim/config/utils/neocord.nix @@ -0,0 +1,27 @@ +{ + plugins.neocord = { + enable = true; + settings = { + auto_update = true; + blacklist = []; + client_id = "1157438221865717891"; + debounce_timeout = 10; + editing_text = "Editing..."; + enable_line_number = true; + logo = "https://repository-images.githubusercontent.com/325421844/ecb73f47-cb89-4ee0-a0fd-9743c2f3569a"; + logo_tooltip = "NixVim"; + file_assets = null; + file_explorer_text = "Browsing..."; + git_commit_text = "Committing changes..."; + global_timer = true; + line_number_text = "Line %s out of %s"; + log_level = null; + main_image = "logo"; + plugin_manager_text = "Managing plugins..."; + reading_text = "Reading..."; + show_time = true; + terminal_text = "Using Terminal..."; + workspace_text = "Working on %s"; + }; + }; +} diff --git a/pkgs/nvim/config/utils/neodev.nix b/pkgs/nvim/config/utils/neodev.nix new file mode 100644 index 0000000..fa1619e --- /dev/null +++ b/pkgs/nvim/config/utils/neodev.nix @@ -0,0 +1,11 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimPlugins; [ + neodev-nvim + ]; + + extraConfigLua = '' + require("neodev").setup({ + library = { plugins = {"neotest"}, types = true}, + }) + ''; +} diff --git a/pkgs/nvim/config/utils/neotest.nix b/pkgs/nvim/config/utils/neotest.nix new file mode 100644 index 0000000..5d25bcf --- /dev/null +++ b/pkgs/nvim/config/utils/neotest.nix @@ -0,0 +1,133 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimPlugins; [ + (pkgs.vimUtils.buildVimPlugin { + pname = "neotest-java"; + version = "v0.9.0"; + src = pkgs.fetchFromGitHub { + owner = "rcasia"; + repo = "neotest-java"; + rev = "2234bfa8044dc39a8baf90470747c65e4623a222"; + sha256 = "0w5fvqic3qapi9ggfb81nqa9fl6jv831s91r0wgn4d7c35h0340r"; + }; + }) + (pkgs.vimUtils.buildVimPlugin { + pname = "neotest-vim-test"; + version = "2023-04-17"; + src = pkgs.fetchFromGitHub { + owner = "nvim-neotest"; + repo = "neotest-vim-test"; + rev = "75c4228882ae4883b11bfce9b8383e637eb44192"; + sha256 = "12ix1lzmqlk3iyngaafby9c02fcl9d5iva965miwxfljvmibjnbw"; + }; + }) + neotest + FixCursorHold-nvim + neotest-plenary + vim-test + neotest-python + neotest-vitest + ]; + extraConfigLua = '' + require("neotest").setup({ + adapters = { + require("neotest-java")({ + ignore_wrapper = false, + -- function to determine which runner to use based on project path + determine_runner = function(project_root_path) + -- return should be "maven" or "gradle" + return "maven" + end, + -- override the builtin runner discovery behaviour to always use given + -- tool. Default is "nil", so no override + force_runner = nil, + -- if the automatic runner discovery can't uniquely determine whether + -- to use Gradle or Maven, fallback to using this runner. Default is + -- "maven" + fallback_runner = "gradle" + }), + require("neotest-python")({ + dap = { justMyCode = false }, + }), + require "neotest-vim-test" { + ignore_file_types = { "python", "java", "vim", "lua", "javascript", "typescript" }, + }, + }, + output = { enabled = true, open_on_run = true }, + summary = { enabled = true, }, + }) + ''; + keymaps = [ + { + mode = "n"; + key = "tt"; + action = "lua require('neotest').run.run(vim.fn.expand '%')"; + options = { + desc = "Run File"; + silent = true; + }; + } + { + mode = "n"; + key = "tT"; + action = "lua require('neotest').run.run(vim.loop.cwd())"; + options = { + desc = "Run All Test Files"; + silent = true; + }; + } + { + mode = "n"; + key = "tr"; + action = "lua require('neotest').run.run()"; + options = { + desc = "Run Nearest"; + silent = true; + }; + } + { + mode = "n"; + key = "td"; + action = "lua require('neotest').run.run({strategy = 'dap'})"; + options = { + desc = "Run Nearest with debugger"; + silent = true; + }; + } + { + mode = "n"; + key = "ts"; + action = "lua require('neotest').summary.toggle()"; + options = { + desc = "Toggle Summary"; + silent = true; + }; + } + { + mode = "n"; + key = "to"; + action = "lua require('neotest').output.open{ enter = true, auto_close = true }"; + options = { + desc = "Show Output"; + silent = true; + }; + } + { + mode = "n"; + key = "tO"; + action = "lua require('neotest').output_panel.toggle()"; + options = { + desc = "Toggle Output Panel"; + silent = true; + }; + } + { + mode = "n"; + key = "tS"; + action = "lua require('neotest').run.stop()"; + options = { + desc = "Stop"; + silent = true; + }; + } + ]; +} diff --git a/pkgs/nvim/config/utils/nvim-autopairs.nix b/pkgs/nvim/config/utils/nvim-autopairs.nix new file mode 100644 index 0000000..2af29dc --- /dev/null +++ b/pkgs/nvim/config/utils/nvim-autopairs.nix @@ -0,0 +1,5 @@ +{ + plugins.nvim-autopairs = { + enable = false; + }; +} diff --git a/pkgs/nvim/config/utils/nvim-colorizer.nix b/pkgs/nvim/config/utils/nvim-colorizer.nix new file mode 100644 index 0000000..81d8592 --- /dev/null +++ b/pkgs/nvim/config/utils/nvim-colorizer.nix @@ -0,0 +1,5 @@ +{ + plugins.nvim-colorizer = { + enable = true; + }; +} diff --git a/pkgs/nvim/config/utils/nvim-surround.nix b/pkgs/nvim/config/utils/nvim-surround.nix new file mode 100644 index 0000000..6a7f4b1 --- /dev/null +++ b/pkgs/nvim/config/utils/nvim-surround.nix @@ -0,0 +1,9 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimPlugins; [ + nvim-surround + ]; + + extraConfigLua = '' + require("nvim-surround").setup() + ''; +} diff --git a/pkgs/nvim/config/utils/oil.nix b/pkgs/nvim/config/utils/oil.nix new file mode 100644 index 0000000..30a093c --- /dev/null +++ b/pkgs/nvim/config/utils/oil.nix @@ -0,0 +1,54 @@ +{ + plugins.oil = { + enable = true; + settings = { + useDefaultKeymaps = true; + deleteToTrash = true; + viewOptions = { + showHidden = true; + }; + preview = { + border = "rounded"; + }; + + float = { + padding = 2; + maxWidth = 0; # ''math.ceil(vim.o.lines * 0.8 - 4)''; + maxHeight = 0; # ''math.ceil(vim.o.columns * 0.8)''; + border = "rounded"; # 'single' | 'double' | 'shadow' | 'curved' | ... other options supported by win open + winOptions = { + winblend = 0; + }; + }; + keymaps = { + "g?" = "actions.show_help"; + "" = "actions.select"; + "" = "actions.select_vsplit"; + "" = "actions.select_split"; # this is used to navigate left + "" = "actions.select_tab"; + "" = "actions.preview"; + "" = "actions.close"; + "" = "actions.refresh"; + "-" = "actions.parent"; + "_" = "actions.open_cwd"; + "`" = "actions.cd"; + "~" = "actions.tcd"; + "gs" = "actions.change_sort"; + "gx" = "actions.open_external"; + "g." = "actions.toggle_hidden"; + "q" = "actions.close"; + }; + }; + }; + keymaps = [ + { + mode = "n"; + key = "o"; + action = ":Oil --float"; + options = { + desc = "Open parent directory"; + silent = true; + }; + } + ]; +} diff --git a/pkgs/nvim/config/utils/persistence.nix b/pkgs/nvim/config/utils/persistence.nix new file mode 100644 index 0000000..eb7cde3 --- /dev/null +++ b/pkgs/nvim/config/utils/persistence.nix @@ -0,0 +1,5 @@ +{ + plugins.persistence = { + enable = true; + }; +} diff --git a/pkgs/nvim/config/utils/plenary.nix b/pkgs/nvim/config/utils/plenary.nix new file mode 100644 index 0000000..133b26f --- /dev/null +++ b/pkgs/nvim/config/utils/plenary.nix @@ -0,0 +1,5 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimPlugins; [ + plenary-nvim + ]; +} diff --git a/pkgs/nvim/config/utils/project-nvim.nix b/pkgs/nvim/config/utils/project-nvim.nix new file mode 100644 index 0000000..b411ec7 --- /dev/null +++ b/pkgs/nvim/config/utils/project-nvim.nix @@ -0,0 +1,6 @@ +{ + plugins.project-nvim = { + enable = true; + enableTelescope = true; + }; +} diff --git a/pkgs/nvim/config/utils/sidebar.nix b/pkgs/nvim/config/utils/sidebar.nix new file mode 100644 index 0000000..0cc4316 --- /dev/null +++ b/pkgs/nvim/config/utils/sidebar.nix @@ -0,0 +1,55 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimUtils; [ + (buildVimPlugin { + pname = "sidebar.nvim"; + version = "2024-02-07"; + src = pkgs.fetchFromGitHub { + owner = "sidebar-nvim"; + repo = "sidebar.nvim"; + rev = "5695712eef6288fff667343c4ae77c54911bdb1b"; + sha256 = "1p12189367x0x26cys9wxipzwr3i0bmz4lb0s79ki0a49d6zja2c"; + }; + }) + ]; + extraConfigLua = '' + local sidebar = require("sidebar-nvim") + sidebar.setup({ + disable_default_keybindings = 0, + bindings = nil, + open = false, + side = "left", + initial_width = 32, + hide_statusline = false, + update_interval = 1000, + sections = { "git", "containers" }, + section_separator = {"", "-----", ""}, + section_title_separator = {""}, + containers = { + attach_shell = "/bin/sh", show_all = true, interval = 5000, + }, + datetime = { format = "%a %b %d, %H:%M", clocks = { { name = "local" } } }, + todos = { ignored_paths = {} }, + ["git"] = { + icon = "", --  + }, + }) + cmd = { + "SidebarNvimToggle", + "SidebarNvimOpen", + "SidebarNvimFocus", + "SidebarNvimUpdate", + }, + ''; + + keymaps = [ + { + mode = "n"; + key = "e"; + action = ":SidebarNvimToggle"; + options = { + desc = "Toggle Explorer"; + silent = true; + }; + } + ]; +} diff --git a/pkgs/nvim/config/utils/tmux-navigator.nix b/pkgs/nvim/config/utils/tmux-navigator.nix new file mode 100644 index 0000000..efb21c3 --- /dev/null +++ b/pkgs/nvim/config/utils/tmux-navigator.nix @@ -0,0 +1,5 @@ +{ + plugins.tmux-navigator = { + enable = true; + }; +} diff --git a/pkgs/nvim/config/utils/todo-comments.nix b/pkgs/nvim/config/utils/todo-comments.nix new file mode 100644 index 0000000..96878bb --- /dev/null +++ b/pkgs/nvim/config/utils/todo-comments.nix @@ -0,0 +1,5 @@ +{ + plugins.todo-comments = { + enable = true; + }; +} diff --git a/pkgs/nvim/config/utils/toggleterm.nix b/pkgs/nvim/config/utils/toggleterm.nix new file mode 100644 index 0000000..4a048df --- /dev/null +++ b/pkgs/nvim/config/utils/toggleterm.nix @@ -0,0 +1,57 @@ +{ + plugins.toggleterm = { + enable = true; + settings = { + size = '' + function(term) + if term.direction == "horizontal" then + return 15 + elseif term.direction == "vertical" then + return vim.o.columns * 0.4 + end + end + ''; + open_mapping = "[[]]"; + hide_numbers = true; + shade_terminals = true; + start_in_insert = true; + terminal_mappings = true; + persist_mode = true; + insert_mappings = true; + close_on_exit = true; + shell = "zsh"; + direction = "horizontal"; # 'vertical' | 'horizontal' | 'window' | 'float' + auto_scroll = true; + float_opts = { + border = "single"; # 'single' | 'double' | 'shadow' | 'curved' | ... other options supported by win open + width = 80; + height = 20; + winblend = 0; + }; + winbar = { + enabled = true; + name_formatter = '' + function(term) + return term.name + end + ''; + }; + }; + }; + + # extraConfigLua = '' + # function _G.set_terminal_keymaps() + # local opts = { buffer = 0 } + # vim.keymap.set("t", "", [[]], opts) + # vim.keymap.set("t", "jk", [[]], opts) + # vim.keymap.set("t", "", [[wincmd h]], opts) + # vim.keymap.set("t", "", [[wincmd j]], opts) + # vim.keymap.set("t", "", [[wincmd k]], opts) + # vim.keymap.set("t", "", [[wincmd l]], opts) + # vim.keymap.set("t", "", [[]], opts) + # end + # + # -- if you only want these mappings for toggle term use term://*toggleterm#* instead + # -- vim.cmd("autocmd! TermOpen term://*toggleterm#* lua set_terminal_keymaps()") + # ''; +} diff --git a/pkgs/nvim/config/utils/ultimate-autopair.nix b/pkgs/nvim/config/utils/ultimate-autopair.nix new file mode 100644 index 0000000..5730e45 --- /dev/null +++ b/pkgs/nvim/config/utils/ultimate-autopair.nix @@ -0,0 +1,17 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimUtils; [ + (buildVimPlugin { + pname = "ultimate-autopair.nvim"; + version = "2024-02-05"; + src = pkgs.fetchFromGitHub { + owner = "altermo"; + repo = "ultimate-autopair.nvim"; + rev = "25c13e0ce167db0255456cac10158b27d2be30c0"; + sha256 = "0bsxfj6g8fii9nn92vl15hdhafx3fikgiz4srr7y10pxz01c5s4c"; + }; + }) + ]; + extraConfigLua = '' + require('ultimate-autopair').setup() + ''; +} diff --git a/pkgs/nvim/config/utils/undotree.nix b/pkgs/nvim/config/utils/undotree.nix new file mode 100644 index 0000000..6232412 --- /dev/null +++ b/pkgs/nvim/config/utils/undotree.nix @@ -0,0 +1,26 @@ +{ + config, + pkgs, + host, + user, + ... +}: { + plugins.undotree = { + enable = true; + settings = { + autoOpenDiff = true; + focusOnToggle = true; + }; + }; + keymaps = [ + { + mode = "n"; + key = "ut"; + action = "UndotreeToggle"; + options = { + silent = true; + desc = "Undotree"; + }; + } + ]; +} diff --git a/pkgs/nvim/config/utils/vim-be-good.nix b/pkgs/nvim/config/utils/vim-be-good.nix new file mode 100644 index 0000000..39292ae --- /dev/null +++ b/pkgs/nvim/config/utils/vim-be-good.nix @@ -0,0 +1,5 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimPlugins; [ + vim-be-good + ]; +} diff --git a/pkgs/nvim/config/utils/wakatime.nix b/pkgs/nvim/config/utils/wakatime.nix new file mode 100644 index 0000000..a007b47 --- /dev/null +++ b/pkgs/nvim/config/utils/wakatime.nix @@ -0,0 +1,5 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimPlugins; [ + vim-wakatime + ]; +} diff --git a/pkgs/nvim/config/utils/whichkey.nix b/pkgs/nvim/config/utils/whichkey.nix new file mode 100644 index 0000000..3b01821 --- /dev/null +++ b/pkgs/nvim/config/utils/whichkey.nix @@ -0,0 +1,19 @@ +{ + # TODO: Implement general mappings + plugins.which-key = { + enable = true; + ignoreMissing = false; + icons = { + breadcrumb = "»"; + group = "+"; + separator = ""; # ➜ + }; + # registrations = { + # "t" = " Terminal"; + # }; + window = { + border = "none"; + winblend = 0; + }; + }; +} diff --git a/pkgs/nvim/config/utils/wilder.nix b/pkgs/nvim/config/utils/wilder.nix new file mode 100644 index 0000000..a816ea0 --- /dev/null +++ b/pkgs/nvim/config/utils/wilder.nix @@ -0,0 +1,43 @@ +{ + plugins.wilder = { + enable = true; + modes = [":" "/" "?"]; + pipeline = [ + '' + wilder.branch( + wilder.python_file_finder_pipeline({ + file_command = function(ctx, arg) + if string.find(arg, '.') ~= nil then + return {'fd', '-tf', '-H'} + else + return {'fd', '-tf'} + end + end, + dir_command = {'fd', '-td'}, + filters = {'cpsm_filter'}, + }), + wilder.substitute_pipeline({ + pipeline = wilder.python_search_pipeline({ + skip_cmdtype_check = 1, + pattern = wilder.python_fuzzy_pattern({ + start_at_boundary = 0, + }), + }), + }), + wilder.cmdline_pipeline({ + language = 'python', + fuzzy = 1, + }), + { + wilder.check(function(ctx, x) return x == "" end), + wilder.history(), + }, + wilder.python_search_pipeline({ + pattern = wilder.python_fuzzy_pattern({ + start_at_boundary = 0, + }), + }) + ) '' + ]; + }; +} diff --git a/pkgs/nvim/default.nix b/pkgs/nvim/default.nix new file mode 100644 index 0000000..2efe8c6 --- /dev/null +++ b/pkgs/nvim/default.nix @@ -0,0 +1,13 @@ +{ + pkgs, + inputs, + ... +}: let + system = pkgs.system; + nixvim = inputs.nixvim.legacyPackages.${system}; + nixvimModule = { + inherit pkgs; + module = import ./config; + extraSpecialArgs = {}; + }; +in (nixvim.makeNixvimWithModule nixvimModule)