From 7ce6b5691b4e4920897fc75d6dff03531a7f9480 Mon Sep 17 00:00:00 2001 From: Anthony Cicchetti Date: Mon, 5 Aug 2024 15:27:41 -0400 Subject: [PATCH 1/6] nixvim - whichkey still giving trouble --- flake.lock | 513 ++---------------- nix/home-manager/flake.lock | 453 +++++++++++----- nix/home-manager/flake.nix | 39 +- nix/home-manager/modules/packages/neovim.nix | 433 +++++++++------ .../modules/packages/neovim/core.lua | 22 + .../modules/packages/neovim/pre.lua | 76 ++- 6 files changed, 730 insertions(+), 806 deletions(-) diff --git a/flake.lock b/flake.lock index 5028296..abc23c6 100644 --- a/flake.lock +++ b/flake.lock @@ -2,66 +2,28 @@ "nodes": { "cachix": { "inputs": { - "devenv": "devenv_2", + "devenv": [ + "devenv" + ], "flake-compat": [ - "devenv", - "flake-compat" + "devenv" ], "git-hooks": [ - "devenv", - "pre-commit-hooks" + "devenv" ], - "nixpkgs": [ - "devenv", - "nixpkgs" - ] + "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1724232775, - "narHash": "sha256-6u2DycIEgrgNYlLxyGqdFVmBNiKIitnQKJ1pbRP5oko=", + "lastModified": 1728672398, + "narHash": "sha256-KxuGSoVUFnQLB2ZcYODW7AVPAh9JqRlD5BrfsC/Q4qs=", "owner": "cachix", "repo": "cachix", - "rev": "03b6cb3f953097bff378fb8b9ea094bd091a4ec7", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "cachix", - "type": "github" - } - }, - "cachix_2": { - "inputs": { - "devenv": "devenv_3", - "flake-compat": [ - "devenv", - "cachix", - "devenv", - "flake-compat" - ], - "nixpkgs": [ - "devenv", - "cachix", - "devenv", - "nixpkgs" - ], - "pre-commit-hooks": [ - "devenv", - "cachix", - "devenv", - "pre-commit-hooks" - ] - }, - "locked": { - "lastModified": 1712055811, - "narHash": "sha256-7FcfMm5A/f02yyzuavJe06zLa9hcMHsagE28ADcmQvk=", - "owner": "cachix", - "repo": "cachix", - "rev": "02e38da89851ec7fec3356a5c04bc8349cae0e30", + "rev": "aac51f698309fd0f381149214b7eee213c66ef0a", "type": "github" }, "original": { "owner": "cachix", + "ref": "latest", "repo": "cachix", "type": "github" } @@ -69,113 +31,28 @@ "devenv": { "inputs": { "cachix": "cachix", - "flake-compat": "flake-compat_2", - "nix": "nix_3", - "nixpkgs": [ - "nixpkgs" - ], - "pre-commit-hooks": "pre-commit-hooks_2" - }, - "locked": { - "lastModified": 1726826452, - "narHash": "sha256-bzlp1BmyG+lyc3BvjHLVarck0XVj251R/ZAidtSsEzg=", - "owner": "cachix", - "repo": "devenv", - "rev": "2bdf6461e88c7e93b94d72d8b11d5a61f167cbf5", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "devenv", - "type": "github" - } - }, - "devenv_2": { - "inputs": { - "cachix": "cachix_2", - "flake-compat": [ - "devenv", - "cachix", - "flake-compat" - ], - "nix": "nix_2", - "nixpkgs": [ - "devenv", - "cachix", - "nixpkgs" - ], - "pre-commit-hooks": [ - "devenv", - "cachix", - "git-hooks" - ] - }, - "locked": { - "lastModified": 1723156315, - "narHash": "sha256-0JrfahRMJ37Rf1i0iOOn+8Z4CLvbcGNwa2ChOAVrp/8=", - "owner": "cachix", - "repo": "devenv", - "rev": "ff5eb4f2accbcda963af67f1a1159e3f6c7f5f91", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "devenv", - "type": "github" - } - }, - "devenv_3": { - "inputs": { - "flake-compat": [ - "devenv", - "cachix", - "devenv", - "cachix", - "flake-compat" - ], + "flake-compat": "flake-compat", + "git-hooks": "git-hooks", "nix": "nix", - "nixpkgs": "nixpkgs", - "poetry2nix": "poetry2nix", - "pre-commit-hooks": [ - "devenv", - "cachix", - "devenv", - "cachix", - "pre-commit-hooks" + "nixpkgs": [ + "nixpkgs" ] }, "locked": { - "lastModified": 1708704632, - "narHash": "sha256-w+dOIW60FKMaHI1q5714CSibk99JfYxm0CzTinYWr+Q=", + "lastModified": 1731169617, + "narHash": "sha256-Imod8I59qsOyEwInlHmPoiWrYlPkzwKO1e8h2g8ruX4=", "owner": "cachix", "repo": "devenv", - "rev": "2ee4450b0f4b95a1b90f2eb5ffea98b90e48c196", + "rev": "983153344922e5fb8545aae7e5e70127da981a71", "type": "github" }, "original": { "owner": "cachix", - "ref": "python-rewrite", "repo": "devenv", "type": "github" } }, "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_2": { "flake": false, "locked": { "lastModified": 1696426674, @@ -213,36 +90,31 @@ "type": "github" } }, - "flake-utils": { + "git-hooks": { "inputs": { - "systems": "systems" + "flake-compat": [ + "devenv" + ], + "gitignore": "gitignore", + "nixpkgs": [ + "devenv", + "nixpkgs" + ], + "nixpkgs-stable": [ + "devenv" + ] }, "locked": { - "lastModified": 1689068808, - "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", + "lastModified": 1730302582, + "narHash": "sha256-W1MIJpADXQCgosJZT8qBYLRuZls2KSiKdpnTVdKBuvU=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "af8a16fe5c264f5e9e18bcee2859b40a656876cf", "type": "github" }, "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_2": { - "locked": { - "lastModified": 1667395993, - "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", + "owner": "cachix", + "repo": "git-hooks.nix", "type": "github" } }, @@ -250,7 +122,7 @@ "inputs": { "nixpkgs": [ "devenv", - "pre-commit-hooks", + "git-hooks", "nixpkgs" ] }, @@ -285,109 +157,29 @@ } }, "nix": { - "inputs": { - "flake-compat": "flake-compat", - "nixpkgs": [ - "devenv", - "cachix", - "devenv", - "cachix", - "devenv", - "nixpkgs" - ], - "nixpkgs-regression": "nixpkgs-regression" - }, - "locked": { - "lastModified": 1712911606, - "narHash": "sha256-BGvBhepCufsjcUkXnEEXhEVjwdJAwPglCC2+bInc794=", - "owner": "domenkozar", - "repo": "nix", - "rev": "b24a9318ea3f3600c1e24b4a00691ee912d4de12", - "type": "github" - }, - "original": { - "owner": "domenkozar", - "ref": "devenv-2.21", - "repo": "nix", - "type": "github" - } - }, - "nix-github-actions": { - "inputs": { - "nixpkgs": [ - "devenv", - "cachix", - "devenv", - "cachix", - "devenv", - "poetry2nix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1688870561, - "narHash": "sha256-4UYkifnPEw1nAzqqPOTL2MvWtm3sNGw1UTYTalkTcGY=", - "owner": "nix-community", - "repo": "nix-github-actions", - "rev": "165b1650b753316aa7f1787f3005a8d2da0f5301", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nix-github-actions", - "type": "github" - } - }, - "nix_2": { "inputs": { "flake-compat": [ - "devenv", - "cachix", - "devenv", - "flake-compat" - ], - "nixpkgs": [ - "devenv", - "cachix", - "devenv", - "nixpkgs" - ], - "nixpkgs-regression": "nixpkgs-regression_2" - }, - "locked": { - "lastModified": 1712911606, - "narHash": "sha256-BGvBhepCufsjcUkXnEEXhEVjwdJAwPglCC2+bInc794=", - "owner": "domenkozar", - "repo": "nix", - "rev": "b24a9318ea3f3600c1e24b4a00691ee912d4de12", - "type": "github" - }, - "original": { - "owner": "domenkozar", - "ref": "devenv-2.21", - "repo": "nix", - "type": "github" - } - }, - "nix_3": { - "inputs": { - "flake-compat": [ - "devenv", - "flake-compat" + "devenv" ], "flake-parts": "flake-parts", "libgit2": "libgit2", "nixpkgs": "nixpkgs_2", - "nixpkgs-23-11": "nixpkgs-23-11", - "nixpkgs-regression": "nixpkgs-regression_3", - "pre-commit-hooks": "pre-commit-hooks" + "nixpkgs-23-11": [ + "devenv" + ], + "nixpkgs-regression": [ + "devenv" + ], + "pre-commit-hooks": [ + "devenv" + ] }, "locked": { - "lastModified": 1725980365, - "narHash": "sha256-uDwWyizzlQ0HFzrhP6rVp2+2NNA+/TM5zT32dR8GUlg=", + "lastModified": 1727438425, + "narHash": "sha256-X8ES7I1cfNhR9oKp06F6ir4Np70WGZU5sfCOuNBEwMg=", "owner": "domenkozar", "repo": "nix", - "rev": "1e61e9f40673f84c3b02573145492d8af581bec5", + "rev": "f6c5ae4c1b2e411e6b1e6a8181cc84363d6a7546", "type": "github" }, "original": { @@ -399,96 +191,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1692808169, - "narHash": "sha256-x9Opq06rIiwdwGeK2Ykj69dNc2IvUH1fY55Wm7atwrE=", + "lastModified": 1730531603, + "narHash": "sha256-Dqg6si5CqIzm87sp57j5nTaeBbWhHFaVyG7V6L8k3lY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9201b5ff357e781bf014d0330d18555695df7ba8", + "rev": "7ffd9ae656aec493492b44d0ddfb28e79a1ea25d", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-23-11": { - "locked": { - "lastModified": 1717159533, - "narHash": "sha256-oamiKNfr2MS6yH64rUn99mIZjc45nGJlj9eGth/3Xuw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446", - "type": "github" - } - }, - "nixpkgs-regression": { - "locked": { - "lastModified": 1643052045, - "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "type": "github" - } - }, - "nixpkgs-regression_2": { - "locked": { - "lastModified": 1643052045, - "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "type": "github" - } - }, - "nixpkgs-regression_3": { - "locked": { - "lastModified": 1643052045, - "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "type": "github" - } - }, - "nixpkgs-stable": { - "locked": { - "lastModified": 1720386169, - "narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "194846768975b7ad2c4988bdb82572c00222c0d7", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-24.05", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -511,131 +223,26 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1726937504, - "narHash": "sha256-bvGoiQBvponpZh8ClUcmJ6QnsNKw0EMrCQJARK3bI1c=", - "rev": "9357f4f23713673f310988025d9dc261c20e70c6", - "revCount": 684053, + "lastModified": 1731139594, + "narHash": "sha256-IigrKK3vYRpUu+HEjPL/phrfh7Ox881er1UEsZvw9Q4=", + "rev": "76612b17c0ce71689921ca12d9ffdc9c23ce40b2", + "revCount": 705705, "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.684053%2Brev-9357f4f23713673f310988025d9dc261c20e70c6/01921e7b-1992-7873-809e-ce4f88216698/source.tar.gz" + "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.705705%2Brev-76612b17c0ce71689921ca12d9ffdc9c23ce40b2/019316f9-5a16-7c56-8623-797f62e3b419/source.tar.gz" }, "original": { "type": "tarball", "url": "https://flakehub.com/f/NixOS/nixpkgs/0.1.0.tar.gz" } }, - "poetry2nix": { - "inputs": { - "flake-utils": "flake-utils", - "nix-github-actions": "nix-github-actions", - "nixpkgs": [ - "devenv", - "cachix", - "devenv", - "cachix", - "devenv", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1692876271, - "narHash": "sha256-IXfZEkI0Mal5y1jr6IRWMqK8GW2/f28xJenZIPQqkY0=", - "owner": "nix-community", - "repo": "poetry2nix", - "rev": "d5006be9c2c2417dafb2e2e5034d83fabd207ee3", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "poetry2nix", - "type": "github" - } - }, - "pre-commit-hooks": { - "inputs": { - "flake-compat": [ - "devenv", - "nix" - ], - "flake-utils": "flake-utils_2", - "gitignore": [ - "devenv", - "nix" - ], - "nixpkgs": [ - "devenv", - "nix", - "nixpkgs" - ], - "nixpkgs-stable": [ - "devenv", - "nix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1712897695, - "narHash": "sha256-nMirxrGteNAl9sWiOhoN5tIHyjBbVi5e2tgZUgZlK3Y=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "40e6053ecb65fcbf12863338a6dcefb3f55f1bf8", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "type": "github" - } - }, - "pre-commit-hooks_2": { - "inputs": { - "flake-compat": [ - "devenv", - "flake-compat" - ], - "gitignore": "gitignore", - "nixpkgs": [ - "devenv", - "nixpkgs" - ], - "nixpkgs-stable": "nixpkgs-stable" - }, - "locked": { - "lastModified": 1725513492, - "narHash": "sha256-tyMUA6NgJSvvQuzB7A1Sf8+0XCHyfSPRx/b00o6K0uo=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "7570de7b9b504cfe92025dd1be797bf546f66528", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "type": "github" - } - }, "root": { "inputs": { "devenv": "devenv", "nixpkgs": "nixpkgs_3", - "systems": "systems_2" + "systems": "systems" } }, "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_2": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", diff --git a/nix/home-manager/flake.lock b/nix/home-manager/flake.lock index 111ae13..b74c584 100644 --- a/nix/home-manager/flake.lock +++ b/nix/home-manager/flake.lock @@ -15,6 +15,27 @@ "type": "github" } }, + "devshell": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1728330715, + "narHash": "sha256-xRJ2nPOXb//u1jaBnDP56M7v5ldavjbtR6lfGqSvcKg=", + "owner": "numtide", + "repo": "devshell", + "rev": "dd6b80932022cea34a019e2bb32f6fa9e494dfef", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, "fenix": { "inputs": { "nixpkgs": [ @@ -36,6 +57,57 @@ "type": "github" } }, + "flake-compat": { + "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-compat_2": { + "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-parts": { + "inputs": { + "nixpkgs-lib": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1730504689, + "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "506278e768c2a08bec68eb62932193e341f55c90", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -54,6 +126,42 @@ "type": "github" } }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { + "inputs": { + "systems": "systems_3" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "freetype2": { "flake": false, "locked": { @@ -71,6 +179,58 @@ "type": "github" } }, + "git-hooks": { + "inputs": { + "flake-compat": [ + "nixvim", + "flake-compat" + ], + "gitignore": "gitignore", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ], + "nixpkgs-stable": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1730814269, + "narHash": "sha256-fWPHyhYE6xvMI1eGY3pwBTq85wcy1YXqdzTZF+06nOg=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "d70155fdc00df4628446352fc58adc640cd705c2", + "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" + } + }, "harfbuzz": { "flake": false, "locked": { @@ -88,25 +248,6 @@ "type": "github" } }, - "haumea": { - "inputs": { - "nixpkgs": "nixpkgs" - }, - "locked": { - "lastModified": 1685133229, - "narHash": "sha256-FePm/Gi9PBSNwiDFq3N+DWdfxFq0UKsVVTJS3cQPn94=", - "owner": "nix-community", - "repo": "haumea", - "rev": "34dd58385092a23018748b50f9b23de6266dffc2", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "v0.2.2", - "repo": "haumea", - "type": "github" - } - }, "home-manager": { "inputs": { "nixpkgs": [ @@ -127,6 +268,34 @@ "type": "github" } }, + "ixx": { + "inputs": { + "flake-utils": [ + "nixvim", + "nuschtosSearch", + "flake-utils" + ], + "nixpkgs": [ + "nixvim", + "nuschtosSearch", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1729958008, + "narHash": "sha256-EiOq8jF4Z/zQe0QYVc3+qSKxRK//CFHMB84aYrYGwEs=", + "owner": "NuschtOS", + "repo": "ixx", + "rev": "9fd01aad037f345350eab2cd45e1946cc66da4eb", + "type": "github" + }, + "original": { + "owner": "NuschtOS", + "ref": "v0.0.6", + "repo": "ixx", + "type": "github" + } + }, "libpng": { "flake": false, "locked": { @@ -144,40 +313,24 @@ "type": "github" } }, - "nix-flake-tests": { - "locked": { - "lastModified": 1677844186, - "narHash": "sha256-ErJZ/Gs1rxh561CJeWP5bohA2IcTq1rDneu1WT6CVII=", - "owner": "antifuchs", - "repo": "nix-flake-tests", - "rev": "bbd9216bd0f6495bb961a8eb8392b7ef55c67afb", - "type": "github" - }, - "original": { - "owner": "antifuchs", - "repo": "nix-flake-tests", - "type": "github" - } - }, - "nix-github-actions": { + "nix-darwin": { "inputs": { "nixpkgs": [ - "nixneovimplugins", - "poetry2nix", + "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1688870561, - "narHash": "sha256-4UYkifnPEw1nAzqqPOTL2MvWtm3sNGw1UTYTalkTcGY=", - "owner": "nix-community", - "repo": "nix-github-actions", - "rev": "165b1650b753316aa7f1787f3005a8d2da0f5301", + "lastModified": 1731153869, + "narHash": "sha256-3Ftf9oqOypcEyyrWJ0baVkRpvQqroK/SVBFLvU3nPuc=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "5c74ab862c8070cbf6400128a1b56abb213656da", "type": "github" }, "original": { - "owner": "nix-community", - "repo": "nix-github-actions", + "owner": "lnl7", + "repo": "nix-darwin", "type": "github" } }, @@ -201,76 +354,39 @@ "type": "github" } }, - "nixneovim": { - "inputs": { - "flake-utils": [ - "flake-utils" - ], - "haumea": "haumea", - "home-manager": [ - "home-manager" - ], - "nix-flake-tests": "nix-flake-tests", - "nixneovimplugins": [ - "nixneovimplugins" - ], - "nixpkgs": [ - "nixpkgs" - ], - "nmd": "nmd", - "nmt": "nmt" - }, - "locked": { - "lastModified": 1718612773, - "narHash": "sha256-Uzw1jJhriSwctKZvEc9vwUfKHSvnX7YGKJxYv8JPG14=", - "owner": "nixneovim", - "repo": "nixneovim", - "rev": "2ae81f2ed61ebf4ca4d4b36ea9e8eb5163380d44", - "type": "github" - }, - "original": { - "owner": "nixneovim", - "repo": "nixneovim", - "rev": "2ae81f2ed61ebf4ca4d4b36ea9e8eb5163380d44", - "type": "github" - } - }, "nixneovimplugins": { "inputs": { - "flake-utils": [ - "flake-utils" - ], - "nixpkgs": [ - "nixpkgs" - ], - "poetry2nix": "poetry2nix" + "flake-compat": "flake-compat", + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1731248492, - "narHash": "sha256-msGgH4xdvCBj48MFDlBLqZQVw6jbZUjRo0pXce+EvuM=", - "owner": "NixNeovim", - "repo": "NixNeovimPlugins", - "rev": "3a9451b520b2702fab908207961812780fc49495", + "lastModified": 1731259323, + "narHash": "sha256-CAcXq3i0dY/9GosZM8ZMH89rNw+Kra6YLiPoUcr0Vaw=", + "owner": "m15a", + "repo": "flake-awesome-neovim-plugins", + "rev": "e6b1267d21fb34eccd4d69c46ea6f5b9451f2228", "type": "github" }, "original": { - "owner": "NixNeovim", - "repo": "NixNeovimPlugins", + "owner": "m15a", + "repo": "flake-awesome-neovim-plugins", "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1681001314, - "narHash": "sha256-5sDnCLdrKZqxLPK4KA8+f4A3YKO/u6ElpMILvX0g72c=", - "owner": "nix-community", - "repo": "nixpkgs.lib", - "rev": "367c0e1086a4eb4502b24d872cea2c7acdd557f4", + "lastModified": 1730831018, + "narHash": "sha256-2S0HwIFRxYp+afuoFORcZA9TjryAf512GmE0MTfEOPU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8c4dc69b9732f6bbe826b5fbb32184987520ff26", "type": "github" }, "original": { - "owner": "nix-community", - "repo": "nixpkgs.lib", + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", "type": "github" } }, @@ -306,62 +422,56 @@ "type": "github" } }, - "nmd": { - "flake": false, - "locked": { - "lastModified": 1672949361, - "narHash": "sha256-WWg1kbilAb3sA+RoJtSYfAZvyYu1Nk79ocHaerwbQxQ=", - "owner": "~rycee", - "repo": "nmd", - "rev": "fb9cf8e991487c6923f3c654b8ae51b6f0f205ce", - "type": "sourcehut" - }, - "original": { - "owner": "~rycee", - "repo": "nmd", - "rev": "fb9cf8e991487c6923f3c654b8ae51b6f0f205ce", - "type": "sourcehut" - } - }, - "nmt": { - "flake": false, - "locked": { - "lastModified": 1709382952, - "narHash": "sha256-n/BvuWVcQxaXCU30feNRqWWqabhIIO2+tRFnhLIhjiQ=", - "owner": "jooooscha", - "repo": "nmt", - "rev": "86a09994d1007c39a1f4d386e3caea9b4681d9d6", - "type": "github" - }, - "original": { - "owner": "jooooscha", - "repo": "nmt", - "type": "github" - } - }, - "poetry2nix": { + "nixvim": { "inputs": { - "flake-utils": [ - "nixneovimplugins", - "flake-utils" + "devshell": "devshell", + "flake-compat": "flake-compat_2", + "flake-parts": "flake-parts", + "git-hooks": "git-hooks", + "home-manager": [ + "home-manager" ], - "nix-github-actions": "nix-github-actions", + "nix-darwin": "nix-darwin", "nixpkgs": [ - "nixneovimplugins", + "nixpkgs" + ], + "nuschtosSearch": "nuschtosSearch", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1731155487, + "narHash": "sha256-+D57j7BcV5O3XH9za3c3XXVLHr+F+enThAN2EeF6H/M=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "31364af1990067d5529846a2ebf17a42c5ab22ff", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixvim", + "type": "github" + } + }, + "nuschtosSearch": { + "inputs": { + "flake-utils": "flake-utils_3", + "ixx": "ixx", + "nixpkgs": [ + "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1689849924, - "narHash": "sha256-d259Z2S7CS7Na04qQNQ6LYQILuI7cf4Rpe76qc4mz40=", - "owner": "nix-community", - "repo": "poetry2nix", - "rev": "1d7eda9336f336392d24e9602be5cb9be7ae405c", + "lastModified": 1731060242, + "narHash": "sha256-43yLsOm/wxBbfYSNDWVJeVv5Ij+23X3BIjFUfsdx/6M=", + "owner": "NuschtOS", + "repo": "search", + "rev": "ef493352f9e1f051e01a55c062731503a6b36b4e", "type": "github" }, "original": { - "owner": "nix-community", - "repo": "poetry2nix", + "owner": "NuschtOS", + "repo": "search", "type": "github" } }, @@ -371,9 +481,9 @@ "flake-utils": "flake-utils", "home-manager": "home-manager", "nix-index-database": "nix-index-database", - "nixneovim": "nixneovim", "nixneovimplugins": "nixneovimplugins", "nixpkgs": "nixpkgs_2", + "nixvim": "nixvim", "wezterm": "wezterm", "zjstatus": "zjstatus" } @@ -452,6 +562,57 @@ "type": "github" } }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { + "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": 1730321837, + "narHash": "sha256-vK+a09qq19QNu2MlLcvN4qcRctJbqWkX7ahgPZ/+maI=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "746901bb8dba96d154b66492a29f5db0693dbfcc", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, "wezterm": { "inputs": { "flake-utils": [ diff --git a/nix/home-manager/flake.nix b/nix/home-manager/flake.nix index 4026e45..17adedd 100644 --- a/nix/home-manager/flake.nix +++ b/nix/home-manager/flake.nix @@ -19,21 +19,37 @@ url = "github:Mic92/nix-index-database"; inputs.nixpkgs.follows = "nixpkgs"; }; - nixneovim = { - url = "github:nixneovim/nixneovim/2ae81f2ed61ebf4ca4d4b36ea9e8eb5163380d44"; + # nixneovim = { + # url = "github:nixneovim/nixneovim/2ae81f2ed61ebf4ca4d4b36ea9e8eb5163380d44"; + # inputs = { + # nixpkgs.follows = "nixpkgs"; + # home-manager.follows = "home-manager"; + # flake-utils.follows = "flake-utils"; + # nixneovimplugins.follows = "nixneovimplugins"; + # }; + # }; + # nixneovimplugins = { + # url = "github:NixNeovim/NixNeovimPlugins"; + # inputs = { + # nixpkgs.follows = "nixpkgs"; + # flake-utils.follows = "flake-utils"; + # }; + # }; + nixvim = { + url = "github:nix-community/nixvim"; inputs = { nixpkgs.follows = "nixpkgs"; home-manager.follows = "home-manager"; flake-utils.follows = "flake-utils"; - nixneovimplugins.follows = "nixneovimplugins"; }; }; nixneovimplugins = { - url = "github:NixNeovim/NixNeovimPlugins"; - inputs = { - nixpkgs.follows = "nixpkgs"; - flake-utils.follows = "flake-utils"; - }; + url = "github:m15a/flake-awesome-neovim-plugins"; + # inputs = { + # nixpkgs.follows = "nixpkgs"; + # home-manager.follows = "home-manager"; + # flake-utils.follows = "flake-utils"; + # }; }; zjstatus = { url = "github:dj95/zjstatus"; @@ -62,12 +78,12 @@ nixpkgs, home-manager, nix-index-database, - nixneovim, - nixneovimplugins, + nixvim, zjstatus, fenix, wezterm, # neovidenixpkgs, + nixneovimplugins, ... }: let supportedSystems = ["aarch64-darwin" "x86_64-linux"]; @@ -91,6 +107,7 @@ # (_final: prev: {inherit (neovidenixpkgs.legacyPackages.${prev.system}) neovide;}) nixneovimplugins.overlays.default fenix.overlays.default + # awesome-neovim-plugins.overlays.default ]; } ); @@ -101,7 +118,7 @@ modules = [ { imports = [ - nixneovim.nixosModules.${system}.homeManager + nixvim.homeManagerModules.nixvim ]; } nix-index-database.hmModules.nix-index diff --git a/nix/home-manager/modules/packages/neovim.nix b/nix/home-manager/modules/packages/neovim.nix index 110a49f..ea5b5e1 100644 --- a/nix/home-manager/modules/packages/neovim.nix +++ b/nix/home-manager/modules/packages/neovim.nix @@ -1,12 +1,11 @@ {pkgs, ...}: { - programs.nixneovim = { + programs.nixvim = { enable = true; defaultEditor = true; viAlias = true; vimAlias = true; - extraLuaPreConfig = builtins.readFile ./neovim/pre.lua; - extraConfigLua = builtins.readFile ./neovim/core.lua; - colorscheme = "onedark"; + extraConfigLuaPre = builtins.readFile ./neovim/pre.lua; + extraConfigLuaPost = builtins.readFile ./neovim/core.lua; colorschemes = { onedark.enable = true; }; @@ -29,21 +28,40 @@ right = ""; }; sections = { - lualine_a = ["mode" {separator = {left = "";};} {right_padding = 2;}]; + lualine_a = [ + { + name = "mode"; + separator = { + left = ""; + }; + padding = { + right = 2; + left = 0; + }; + } + ]; lualine_b = ["filename" "branch"]; lualine_c = ["%="]; lualine_x = []; lualine_y = ["filetype" "progress"]; - lualine_z = ["location" {separator = {right = "";};} {left_padding = 2;}]; + lualine_z = [ + { + name = "location"; + separator = { + right = ""; + }; + padding = { + right = 0; + left = 2; + }; + } + ]; }; }; - # luasnip = { - # enable = true; - # }; lsp-lines = { enable = true; }; - lspconfig = { + lsp = { enable = true; preConfig = '' ''; @@ -52,225 +70,302 @@ gopls.enable = true; jsonls.enable = true; pyright.enable = true; # In preference to attempting to use pylyzer - nil.enable = true; - rust-analyzer.enable = true; + nil-ls.enable = true; + rust-analyzer.enable = true; #TODO taplo.enable = true; - terraform-ls.enable = true; + terraformls.enable = true; }; }; lspkind = { enable = true; mode = "symbol"; + cmp.enable = true; + symbolMap = { + # TODO + "Text" = ""; + }; }; mini = { enable = true; - ai.enable = true; - align.enable = true; - animate.enable = true; - comment.enable = true; - completion.enable = true; - indentscope.enable = true; - jump.enable = true; - jump2d = { - enable = true; - extraConfig = { + modules = { + ai.enable = true; + align.enable = true; + animate.enable = true; + comment.enable = true; + completion.enable = true; + indentscope.enable = true; + jump.enable = true; + jump2d = { + enable = true; mappings.start_jumping = "a"; }; + splitjoin.enable = true; + surround.enable = true; + tabline.enable = true; }; - splitjoin.enable = true; - surround.enable = true; - tabline.enable = true; }; - nvim-cmp = { + cmp = { enable = true; - formatting = { - format = '' - function(entry, vim_item) - vim_item.kind = string.format("%s %s", kind_icons[vim_item.kind], vim_item.kind) - vim_item.menu = ({ - buffer = "[Buffer]", - nvim_lsp = "[LSP]", - luasnip = "[LuaSnip]", - nvim_lua = "[Lua]", - latex_symbols = "[LaTeX]", - })[entry.source.name] - return vim_item - end - ''; - }; - mappingPresets = ["insert"]; - mapping = { - "" = "cmp.mapping.confirm({ select = true})"; - "" = "cmp.mapping.complete()"; - "" = { - modes = ["i" "s" "c"]; - action = '' - function(fallback) + settings = { + # formatting = { + # format = '' + # function(entry, vim_item) + # vim_item.kind = string.format("%s %s", kind_icons[vim_item.kind], vim_item.kind) + # vim_item.menu = ({ + # buffer = "[Buffer]", + # nvim_lsp = "[LSP]", + # luasnip = "[LuaSnip]", + # nvim_lua = "[Lua]", + # latex_symbols = "[LaTeX]", + # })[entry.source.name] + # return vim_item + # end + # ''; + # }; + mapping = { + "" = "cmp.mapping.confirm({ select = true})"; + "" = "cmp.mapping.complete()"; + "" = '' + cmp.mapping(function(fallback) + if cmp.visible() then local entry = cmp.get_selected_entry() if not entry then - cmp.select_next_item({ behavior = cmp.SelectBehavior.Select }) - cmp.confirm() - elseif entry then - cmp.confirm() - elseif luasnip.expandable() then - luasnip.expand() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif check_backspace() then - fallback() - else - fallback() + cmp.select_next_item({ behavior = cmp.SelectBehavior.Select }) end - end - ''; - }; - "" = { - modes = ["i" "s" "c"]; - action = '' - function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) + cmp.confirm() else fallback() end - end + end, {"i", "s", "c"}) + ''; + "" = '' + cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, {"i", "s", "c"}) ''; }; - }; - - snippet = { - luasnip.enable = false; - }; - sources = { - cmdline = { - enable = true; + # sources = { + # cmdline = { + # enable = true; + # }; + # emoji.enable = true; + # fuzzy_path.enable = true; + # # luasnip.enable = true; + # nvim_lsp.enable = true; + # nvim_lsp_document_symbol.enable = true; + # nvim_lsp_signature_help.enable = true; + # treesitter.enable = true; + # }; + view = { + entries.name = "custom"; }; - emoji.enable = true; - fuzzy_path.enable = true; - # luasnip.enable = true; - nvim_lsp.enable = true; - nvim_lsp_document_symbol.enable = true; - nvim_lsp_signature_help.enable = true; - treesitter.enable = true; - }; - view = { - entries = "custom"; }; }; project-nvim = { enable = true; + enableTelescope = true; + detectionMethods = ["lsp" "pattern"]; }; telescope = { enable = true; - extraLua = { - post = builtins.readFile ./neovim/telescope.lua; + enabledExtensions = [ + "zf-native" #TODO + "projects" #TODO + "egrepify" #TODO + ]; + # extraLua = { + # post = builtins.readFile ./neovim/telescope.lua; + # }; + keymaps = { + "ff" = { + mode = "n"; + action = "find_files"; + options.desc = "Find Files"; + }; + "fg" = { + mode = "n"; + action = "require(\"telescope\").extensions.egrepify.egrepify"; + options.desc = "Live Grep"; + }; + "fb" = { + mode = "n"; + action = "buffers"; + options.desc = "Find Buffers"; + }; + "r" = { + mode = "n"; + action = "registers"; + options.desc = "View Registers"; + }; + "pr" = { + mode = "n"; + action = "lsp_references"; + options.desc = "(LSP) References"; + }; + "pi" = { + mode = "n"; + action = "lsp_implementations"; + options.desc = "(LSP) Implementations"; + }; + "pd" = { + mode = "n"; + action = "lsp_definitions"; + options.desc = "(LSP) Definitions"; + }; + "ps" = { + mode = "n"; + action = "lsp_document_symbols"; + options.desc = "(LSP) Document Symbols"; + }; + "pws" = { + mode = "n"; + action = "lsp_workspace_symbols"; + options.desc = "(LSP) Workspace Symbols"; + }; + "pwd" = { + mode = "n"; + action = "lsp_dynamic_workspace_symbols"; + options.desc = "(LSP) Dynamic Workspace Symbols"; + }; }; }; treesitter = { enable = true; - indent = true; - folding = true; - incrementalSelection = { - enable = true; + settings = { + indent = { + enable = true; + }; + incremental_selection = { + enable = true; + }; }; + folding = true; }; trouble = { enable = true; }; - ufo = { + ts-context-commentstring = { enable = true; - extraLua.pre = '' - require('ufo').setup({ provider_selector = function(bufnr, filetype, buftype) - return {'treesitter', 'indent' } - end - }) - ''; }; - undotree = { + # ufo = { # TODO + # enable = true; + # extraLua.pre = '' + # require('ufo').setup({ provider_selector = function(bufnr, filetype, buftype) + # return {'treesitter', 'indent' } + # end + # }) + # ''; + # }; + # undotree = { + # enable = true; + # }; + vim-bbye = { enable = true; }; which-key = { enable = true; - groups = { - normal = { - "f" = "Telescope - Find"; - "r" = "View registers"; - "p" = "Telescope - LSP"; - }; - }; + settings.spec = [ + { + __unkeyed-1 = "f"; + group = "Telescope - Find"; + } + { + __unkeyed-1 = "p"; + group = "Telescope - LSP"; + } + ]; }; }; extraPlugins = ( with pkgs.vimPlugins; [ - fuzzy-nvim - nvim-ts-context-commentstring + rainbow-delimiters-nvim + telescope-symbols-nvim + overseer-nvim + nvim-web-devicons telescope-zf-native-nvim vim-ReplaceWithRegister - vim-bbye vim-dispatch-neovim vim-expand-region + nvim-ufo ] ) - ++ (with pkgs.vimExtraPlugins; [ - rainbow-delimiters-nvim - gitlinker-linrongbin16 - telescope-symbols-nvim - overseer-nvim + ++ (with pkgs.awesomeNeovimPlugins; [ + linrongbin16-gitlinker-nvim officer-nvim - nvim-web-devicons lsp-signature-nvim - nvim-rg nvim-biscuits telescope-egrepify-nvim ]); - mappings = { - normal = { - "u" = { - action = "vim.cmd.UndotreeToggle"; - desc = "Toggle undotree"; - }; - "h" = { - action = "function() vim.api.nvim_command('wincmd h') end"; - desc = "Cursor - Window left"; - }; - "j" = { - action = "function() vim.api.nvim_command('wincmd j') end"; - desc = "Cursor - Window down"; - }; - "k" = { - action = "function() vim.api.nvim_command('wincmd k') end"; - desc = "Cursor - Window up"; - }; - "l" = { - action = "function() vim.api.nvim_command('wincmd l') end"; - desc = "Cursor - Window right"; - }; - "" = { - action = "''"; - }; - "" = { - action = "''"; - }; - "n" = { - action = "function() vim.api.nvim_command('nohl') end"; - desc = "nohl"; - }; - "t" = { - action = "'Telescope'"; - desc = "Open Telescope"; - }; - }; - visual = { - "" = { - action = "''"; - }; - "" = { - action = "''"; - }; - }; - }; + keymaps = [ + { + action = "vim.cmd.UndotreeToggle"; + key = "u"; + options.desc = "Toggle undotree"; + mode = "n"; + } + { + action = "function() vim.api.nvim_command('wincmd h') end"; + key = "h"; + options.desc = "Cursor - Window left"; + mode = "n"; + } + { + action = "function() vim.api.nvim_command('wincmd j') end"; + key = "j"; + options.desc = "Cursor - Window down"; + mode = "n"; + } + { + action = "function() vim.api.nvim_command('wincmd k') end"; + key = "k"; + options.desc = "Cursor - Window up"; + mode = "n"; + } + { + action = "function() vim.api.nvim_command('wincmd l') end"; + key = "l"; + options.desc = "Cursor - Window right"; + mode = "n"; + } + { + key = ""; + action = "''"; + mode = "n"; + } + { + key = ""; + action = "''"; + mode = "n"; + } + { + key = "n"; + action = "function() vim.api.nvim_command('nohl') end"; + options.desc = "nohl"; + mode = "n"; + } + { + action = "'Telescope'"; + key = "t"; + options.desc = "Open Telescope"; + mode = "n"; + } + { + action = "''"; + key = ""; + mode = "v"; + } + { + key = ""; + action = "''"; + mode = "v"; + } + ]; }; } diff --git a/nix/home-manager/modules/packages/neovim/core.lua b/nix/home-manager/modules/packages/neovim/core.lua index f544636..d05b5b6 100644 --- a/nix/home-manager/modules/packages/neovim/core.lua +++ b/nix/home-manager/modules/packages/neovim/core.lua @@ -68,3 +68,25 @@ cmp.setup.cmdline(":", { }), matching = { disallow_symbol_nonprefix_matching = false }, }) + +do + function setup() + require("ufo").setup({ + provider_selector = function(bufnr, filetype, buftype) + return { "treesitter", "indent" } + end, + }) + + require("ufo").setup({}) + vim.o.foldcolumn = "1" -- '0' is not bad + vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value + vim.o.foldlevelstart = 99 + vim.o.foldenable = true + end + + success, output = pcall(setup) -- execute 'setup()' and catch any errors + if not success then + print("Error on setup for plugin: ufo") + print(output) + end +end diff --git a/nix/home-manager/modules/packages/neovim/pre.lua b/nix/home-manager/modules/packages/neovim/pre.lua index b146f2f..54b65a4 100644 --- a/nix/home-manager/modules/packages/neovim/pre.lua +++ b/nix/home-manager/modules/packages/neovim/pre.lua @@ -1,33 +1,33 @@ vim.g.mapleader = " " vim.g.maplocalleader = "," -local 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 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 colors = { blue = "#80a0ff", @@ -56,3 +56,25 @@ local bubbles_theme = { c = { fg = colors.white }, }, } + +do + function setup() + require("ufo").setup({ + provider_selector = function(bufnr, filetype, buftype) + return { "treesitter", "indent" } + end, + }) + + require("ufo").setup({}) + vim.o.foldcolumn = "1" -- '0' is not bad + vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value + vim.o.foldlevelstart = 99 + vim.o.foldenable = true + end + + success, output = pcall(setup) -- execute 'setup()' and catch any errors + if not success then + print("Error on setup for plugin: ufo") + print(output) + end +end -- 2.48.1 From 20180c2045dafd2c3edd957245d80bb6e530374c Mon Sep 17 00:00:00 2001 From: Anthony Cicchetti Date: Thu, 8 Aug 2024 09:11:06 -0400 Subject: [PATCH 2/6] fix rust-analyzer, updates --- nix/home-manager/modules/packages/neovim.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nix/home-manager/modules/packages/neovim.nix b/nix/home-manager/modules/packages/neovim.nix index ea5b5e1..0bea736 100644 --- a/nix/home-manager/modules/packages/neovim.nix +++ b/nix/home-manager/modules/packages/neovim.nix @@ -71,7 +71,15 @@ jsonls.enable = true; pyright.enable = true; # In preference to attempting to use pylyzer nil-ls.enable = true; - rust-analyzer.enable = true; #TODO + rust-analyzer = let + fenix = fenix.latest.withComponents ["cargo" "rustc"]; + in { + enable = true; + installCargo = false; + installRustc = false; + cargoPackage = fenix.cargo; + rustcPackage = fenix.rustc; + }; taplo.enable = true; terraformls.enable = true; }; -- 2.48.1 From 5295ace7b167ce2f9d423989e5655b41bf3452b2 Mon Sep 17 00:00:00 2001 From: Anthony Cicchetti Date: Wed, 21 Aug 2024 09:49:36 -0400 Subject: [PATCH 3/6] update flake - which-key still does not work --- nix/home-manager/modules/packages/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/home-manager/modules/packages/default.nix b/nix/home-manager/modules/packages/default.nix index cfb6813..774b64a 100644 --- a/nix/home-manager/modules/packages/default.nix +++ b/nix/home-manager/modules/packages/default.nix @@ -39,7 +39,7 @@ in { gnused gnutar gping - gql + # gql httpstat imagemagick inshellisense -- 2.48.1 From 7b9825858bc139c95b71bca6bbca48706b6f0b18 Mon Sep 17 00:00:00 2001 From: Anthony Cicchetti Date: Sun, 10 Nov 2024 18:38:00 -0500 Subject: [PATCH 4/6] Remove which-key because lmao --- nix/home-manager/modules/packages/neovim.nix | 151 +++++++++---------- 1 file changed, 74 insertions(+), 77 deletions(-) diff --git a/nix/home-manager/modules/packages/neovim.nix b/nix/home-manager/modules/packages/neovim.nix index 0bea736..228bd10 100644 --- a/nix/home-manager/modules/packages/neovim.nix +++ b/nix/home-manager/modules/packages/neovim.nix @@ -19,43 +19,45 @@ lualine = { enable = true; # theme = "bubbles_theme"; # Currently doesn't work - componentSeparators = { - left = ""; - right = ""; - }; - sectionSeparators = { - left = ""; - right = ""; - }; - sections = { - lualine_a = [ - { - name = "mode"; - separator = { - left = ""; - }; - padding = { - right = 2; - left = 0; - }; - } - ]; - lualine_b = ["filename" "branch"]; - lualine_c = ["%="]; - lualine_x = []; - lualine_y = ["filetype" "progress"]; - lualine_z = [ - { - name = "location"; - separator = { - right = ""; - }; - padding = { - right = 0; - left = 2; - }; - } - ]; + settings = { + componentSeparators = { + left = ""; + right = ""; + }; + sectionSeparators = { + left = ""; + right = ""; + }; + sections = { + lualine_a = [ + { + __unkeyed-1 = "mode"; + separator = { + left = ""; + }; + padding = { + right = 2; + left = 0; + }; + } + ]; + lualine_b = ["filename" "branch"]; + lualine_c = ["%="]; + lualine_x = []; + lualine_y = ["filetype" "progress"]; + lualine_z = [ + { + __unkeyed-1 = "location"; + separator = { + right = ""; + }; + padding = { + right = 0; + left = 2; + }; + } + ]; + }; }; }; lsp-lines = { @@ -70,8 +72,8 @@ gopls.enable = true; jsonls.enable = true; pyright.enable = true; # In preference to attempting to use pylyzer - nil-ls.enable = true; - rust-analyzer = let + nil_ls.enable = true; + rust_analyzer = let fenix = fenix.latest.withComponents ["cargo" "rustc"]; in { enable = true; @@ -110,6 +112,26 @@ splitjoin.enable = true; surround.enable = true; tabline.enable = true; + clue = { + triggers = [ + { + mode = "n"; + keys = ""; + } + { + mode = "n"; + keys = "z"; + } + ]; + clues = [ + {__raw = "require('mini.clue').gen_clues.builtin_completion()";} + {__raw = "require('mini.clue').gen_clues.g()";} + {__raw = "require('mini.clue').gen_clues.marks()";} + {__raw = "require('mini.clue').gen_clues.registers()";} + {__raw = "require('mini.clue').gen_clues.windows()";} + {__raw = "require('mini.clue').gen_clues.z()";} + ]; + }; }; }; cmp = { @@ -178,7 +200,7 @@ project-nvim = { enable = true; enableTelescope = true; - detectionMethods = ["lsp" "pattern"]; + settings.detection_methods = ["lsp" "pattern"]; }; telescope = { enable = true; @@ -270,25 +292,10 @@ # }) # ''; # }; - # undotree = { - # enable = true; - # }; vim-bbye = { enable = true; }; - which-key = { - enable = true; - settings.spec = [ - { - __unkeyed-1 = "f"; - group = "Telescope - Find"; - } - { - __unkeyed-1 = "p"; - group = "Telescope - LSP"; - } - ]; - }; + web-devicons.enable = true; }; extraPlugins = ( @@ -312,12 +319,12 @@ telescope-egrepify-nvim ]); keymaps = [ - { - action = "vim.cmd.UndotreeToggle"; - key = "u"; - options.desc = "Toggle undotree"; - mode = "n"; - } + # { + # action = "vim.cmd.UndotreeToggle"; + # key = "u"; + # options.desc = "Toggle undotree"; + # mode = "n"; + # } { action = "function() vim.api.nvim_command('wincmd h') end"; key = "h"; @@ -344,13 +351,13 @@ } { key = ""; - action = "''"; - mode = "n"; + action = ""; + mode = ["n" "v"]; } { key = ""; - action = "''"; - mode = "n"; + action = ""; + mode = ["n" "v"]; } { key = "n"; @@ -359,21 +366,11 @@ mode = "n"; } { - action = "'Telescope'"; + action = "Telescope"; key = "t"; options.desc = "Open Telescope"; mode = "n"; } - { - action = "''"; - key = ""; - mode = "v"; - } - { - key = ""; - action = "''"; - mode = "v"; - } ]; }; } -- 2.48.1 From 80075f22a1f7b826be32873b1dff9bac45bf2e08 Mon Sep 17 00:00:00 2001 From: Anthony Cicchetti Date: Sun, 10 Nov 2024 18:49:49 -0500 Subject: [PATCH 5/6] Some more --- nix/home-manager/flake.lock | 71 ++++--------------- nix/home-manager/flake.nix | 26 ++----- nix/home-manager/modules/packages/default.nix | 2 +- nix/home-manager/modules/packages/neovim.nix | 34 +-------- 4 files changed, 19 insertions(+), 114 deletions(-) diff --git a/nix/home-manager/flake.lock b/nix/home-manager/flake.lock index b74c584..016b8cd 100644 --- a/nix/home-manager/flake.lock +++ b/nix/home-manager/flake.lock @@ -144,24 +144,6 @@ "type": "github" } }, - "flake-utils_3": { - "inputs": { - "systems": "systems_3" - }, - "locked": { - "lastModified": 1726560853, - "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "freetype2": { "flake": false, "locked": { @@ -357,8 +339,12 @@ "nixneovimplugins": { "inputs": { "flake-compat": "flake-compat", - "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs" + "flake-utils": [ + "flake-utils" + ], + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { "lastModified": 1731259323, @@ -375,22 +361,6 @@ } }, "nixpkgs": { - "locked": { - "lastModified": 1730831018, - "narHash": "sha256-2S0HwIFRxYp+afuoFORcZA9TjryAf512GmE0MTfEOPU=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "8c4dc69b9732f6bbe826b5fbb32184987520ff26", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { "locked": { "lastModified": 1731261838, "narHash": "sha256-J6t1AxapM1ukQtC+6EJoDJGp+RUlAI7mlLZhhrKZXeA=", @@ -406,7 +376,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_2": { "locked": { "lastModified": 1729265718, "narHash": "sha256-4HQI+6LsO3kpWTYuVGIzhJs1cetFcwT7quWCk/6rqeo=", @@ -439,11 +409,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1731155487, - "narHash": "sha256-+D57j7BcV5O3XH9za3c3XXVLHr+F+enThAN2EeF6H/M=", + "lastModified": 1731278238, + "narHash": "sha256-4TMb2HEJss0EABkB1O1IOEjxoxWtB0/ouRa/iFeHIjs=", "owner": "nix-community", "repo": "nixvim", - "rev": "31364af1990067d5529846a2ebf17a42c5ab22ff", + "rev": "432af78ffd792257e601430f2f604c0d3e60cf8c", "type": "github" }, "original": { @@ -454,7 +424,7 @@ }, "nuschtosSearch": { "inputs": { - "flake-utils": "flake-utils_3", + "flake-utils": "flake-utils_2", "ixx": "ixx", "nixpkgs": [ "nixvim", @@ -482,7 +452,7 @@ "home-manager": "home-manager", "nix-index-database": "nix-index-database", "nixneovimplugins": "nixneovimplugins", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs", "nixvim": "nixvim", "wezterm": "wezterm", "zjstatus": "zjstatus" @@ -577,21 +547,6 @@ "type": "github" } }, - "systems_3": { - "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": [ @@ -621,7 +576,7 @@ "freetype2": "freetype2", "harfbuzz": "harfbuzz", "libpng": "libpng", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_2", "rust-overlay": "rust-overlay", "zlib": "zlib" }, diff --git a/nix/home-manager/flake.nix b/nix/home-manager/flake.nix index 17adedd..e363ca5 100644 --- a/nix/home-manager/flake.nix +++ b/nix/home-manager/flake.nix @@ -19,37 +19,19 @@ url = "github:Mic92/nix-index-database"; inputs.nixpkgs.follows = "nixpkgs"; }; - # nixneovim = { - # url = "github:nixneovim/nixneovim/2ae81f2ed61ebf4ca4d4b36ea9e8eb5163380d44"; - # inputs = { - # nixpkgs.follows = "nixpkgs"; - # home-manager.follows = "home-manager"; - # flake-utils.follows = "flake-utils"; - # nixneovimplugins.follows = "nixneovimplugins"; - # }; - # }; - # nixneovimplugins = { - # url = "github:NixNeovim/NixNeovimPlugins"; - # inputs = { - # nixpkgs.follows = "nixpkgs"; - # flake-utils.follows = "flake-utils"; - # }; - # }; nixvim = { url = "github:nix-community/nixvim"; inputs = { nixpkgs.follows = "nixpkgs"; home-manager.follows = "home-manager"; - flake-utils.follows = "flake-utils"; }; }; nixneovimplugins = { url = "github:m15a/flake-awesome-neovim-plugins"; - # inputs = { - # nixpkgs.follows = "nixpkgs"; - # home-manager.follows = "home-manager"; - # flake-utils.follows = "flake-utils"; - # }; + inputs = { + nixpkgs.follows = "nixpkgs"; + flake-utils.follows = "flake-utils"; + }; }; zjstatus = { url = "github:dj95/zjstatus"; diff --git a/nix/home-manager/modules/packages/default.nix b/nix/home-manager/modules/packages/default.nix index 774b64a..cfb6813 100644 --- a/nix/home-manager/modules/packages/default.nix +++ b/nix/home-manager/modules/packages/default.nix @@ -39,7 +39,7 @@ in { gnused gnutar gping - # gql + gql httpstat imagemagick inshellisense diff --git a/nix/home-manager/modules/packages/neovim.nix b/nix/home-manager/modules/packages/neovim.nix index 228bd10..4a39237 100644 --- a/nix/home-manager/modules/packages/neovim.nix +++ b/nix/home-manager/modules/packages/neovim.nix @@ -136,22 +136,8 @@ }; cmp = { enable = true; + autoEnableSources = true; settings = { - # formatting = { - # format = '' - # function(entry, vim_item) - # vim_item.kind = string.format("%s %s", kind_icons[vim_item.kind], vim_item.kind) - # vim_item.menu = ({ - # buffer = "[Buffer]", - # nvim_lsp = "[LSP]", - # luasnip = "[LuaSnip]", - # nvim_lua = "[Lua]", - # latex_symbols = "[LaTeX]", - # })[entry.source.name] - # return vim_item - # end - # ''; - # }; mapping = { "" = "cmp.mapping.confirm({ select = true})"; "" = "cmp.mapping.complete()"; @@ -180,18 +166,6 @@ end, {"i", "s", "c"}) ''; }; - # sources = { - # cmdline = { - # enable = true; - # }; - # emoji.enable = true; - # fuzzy_path.enable = true; - # # luasnip.enable = true; - # nvim_lsp.enable = true; - # nvim_lsp_document_symbol.enable = true; - # nvim_lsp_signature_help.enable = true; - # treesitter.enable = true; - # }; view = { entries.name = "custom"; }; @@ -319,12 +293,6 @@ telescope-egrepify-nvim ]); keymaps = [ - # { - # action = "vim.cmd.UndotreeToggle"; - # key = "u"; - # options.desc = "Toggle undotree"; - # mode = "n"; - # } { action = "function() vim.api.nvim_command('wincmd h') end"; key = "h"; -- 2.48.1 From 5a4bc9586e5be4effe1af645323b8b0a2c78792a Mon Sep 17 00:00:00 2001 From: Anthony Cicchetti Date: Sun, 10 Nov 2024 18:51:33 -0500 Subject: [PATCH 6/6] Some more 2 --- nix/home-manager/flake.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/nix/home-manager/flake.nix b/nix/home-manager/flake.nix index e363ca5..7fcd10b 100644 --- a/nix/home-manager/flake.nix +++ b/nix/home-manager/flake.nix @@ -89,7 +89,6 @@ # (_final: prev: {inherit (neovidenixpkgs.legacyPackages.${prev.system}) neovide;}) nixneovimplugins.overlays.default fenix.overlays.default - # awesome-neovim-plugins.overlays.default ]; } ); -- 2.48.1