From 0e0a04184105bfcecb609e3f62a4cd3833bda8ed Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Mon, 22 Jul 2024 16:18:50 -0300 Subject: [PATCH] wip: nvim nightly Signed-off-by: Carlos Alexandro Becker --- flake.lock | 245 ++++++++++++++++++++-- flake.nix | 10 +- modules/neovim/config/init.lua | 5 +- modules/neovim/config/lua/lsp_keymaps.lua | 20 +- 4 files changed, 243 insertions(+), 37 deletions(-) diff --git a/flake.lock b/flake.lock index 98a8a04..ba80cd5 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1720052298, - "narHash": "sha256-R6mbOh/T+WIT//p2/CzDUjtMK98DDtmNouBlCvPpgOA=", + "lastModified": 1720891037, + "narHash": "sha256-EvRkCYrk/IGkxZbs6/tr3+gHEwlai1gW9j8GjMa4CXo=", "owner": "caarlos0", "repo": "nur", - "rev": "1ca443ffbfb63f05a84236479536f7739a2ae742", + "rev": "79a46c40e36b77119f217b8a7ca41892d38bf648", "type": "github" }, "original": { @@ -43,11 +43,11 @@ ] }, "locked": { - "lastModified": 1720599442, - "narHash": "sha256-jdm+sKVbBXoyrxcHbVaV0htlpq2iFR+eJw3Xe/DPcDo=", + "lastModified": 1721270582, + "narHash": "sha256-MdZmYPPExntE5rJu88IhJSy8Um4UyZCTXhOwvzbjDVI=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "cf297a8d248db6a455b60133f6c0029c04ebe50e", + "rev": "a3e4a7b8ffc08c7dc1973822a77ad432e1ec3dec", "type": "github" }, "original": { @@ -56,16 +56,139 @@ "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": { + "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": [ + "neovim-nightly", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1719994518, + "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "neovim-nightly", + "hercules-ci-effects", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1712014858, + "narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "9126214d0a59633752a136528f5f3b9aa8565b7d", + "type": "github" + }, + "original": { + "id": "flake-parts", + "type": "indirect" + } + }, + "git-hooks": { + "inputs": { + "flake-compat": "flake-compat_2", + "gitignore": "gitignore", + "nixpkgs": [ + "neovim-nightly", + "nixpkgs" + ], + "nixpkgs-stable": [ + "neovim-nightly", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1721042469, + "narHash": "sha256-6FPUl7HVtvRHCCBQne7Ylp4p+dpP3P/OYuzjztZ4s70=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "f451c19376071a90d8c58ab1a953c6e9840527fd", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "neovim-nightly", + "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" + } + }, "goreleaser-nur": { "inputs": { "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1720447540, - "narHash": "sha256-M3bnnaM0d2GkoYx6zjnICZEq0oB9CV+SwfP01upKRYQ=", + "lastModified": 1720894158, + "narHash": "sha256-bo4vHVZBm8N6+KE1b5Esi00klFwzIFkpSXAXMtHlF70=", "owner": "goreleaser", "repo": "nur", - "rev": "5d56d5735daba946c54f2dcd8b382e034c478582", + "rev": "ec67c3ebe81bd5614190e3dd4600089859d5b179", "type": "github" }, "original": { @@ -74,6 +197,28 @@ "type": "github" } }, + "hercules-ci-effects": { + "inputs": { + "flake-parts": "flake-parts_2", + "nixpkgs": [ + "neovim-nightly", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1719226092, + "narHash": "sha256-YNkUMcCUCpnULp40g+svYsaH1RbSEj6s4WdZY/SHe38=", + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "rev": "11e4b8dc112e2f485d7c97e1cee77f9958f498f5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -81,11 +226,11 @@ ] }, "locked": { - "lastModified": 1720734513, - "narHash": "sha256-neWQ8eNtLTd+YMesb7WjKl1SVCbDyCm46LUgP/g/hdo=", + "lastModified": 1721135958, + "narHash": "sha256-H548rpPMsn25LDKn1PCFmPxmWlClJJGnvdzImHkqjuY=", "owner": "nix-community", "repo": "home-manager", - "rev": "90ae324e2c56af10f20549ab72014804a3064c7f", + "rev": "afd2021bedff2de92dfce0e257a3d03ae65c603d", "type": "github" }, "original": { @@ -94,6 +239,45 @@ "type": "github" } }, + "neovim-nightly": { + "inputs": { + "flake-compat": "flake-compat", + "flake-parts": "flake-parts", + "git-hooks": "git-hooks", + "hercules-ci-effects": "hercules-ci-effects", + "neovim-src": "neovim-src", + "nixpkgs": "nixpkgs_4" + }, + "locked": { + "lastModified": 1721281012, + "narHash": "sha256-km+EYinh23cAztAFDi2dX/Dqx9NN9jjmyFAII1CZB4Y=", + "owner": "nix-community", + "repo": "neovim-nightly-overlay", + "rev": "bc1d14af6c0834c68b09fdfd588b4e82bd8177d1", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "neovim-nightly-overlay", + "type": "github" + } + }, + "neovim-src": { + "flake": false, + "locked": { + "lastModified": 1721260040, + "narHash": "sha256-Aj1WC8RCOx000R97YPzocO3QGTaj0YVhGF1fDxWwqWo=", + "owner": "neovim", + "repo": "neovim", + "rev": "185b22720de9156393ddc22c2c59dc3eb46b8d97", + "type": "github" + }, + "original": { + "owner": "neovim", + "repo": "neovim", + "type": "github" + } + }, "nix-index-database": { "inputs": { "nixpkgs": [ @@ -101,11 +285,11 @@ ] }, "locked": { - "lastModified": 1720334033, - "narHash": "sha256-X9pEvvHTVWJphhbUYqXvlLedOndNqGB7rvhSvL2CIgU=", + "lastModified": 1720926593, + "narHash": "sha256-fW6e27L6qY6s+TxInwrS2EXZZfhMAlaNqT0sWS49qMA=", "owner": "Mic92", "repo": "nix-index-database", - "rev": "685e40e1348007d2cf76747a201bab43d86b38cb", + "rev": "5fe5b0cdf1268112dc96319388819b46dc051ef4", "type": "github" }, "original": { @@ -164,11 +348,27 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1720542800, - "narHash": "sha256-ZgnNHuKV6h2+fQ5LuqnUaqZey1Lqqt5dTUAiAnqH0QQ=", + "lastModified": 1721116560, + "narHash": "sha256-++TYlGMAJM1Q+0nMVaWBSEvEUjRs7ZGiNQOpqbQApCU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9355fa86e6f27422963132c2c9aeedb0fb963d93", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_5": { + "locked": { + "lastModified": 1721138476, + "narHash": "sha256-+W5eZOhhemLQxelojLxETfbFbc19NWawsXBlapYpqIA=", "owner": "nixos", "repo": "nixpkgs", - "rev": "feb2849fdeb70028c70d73b848214b00d324a497", + "rev": "ad0b5eed1b6031efaed382844806550c3dcb4206", "type": "github" }, "original": { @@ -180,11 +380,11 @@ }, "nur": { "locked": { - "lastModified": 1720823789, - "narHash": "sha256-IWrwFVc12e6646X31k8PmZd+6rGeWk/3dJmzw53FM5M=", + "lastModified": 1721335575, + "narHash": "sha256-dry8Y8MwACIdIBVFDOFQGpKd8PmEIPv9Ej0UdrdOlG8=", "owner": "nix-community", "repo": "NUR", - "rev": "aabf6d1edce7b1bd0883259506c632528c94a5d2", + "rev": "6e46867fdecc920a1de55dc1e553a16f54e2d2ee", "type": "github" }, "original": { @@ -200,8 +400,9 @@ "darwin": "darwin", "goreleaser-nur": "goreleaser-nur", "home-manager": "home-manager", + "neovim-nightly": "neovim-nightly", "nix-index-database": "nix-index-database", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_5", "nur": "nur" } } diff --git a/flake.nix b/flake.nix index 47cd5f9..0a94344 100644 --- a/flake.nix +++ b/flake.nix @@ -6,7 +6,7 @@ caarlos0-nur.url = "github:caarlos0/nur"; charmbracelet-nur.url = "github:charmbracelet/nur"; goreleaser-nur.url = "github:goreleaser/nur"; - # neovim-nightly.url = "github:nix-community/neovim-nightly-overlay"; + neovim-nightly.url = "github:nix-community/neovim-nightly-overlay"; home-manager = { url = "github:nix-community/home-manager"; @@ -26,7 +26,7 @@ outputs = { nur - # , neovim-nightly + , neovim-nightly , caarlos0-nur , charmbracelet-nur , goreleaser-nur @@ -35,10 +35,9 @@ , nix-index-database , nixpkgs , ... - }@inputs: + }: let overlays = [ - # inputs.neovim-nightly.overlay (final: prev: { nur = import nur { nurpkgs = prev; @@ -90,6 +89,7 @@ home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.users.carlos = { + programs.neovim.package = neovim-nightly.packages.x86_64-linux.default; imports = [ ./modules/home.nix ./modules/nixos.nix @@ -142,7 +142,7 @@ ./modules/ssh ./modules/charm.nix ./modules/hammerspoon - inputs.caarlos0-nur.homeManagerModules.default + caarlos0-nur.homeManagerModules.default # ./modules/yubikey.nix nix-index-database.hmModules.nix-index ]; diff --git a/modules/neovim/config/init.lua b/modules/neovim/config/init.lua index aa1dbe1..4a0a967 100644 --- a/modules/neovim/config/init.lua +++ b/modules/neovim/config/init.lua @@ -26,10 +26,7 @@ require("user.harpoon") require("user.telescope") require("user.git") require("auto-hlsearch").setup() -require("better_escape").setup({ - mapping = { "jk", "kj" }, - timeout = 100, -}) +require("better_escape").setup() -- -- CODING diff --git a/modules/neovim/config/lua/lsp_keymaps.lua b/modules/neovim/config/lua/lsp_keymaps.lua index 8f78698..a1f6e8a 100644 --- a/modules/neovim/config/lua/lsp_keymaps.lua +++ b/modules/neovim/config/lua/lsp_keymaps.lua @@ -17,24 +17,32 @@ end M.on_attach = function(bufnr) local builtin = require("telescope.builtin") keymap("gd", builtin.lsp_definitions, bufnr) - keymap("gr", builtin.lsp_references, bufnr) + keymap("gr", function() + vim.notify("use grr no") + end, bufnr) keymap("ls", builtin.lsp_document_symbols, bufnr) keymap("lS", builtin.lsp_dynamic_workspace_symbols, bufnr) - keymap("gs", vim.lsp.buf.signature_help, bufnr) + keymap("gs", function() + vim.notify("use +s now") + end, bufnr) keymap("gi", builtin.lsp_implementations, bufnr) keymap("gD", vim.lsp.buf.declaration, bufnr) keymap("K", vim.lsp.buf.hover, bufnr) keymap("D", builtin.lsp_type_definitions, bufnr) keymap("cl", vim.lsp.codelens.run, bufnr) - keymap("rn", vim.lsp.buf.rename, bufnr) - keymap("ca", vim.lsp.buf.code_action, bufnr) + keymap("rn", function() + vim.notify("use grn now") + end, bufnr) + keymap("ca", function() + vim.notify("use gra now") + end, bufnr) keymap("gl", vim.diagnostic.open_float, bufnr) keymap("[d", function() - vim.diagnostic.goto_prev() + vim.diagnostic.jump({ count = -1 }) vim.cmd("norm zz") end, bufnr) keymap("]d", function() - vim.diagnostic.goto_next() + vim.diagnostic.jump({ count = 1 }) vim.cmd("norm zz") end, bufnr)