diff --git a/flake.lock b/flake.lock index 89154d8..c0eacb4 100644 --- a/flake.lock +++ b/flake.lock @@ -213,11 +213,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1706459685, - "narHash": "sha256-/OaxGhNJrBZcOBGKvEC7KFDShtMJOIpny5+N9G/qRkE=", + "lastModified": 1706565513, + "narHash": "sha256-eiiHgBdpluVFjjWaunP1GFEDYnCLq54CeCD7h1JP7jY=", "owner": "helix-editor", "repo": "helix", - "rev": "87a720c3a13ccc7245f5b0befc008db5bd039032", + "rev": "cf4492174d0ee27bd3c73a5fa57fe3a26aa064be", "type": "github" }, "original": { @@ -233,11 +233,11 @@ ] }, "locked": { - "lastModified": 1706435589, - "narHash": "sha256-yhEYJxMv5BkfmUuNe4QELKo+V5eq1pwhtVs6kEziHfE=", + "lastModified": 1706473109, + "narHash": "sha256-iyuAvpKTsq2u23Cr07RcV5XlfKExrG8gRpF75hf1uVc=", "owner": "nix-community", "repo": "home-manager", - "rev": "4d54c29bce71f8c261513e0662cc573d30f3e33e", + "rev": "d634c3abafa454551f2083b054cd95c3f287be61", "type": "github" }, "original": { @@ -278,11 +278,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1706485369, - "narHash": "sha256-FHojTmzX3SrAC+VXu+xdmTPwZtlSQ8KzRfq89c7DrN0=", + "lastModified": 1706571425, + "narHash": "sha256-VwVUPb5vuy4GGUx1XMhDMaKk9n8Gs5xUTG9CItoHL04=", "owner": "hyprwm", "repo": "hyprland", - "rev": "4b4bd90b1450cbfc01d9ac429363cc7cecd6be8b", + "rev": "3ff59e7e1d859daa503b88ef125d087bc100abfe", "type": "github" }, "original": { @@ -577,11 +577,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1706191920, - "narHash": "sha256-eLihrZAPZX0R6RyM5fYAWeKVNuQPYjAkCUBr+JNvtdE=", + "lastModified": 1706371002, + "narHash": "sha256-dwuorKimqSYgyu8Cw6ncKhyQjUDOyuXoxDTVmAXq88s=", "owner": "nixos", "repo": "nixpkgs", - "rev": "ae5c332cbb5827f6b1f02572496b141021de335f", + "rev": "c002c6aa977ad22c60398daaa9be52f2203d0006", "type": "github" }, "original": { @@ -616,11 +616,11 @@ "pre-commit-hooks": "pre-commit-hooks" }, "locked": { - "lastModified": 1706514457, - "narHash": "sha256-rfdCFizftdKpkKzXB7HjopQAftHgNIyyTQPkuDgo5Os=", + "lastModified": 1706539542, + "narHash": "sha256-Zbd9/0iTDNwf6ePvKkISvSMK6S7kmfsPzyG5f57sVA8=", "owner": "nix-community", "repo": "nixvim", - "rev": "395836480995d418b96df527ebded1bc4b3134f0", + "rev": "37d124e94603f821b56072794c4800ad10252fd7", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 951d242..5eddb07 100644 --- a/flake.nix +++ b/flake.nix @@ -10,7 +10,10 @@ nix-colors.url = "github:misterio77/nix-colors"; - nixvim.url = "github:nix-community/nixvim"; + nixvim = { + url = "github:nix-community/nixvim"; + inputs.nixpkgs.follows = "nixpkgs"; + }; firefox-addons = { url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; diff --git a/home/modules/console/editor/nvim/default.nix b/home/modules/console/editor/nvim/default.nix index 854d7ee..293cb4b 100644 --- a/home/modules/console/editor/nvim/default.nix +++ b/home/modules/console/editor/nvim/default.nix @@ -8,6 +8,9 @@ in { imports = [ inputs.nixvim.homeManagerModules.nixvim + ./settings.nix + ./keymapping.nix + ./plugins ]; config = lib.mkIf cfg.enable { @@ -18,26 +21,12 @@ in programs.nixvim = { enable = true; - - options = { - number = true; - }; - - globals = { - mapleader = " "; - updatetime = 200; - timeoutlen = 400; - }; - plugins = { - lualine = { - enable = true; - }; which-key = { enable = true; - }; - indent-blankline = { - enable = true; + keyLabels = { + " " = ""; + }; }; }; diff --git a/home/modules/console/editor/nvim/keymappings.nix b/home/modules/console/editor/nvim/keymappings.nix new file mode 100644 index 0000000..0798e28 --- /dev/null +++ b/home/modules/console/editor/nvim/keymappings.nix @@ -0,0 +1,50 @@ +{ config, lib, ... }: + +let + cfg = config.desktop.console.editor.nvim; +in + +{ + config = lib.mkIf cfg.enable { + programs.nixvim = { + globals = { + mapleader = " "; + maplocalleader = " "; + }; + + keymaps = let + normal = + lib.mapAttrsToList + (key: action: { + mode = "n"; + inherit action key; + }) + { + "" = ""; + "esc" = ":noh"; + "Y" = "$y"; + }; + visual = + lib.mapAttrsToList + (key: action: { + mode = "v"; + inherit action key; + }) + { + # better indenting + ">" = ">gv"; + "<" = "" = ">gv"; + "" = "