mirror of
				https://github.com/NotAShelf/nvf.git
				synced 2025-10-31 19:12:38 +00:00 
			
		
		
		
	feat(orgmode): custom setup
This commit is contained in:
		
					parent
					
						
							
								e5fba51877
							
						
					
				
			
			
				commit
				
					
						2feaadc266
					
				
			
		
					 2 changed files with 22 additions and 16 deletions
				
			
		|  | @ -6,6 +6,7 @@ | |||
|   inherit (lib.modules) mkIf mkMerge; | ||||
|   inherit (lib.nvim.dag) entryAnywhere; | ||||
|   inherit (lib.nvim.binds) pushDownDefault; | ||||
|   inherit (lib.nvim.lua) toLuaObject; | ||||
| 
 | ||||
|   cfg = config.vim.notes.orgmode; | ||||
| in { | ||||
|  | @ -37,10 +38,7 @@ in { | |||
|             }, | ||||
|           } | ||||
| 
 | ||||
|           require('orgmode').setup({ | ||||
|             org_agenda_files = ${cfg.orgAgendaFiles}, | ||||
|             org_default_notes_file = '${cfg.orgDefaultNotesFile}', | ||||
|           }) | ||||
|           require('orgmode').setup(${toLuaObject cfg.setupOpts}) | ||||
|         ''; | ||||
|       }; | ||||
|     } | ||||
|  |  | |||
|  | @ -4,23 +4,31 @@ | |||
|   pkgs, | ||||
|   ... | ||||
| }: let | ||||
|   inherit (lib.options) mkOption mkEnableOption; | ||||
|   inherit (lib.types) str; | ||||
|   inherit (lib.nvim.types) mkGrammarOption; | ||||
|   inherit (lib.modules) mkRenamedOptionModule; | ||||
|   inherit (lib.options) mkEnableOption mkOption; | ||||
|   inherit (lib.types) str listOf; | ||||
|   inherit (lib.nvim.types) mkGrammarOption mkPluginSetupOption; | ||||
| in { | ||||
|   imports = [ | ||||
|     (mkRenamedOptionModule ["vim" "notes" "orgmode" "orgAgendaFiles"] ["vim" "notes" "orgmode" "setupOpts" "org_agenda_files"]) | ||||
|     (mkRenamedOptionModule ["vim" "notes" "orgmode" "orgDefaultNotesFile"] ["vim" "notes" "orgmode" "setupOpts" "org_default_notes_file"]) | ||||
|   ]; | ||||
| 
 | ||||
|   options.vim.notes.orgmode = { | ||||
|     enable = mkEnableOption "nvim-orgmode: Neovim plugin for Emac Orgmode. Get the best of both worlds"; | ||||
| 
 | ||||
|     orgAgendaFiles = mkOption { | ||||
|       type = str; | ||||
|       default = "{'~/Documents/org/*', '~/my-orgs/**/*'}"; | ||||
|       description = "List of org files to be used as agenda files."; | ||||
|     }; | ||||
|     setupOpts = mkPluginSetupOption "Orgmode" { | ||||
|       org_agenda_files = mkOption { | ||||
|         type = listOf str; | ||||
|         default = ["~/Documents/org/*" "~/my-orgs/**/*"]; | ||||
|         description = "List of org files to be used as agenda files."; | ||||
|       }; | ||||
| 
 | ||||
|     orgDefaultNotesFile = mkOption { | ||||
|       type = str; | ||||
|       default = "~/Documents/org/refile.org"; | ||||
|       description = "Default org file to be used for notes."; | ||||
|       org_default_notes_file = mkOption { | ||||
|         type = str; | ||||
|         default = "~/Documents/org/refile.org"; | ||||
|         description = "Default org file to be used for notes."; | ||||
|       }; | ||||
|     }; | ||||
| 
 | ||||
|     treesitter = { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Ching Pei Yang
				Ching Pei Yang