mirror of
				https://github.com/NotAShelf/nvf.git
				synced 2025-10-31 11:02:37 +00:00 
			
		
		
		
	feat: add flash.nvim
A motion plugin, from Folke. https://github.com/folke/flash.nvim
This commit is contained in:
		
					parent
					
						
							
								dafe978ffa
							
						
					
				
			
			
				commit
				
					
						514d4da2d3
					
				
			
		
					 6 changed files with 97 additions and 2 deletions
				
			
		|  | @ -303,4 +303,7 @@ | ||||||
| 
 | 
 | ||||||
| [ckoehler](https://github.com/ckoehler): | [ckoehler](https://github.com/ckoehler): | ||||||
| 
 | 
 | ||||||
|  | [flash.nvim]: https://github.com/folke/flash.nvim | ||||||
|  | 
 | ||||||
| - Fix oil config referencing snacks | - Fix oil config referencing snacks | ||||||
|  | - Add [flash.nvim] plugin to `vim.utility.motion.flash-nvim` | ||||||
|  |  | ||||||
|  | @ -1,5 +1,6 @@ | ||||||
| _: { | _: { | ||||||
|   imports = [ |   imports = [ | ||||||
|  |     ./flash | ||||||
|     ./hop |     ./hop | ||||||
|     ./leap |     ./leap | ||||||
|     ./precognition |     ./precognition | ||||||
|  |  | ||||||
							
								
								
									
										34
									
								
								modules/plugins/utility/motion/flash/config.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								modules/plugins/utility/motion/flash/config.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,34 @@ | ||||||
|  | { | ||||||
|  |   config, | ||||||
|  |   lib, | ||||||
|  |   ... | ||||||
|  | }: let | ||||||
|  |   inherit (lib.modules) mkIf; | ||||||
|  |   inherit (lib.nvim.binds) mkKeymap; | ||||||
|  |   inherit (lib.nvim.lua) toLuaObject; | ||||||
|  |   inherit (lib.nvim.dag) entryAnywhere; | ||||||
|  | 
 | ||||||
|  |   cfg = config.vim.utility.motion.flash-nvim; | ||||||
|  | in { | ||||||
|  |   config = mkIf cfg.enable { | ||||||
|  |     vim = { | ||||||
|  |       lazy.plugins = { | ||||||
|  |         "flash-nvim" = { | ||||||
|  |           package = "flash-nvim"; | ||||||
|  |           setupModule = "flash"; | ||||||
|  |           setupOpts = cfg.setupOpts; | ||||||
|  | 
 | ||||||
|  |           lazy = true; | ||||||
|  | 
 | ||||||
|  |           keys = [ | ||||||
|  |             (mkKeymap ["n" "o" "x"] cfg.mappings.jump "<cmd>lua require(\"flash\").jump()<cr>" {desc = "Flash";}) | ||||||
|  |             (mkKeymap ["n" "o" "x"] cfg.mappings.treesitter "<cmd>lua require(\"flash\").treesitter()<cr>" {desc = "Flash Treesitter";}) | ||||||
|  |             (mkKeymap "o" cfg.mappings.remote "<cmd>lua require(\"flash\").remote()<cr>" {desc = "Remote Flash";}) | ||||||
|  |             (mkKeymap ["o" "x"] cfg.mappings.treesitter_search "<cmd>lua require(\"flash\").treesitter_search()<cr>" {desc = "Treesitter Search";}) | ||||||
|  |             (mkKeymap "c" cfg.mappings.toggle "<cmd>lua require(\"flash\").toggle()<cr>" {desc = "Toggle Flash Search";}) | ||||||
|  |           ]; | ||||||
|  |         }; | ||||||
|  |       }; | ||||||
|  |     }; | ||||||
|  |   }; | ||||||
|  | } | ||||||
							
								
								
									
										6
									
								
								modules/plugins/utility/motion/flash/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								modules/plugins/utility/motion/flash/default.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,6 @@ | ||||||
|  | { | ||||||
|  |   imports = [ | ||||||
|  |     ./flash.nix | ||||||
|  |     ./config.nix | ||||||
|  |   ]; | ||||||
|  | } | ||||||
							
								
								
									
										38
									
								
								modules/plugins/utility/motion/flash/flash.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								modules/plugins/utility/motion/flash/flash.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,38 @@ | ||||||
|  | {lib, ...}: let | ||||||
|  |   inherit (lib.options) mkEnableOption mkOption; | ||||||
|  |   inherit (lib.types) nullOr str; | ||||||
|  |   inherit (lib.nvim.types) mkPluginSetupOption; | ||||||
|  | in { | ||||||
|  |   options.vim.utility.motion.flash-nvim = { | ||||||
|  |     enable = mkEnableOption "enhanced code navigation with flash.nvim"; | ||||||
|  |     setupOpts = mkPluginSetupOption "flash-nvim" {}; | ||||||
|  | 
 | ||||||
|  |     mappings = { | ||||||
|  |       jump = mkOption { | ||||||
|  |         type = nullOr str; | ||||||
|  |         default = "s"; | ||||||
|  |         description = "Jump"; | ||||||
|  |       }; | ||||||
|  |       treesitter = mkOption { | ||||||
|  |         type = nullOr str; | ||||||
|  |         default = "S"; | ||||||
|  |         description = "Treesitter"; | ||||||
|  |       }; | ||||||
|  |       remote = mkOption { | ||||||
|  |         type = nullOr str; | ||||||
|  |         default = "r"; | ||||||
|  |         description = "Remote Flash"; | ||||||
|  |       }; | ||||||
|  |       treesitter_search = mkOption { | ||||||
|  |         type = nullOr str; | ||||||
|  |         default = "R"; | ||||||
|  |         description = "Treesitter Search"; | ||||||
|  |       }; | ||||||
|  |       toggle = mkOption { | ||||||
|  |         type = nullOr str; | ||||||
|  |         default = "<c-s>"; | ||||||
|  |         description = "Toggle Flash Search"; | ||||||
|  |       }; | ||||||
|  |     }; | ||||||
|  |   }; | ||||||
|  | } | ||||||
|  | @ -471,6 +471,19 @@ | ||||||
|       "url": "https://github.com/j-hui/fidget.nvim/archive/d9ba6b7bfe29b3119a610892af67602641da778e.tar.gz", |       "url": "https://github.com/j-hui/fidget.nvim/archive/d9ba6b7bfe29b3119a610892af67602641da778e.tar.gz", | ||||||
|       "hash": "070jadci8x6zgxnsqaldjah1gm1p78wscsb9wpn5wn8mjkyk2m80" |       "hash": "070jadci8x6zgxnsqaldjah1gm1p78wscsb9wpn5wn8mjkyk2m80" | ||||||
|     }, |     }, | ||||||
|  |     "flash-nvim": { | ||||||
|  |       "type": "Git", | ||||||
|  |       "repository": { | ||||||
|  |         "type": "GitHub", | ||||||
|  |         "owner": "folke", | ||||||
|  |         "repo": "flash.nvim" | ||||||
|  |       }, | ||||||
|  |       "branch": "main", | ||||||
|  |       "submodules": false, | ||||||
|  |       "revision": "3c942666f115e2811e959eabbdd361a025db8b63", | ||||||
|  |       "url": "https://github.com/folke/flash.nvim/archive/3c942666f115e2811e959eabbdd361a025db8b63.tar.gz", | ||||||
|  |       "hash": "1xil2lkyr404zni1qmkwrl9hvbwjjk52fmncg59vqmvdybwsnqni" | ||||||
|  |     }, | ||||||
|     "flutter-tools-nvim": { |     "flutter-tools-nvim": { | ||||||
|       "type": "Git", |       "type": "Git", | ||||||
|       "repository": { |       "repository": { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Christoph Koehler
				Christoph Koehler