mirror of
				https://github.com/NotAShelf/nvf.git
				synced 2025-10-31 02:52:37 +00:00 
			
		
		
		
	feat: add todo-comments keybindings
This commit is contained in:
		
					parent
					
						
							
								bdff97103d
							
						
					
				
			
			
				commit
				
					
						586a7f5b41
					
				
			
		
					 2 changed files with 14 additions and 10 deletions
				
			
		|  | @ -7,17 +7,19 @@ | ||||||
| with lib; | with lib; | ||||||
| with builtins; let | with builtins; let | ||||||
|   cfg = config.vim.notes.todo-comments; |   cfg = config.vim.notes.todo-comments; | ||||||
|  |   self = import ./todo-comments.nix {inherit lib;}; | ||||||
|  |   mappings = self.options.vim.notes.todo-comments.mappings; | ||||||
| in { | in { | ||||||
|   config = mkIf (cfg.enable) { |   config = mkIf (cfg.enable) { | ||||||
|     vim.startPlugins = [ |     vim.startPlugins = [ | ||||||
|       "todo-comments" |       "todo-comments" | ||||||
|     ]; |     ]; | ||||||
| 
 | 
 | ||||||
|     vim.maps.normal = { |     vim.maps.normal = mkMerge [ | ||||||
|       "<leader>tdq" = {action = ":TodoQuickFix<CR>";}; |       (mkBinding cfg.mappings.quickFix ":TodoQuickFix<CR>" mappings.quickFix.description) | ||||||
|       "<leader>tds" = {action = ":TodoTelescope<CR>";}; |       (mkIf config.vim.telescope.enable (mkBinding cfg.mappings.telescope ":TodoTelescope<CR>" mappings.telescope.description)) | ||||||
|       "<leader>tdt" = {action = ":TodoTrouble<CR>";}; |       (mkIf config.vim.lsp.trouble.enable (mkBinding cfg.mappings.trouble ":TodoTrouble<CR>" mappings.trouble.description)) | ||||||
|     }; |     ]; | ||||||
| 
 | 
 | ||||||
|     vim.luaConfigRC.todo-comments = '' |     vim.luaConfigRC.todo-comments = '' | ||||||
|       require('todo-comments').setup { |       require('todo-comments').setup { | ||||||
|  |  | ||||||
|  | @ -1,8 +1,4 @@ | ||||||
| { | {lib, ...}: | ||||||
|   config, |  | ||||||
|   lib, |  | ||||||
|   ... |  | ||||||
| }: |  | ||||||
| with lib; | with lib; | ||||||
| with builtins; { | with builtins; { | ||||||
|   options.vim.notes.todo-comments = { |   options.vim.notes.todo-comments = { | ||||||
|  | @ -21,5 +17,11 @@ with builtins; { | ||||||
|         description = "ripgrep regex pattern used for searching comments"; |         description = "ripgrep regex pattern used for searching comments"; | ||||||
|       }; |       }; | ||||||
|     }; |     }; | ||||||
|  | 
 | ||||||
|  |     mappings = { | ||||||
|  |       quickFix = mkMappingOption "Open Todo-s in a quickfix list" "<leader>tdq"; | ||||||
|  |       telescope = mkMappingOption "Open Todo-s in telescope" "<leader>tds"; | ||||||
|  |       trouble = mkMappingOption "Open Todo-s in Trouble" "<leader>tdt"; | ||||||
|  |     }; | ||||||
|   }; |   }; | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 n3oney
				n3oney