refactor: inputs/ --> {sys,home}/
This commit is contained in:
		
							parent
							
								
									8f22a24963
								
							
						
					
					
						commit
						f77c627980
					
				
					 225 changed files with 77 additions and 88 deletions
				
			
		
							
								
								
									
										50
									
								
								home/modules/console/editor/nvim/keymapping.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								home/modules/console/editor/nvim/keymapping.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,50 @@ | |||
| { config, lib, ... }: | ||||
| 
 | ||||
| let | ||||
|   cfg = config.homeModules.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; | ||||
|           }) | ||||
|           { | ||||
|             "<Space>" = "<NOP>"; | ||||
|             "esc" = ":noh<CR>"; | ||||
|             "Y" = "$y"; | ||||
|           }; | ||||
|           visual = | ||||
|             lib.mapAttrsToList | ||||
|             (key: action: { | ||||
|               mode = "v"; | ||||
|               inherit action key; | ||||
|             }) | ||||
|             { | ||||
|               # better indenting | ||||
|               ">" = ">gv"; | ||||
|               "<" = "<gv"; | ||||
|               "<TAB>" = ">gv"; | ||||
|               "<S-TAB>" = "<gv"; | ||||
| 
 | ||||
|               # move selected line / block of text in visual mode | ||||
|               "K" = ":m '<-2<CR>gv=gv"; | ||||
|               "J" = ":m '>+1<CR>gv=gv"; | ||||
|             }; | ||||
|       in | ||||
|       config.nixvim.helpers.keymaps.mkKeymaps | ||||
|       {options.silent = true;} | ||||
|       (normal ++ visual); | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue