Personal Nix flake
nixos home-manager nix
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: Dedicated keymaps module for nvim, WIP helix-like bindings

+142 -29
+11 -29
nix/home/modules/cli/editors/neovim/default.nix
··· 8 8 cfg = config.my.cli.editors.neovim; 9 9 in { 10 10 imports = [ 11 + ./keymaps 11 12 ./treesitter.nix 12 13 ]; 13 14 14 - options.my.cli.editors.neovim.enable = lib.mkEnableOption "neovim"; 15 + options.my.cli.editors.neovim = { 16 + enable = lib.mkEnableOption "neovim"; 17 + plugins.animotion.enable = lib.mkEnableOption "animotion plugin"; 18 + }; 15 19 16 20 config = lib.mkIf cfg.enable { 17 21 programs.nixvim = { 18 22 enable = true; 19 23 imports = [./nixvimPlugins]; 20 - globals = { 21 - mapleader = "<Space>"; 22 - maplocalleader = "<Space>"; 23 - }; 24 24 opts = { 25 25 ignorecase = true; 26 26 smartcase = true; 27 27 }; 28 28 nixpkgs.overlays = [self.overlays.vimPlugins]; 29 - keymaps = [ 30 - { 31 - mode = ""; 32 - key = "<Space>"; 33 - action = "<Nop>"; 34 - options.silent = true; 35 - options.noremap = true; 36 - } 37 - ]; 38 29 plugins = { 39 30 animotion = { 40 - enable = true; 31 + inherit (cfg.plugins.animotion) enable; 41 32 mode = "helix"; 42 33 }; 43 34 coq = { ··· 100 91 lookahead = true; 101 92 }; 102 93 }; 103 - telescope = { 94 + telescope.enable = true; 95 + web-devicons.enable = true; 96 + which-key = { 104 97 enable = true; 105 - keymaps = { 106 - "<leader>f" = { 107 - mode = "n"; 108 - action = "find_files"; 109 - options.desc = "Pick file"; 110 - }; 111 - "<leader>/" = { 112 - mode = "n"; 113 - action = "live_grep"; 114 - options.desc = "Search file contents"; 115 - }; 98 + settings = { 99 + preset = "helix"; 116 100 }; 117 101 }; 118 - web-devicons.enable = true; 119 - which-key.enable = true; 120 102 }; 121 103 }; 122 104 };
+26
nix/home/modules/cli/editors/neovim/keymaps/default.nix
··· 1 + { 2 + config, 3 + lib, 4 + ... 5 + }: { 6 + imports = [ 7 + ./helix.nix 8 + ]; 9 + 10 + config = lib.mkIf config.my.cli.editors.neovim.enable { 11 + programs.nixvim = { 12 + globals = { 13 + mapleader = " "; 14 + maplocalleader = " "; 15 + }; 16 + keymaps = lib.mapAttrsToList (key: attrs: attrs // {inherit key;}) { 17 + "Y" = { 18 + mode = "n"; 19 + action = "yg_"; 20 + options.desc = "Copy remainder of line"; 21 + options.remap = true; 22 + }; 23 + }; 24 + }; 25 + }; 26 + }
+105
nix/home/modules/cli/editors/neovim/keymaps/helix.nix
··· 1 + { 2 + config, 3 + lib, 4 + ... 5 + }: { 6 + config = lib.mkIf config.my.cli.editors.neovim.enable { 7 + programs.nixvim = { 8 + keymaps = lib.mapAttrsToList (key: attrs: attrs // {inherit key;}) { 9 + "R" = { 10 + mode = ["n" "v"]; 11 + action = "\"_P"; 12 + options.desc = "Replace selection"; 13 + }; 14 + "x" = { 15 + mode = ["n" "v"]; 16 + action = "V"; 17 + options.desc = "Extend selection to lines"; 18 + }; 19 + "X" = { 20 + mode = ["n" "v"]; 21 + action = "V"; 22 + options.desc = "Extend selection to lines"; 23 + }; 24 + "<M-d>" = { 25 + mode = "v"; 26 + action = "\"_d"; 27 + options.desc = "Delete selection without yanking"; 28 + }; 29 + "<M-D>" = { 30 + mode = "v"; 31 + action = "\"_D"; 32 + options.desc = "Delete selection without yanking"; 33 + }; 34 + "<M-c>" = { 35 + mode = "v"; 36 + action = "\"_c"; 37 + options.desc = "Replace selection without yanking"; 38 + }; 39 + "<M-C>" = { 40 + mode = "v"; 41 + action = "\"_C"; 42 + options.desc = "Replace selection without yanking"; 43 + }; 44 + "<leader>y" = { 45 + mode = "v"; 46 + action = "\"+y"; 47 + options.desc = "Yank to system clipboard"; 48 + options.noremap = true; 49 + }; 50 + "<leader>Y" = { 51 + mode = "n"; 52 + action = "\"+Y"; 53 + options.desc = "Yank remainder of line to system clipboard"; 54 + options.noremap = true; 55 + }; 56 + "<leader>p" = { 57 + mode = "v"; 58 + action = "\"+p"; 59 + options.desc = "Paste from system clipboard"; 60 + options.noremap = true; 61 + }; 62 + "<leader>P" = { 63 + mode = "n"; 64 + action = "\"+P"; 65 + options.desc = "Paste before from system clipboard"; 66 + options.noremap = true; 67 + }; 68 + }; 69 + plugins = { 70 + telescope.keymaps = { 71 + "<leader>b" = { 72 + mode = "n"; 73 + action = "buffers"; 74 + options.desc = "Open buffer picker"; 75 + }; 76 + "<leader>f" = { 77 + mode = "n"; 78 + action = "find_files"; 79 + options.desc = "Open file picker"; 80 + }; 81 + "<leader>j" = { 82 + mode = "n"; 83 + action = "jumplist"; 84 + options.desc = "Open jumplist picker"; 85 + }; 86 + "<leader>?" = { 87 + mode = "n"; 88 + action = "commands"; 89 + options.desc = "Open command pallete"; 90 + }; 91 + "<leader>'" = { 92 + mode = "n"; 93 + action = "resume"; 94 + options.desc = "Open last picker"; 95 + }; 96 + "<leader>/" = { 97 + mode = "n"; 98 + action = "live_grep"; 99 + options.desc = "Search file contents"; 100 + }; 101 + }; 102 + }; 103 + }; 104 + }; 105 + }