neovim: mapping obsidian option init
This commit is contained in:
		
							parent
							
								
									c4053ad9c1
								
							
						
					
					
						commit
						779b437a13
					
				
					 4 changed files with 37 additions and 0 deletions
				
			
		|  | @ -2,5 +2,6 @@ | |||
|   imports = [ | ||||
|     ./gruvbox-material | ||||
|     ./telescope | ||||
|     ./obsidian | ||||
|   ]; | ||||
| } | ||||
|  |  | |||
|  | @ -0,0 +1,21 @@ | |||
| { | ||||
|   config, | ||||
|   lib, | ||||
|   options, | ||||
|   ... | ||||
| }: let | ||||
|   inherit (lib) mkIf; | ||||
|   inherit (lib.nvim.binds) mkKeymap; | ||||
|   inherit (options.vim.notes.obsidian) mappings; | ||||
| 
 | ||||
|   cfg = config.vim.notes.obsidian; | ||||
|   keys = cfg.mappings; | ||||
| in { | ||||
|   config = mkIf cfg.enable { | ||||
|     vim = { | ||||
|       keymaps = [ | ||||
|         (mkKeymap "n" keys.openNote "<cmd>ObsidianOpen<CR>" {desc = mappings.openNote.description;}) | ||||
|       ]; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
|  | @ -0,0 +1,6 @@ | |||
| { | ||||
|   imports = [ | ||||
|     ./config.nix | ||||
|     ./obsidian.nix | ||||
|   ]; | ||||
| } | ||||
|  | @ -0,0 +1,9 @@ | |||
| {lib, ...}: let | ||||
|   inherit (lib.nvim.binds) mkMappingOption; | ||||
| in { | ||||
|   options.vim.notes.obsidian = { | ||||
|     mappings = { | ||||
|       openNote = mkMappingOption "Open obsidian note" "<leader>oo"; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue