neovim: add extended obsidian plugin module
This commit is contained in:
		
							parent
							
								
									928db722b4
								
							
						
					
					
						commit
						acb87b6bb1
					
				
					 14 changed files with 139 additions and 34 deletions
				
			
		
							
								
								
									
										37
									
								
								outputs/pkgs/ook-vim/modules/plugins/obsidian/config.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								outputs/pkgs/ook-vim/modules/plugins/obsidian/config.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,37 @@ | |||
| { | ||||
|   config, | ||||
|   lib, | ||||
|   options, | ||||
|   ... | ||||
| }: let | ||||
|   inherit (lib.modules) mkIf; | ||||
|   inherit (lib.nvim.dag) entryAnywhere; | ||||
|   inherit (lib.nvim.lua) toLuaObject; | ||||
|   inherit (lib.nvim.binds) mkKeymap pushDownDefault; | ||||
|   inherit (options.vim.notes.obsidianExtended) mappings; | ||||
| 
 | ||||
|   cfg = config.vim.notes.obsidianExtended; | ||||
|   keys = cfg.mappings; | ||||
| in { | ||||
|   config = mkIf cfg.enable { | ||||
|     vim = { | ||||
|       startPlugins = [ | ||||
|         "obsidian-nvim" | ||||
|         "vim-markdown" | ||||
|         "tabular" | ||||
|       ]; | ||||
| 
 | ||||
|       binds.whichKey.register = pushDownDefault { | ||||
|         "<leader>o" = "+Notes"; | ||||
|       }; | ||||
| 
 | ||||
|       pluginRC.obsidian = entryAnywhere '' | ||||
|         require("obsidian").setup(${toLuaObject cfg.setupOpts}) | ||||
|       ''; | ||||
|       keymaps = [ | ||||
|         (mkKeymap "n" keys.openNote "<cmd>ObsidianOpen<CR>" {desc = mappings.openNote.description;}) | ||||
|         (mkKeymap "n" keys.findNote "<cmd>ObsidianQuickSwitch<CR>" {desc = mappings.findNote.description;}) | ||||
|       ]; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue