mirror of
				https://github.com/NotAShelf/nvf.git
				synced 2025-10-31 11:02:37 +00:00 
			
		
		
		
	Merge pull request #877 from Noah765/navbuddy-update
ui/breadcrumbs: update navbuddy
This commit is contained in:
		
				commit
				
					
						d147606a35
					
				
			
		
					 2 changed files with 62 additions and 39 deletions
				
			
		|  | @ -4,7 +4,7 @@ | ||||||
|   ... |   ... | ||||||
| }: let | }: let | ||||||
|   inherit (lib.options) mkOption mkEnableOption; |   inherit (lib.options) mkOption mkEnableOption; | ||||||
|   inherit (lib.types) nullOr listOf enum bool str int either; |   inherit (lib.types) nullOr listOf enum bool str int; | ||||||
|   inherit (lib.modules) mkRenamedOptionModule; |   inherit (lib.modules) mkRenamedOptionModule; | ||||||
|   inherit (lib.nvim.types) mkPluginSetupOption borderType; |   inherit (lib.nvim.types) mkPluginSetupOption borderType; | ||||||
|   mkSimpleIconOption = default: |   mkSimpleIconOption = default: | ||||||
|  | @ -74,7 +74,7 @@ in { | ||||||
|           ::: {.note} |           ::: {.note} | ||||||
|           This will pass `draw_empty` to the `nvim_navic` winbar |           This will pass `draw_empty` to the `nvim_navic` winbar | ||||||
|           component, which causes the component to be drawn even |           component, which causes the component to be drawn even | ||||||
|           if it's empty |           if it's empty. | ||||||
|           ::: |           ::: | ||||||
|         ''; |         ''; | ||||||
|       }; |       }; | ||||||
|  | @ -86,145 +86,163 @@ in { | ||||||
|         close = mkOption { |         close = mkOption { | ||||||
|           type = str; |           type = str; | ||||||
|           default = "<esc>"; |           default = "<esc>"; | ||||||
|           description = "keybinding to close Navbuddy UI"; |           description = "Close and return the cursor to its original location."; | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         nextSibling = mkOption { |         nextSibling = mkOption { | ||||||
|           type = str; |           type = str; | ||||||
|           default = "j"; |           default = "j"; | ||||||
|           description = "keybinding to navigate to the next sibling node"; |           description = "Navigate to the next sibling node."; | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         previousSibling = mkOption { |         previousSibling = mkOption { | ||||||
|           type = str; |           type = str; | ||||||
|           default = "k"; |           default = "k"; | ||||||
|           description = "keybinding to navigate to the previous sibling node"; |           description = "Navigate to the previous sibling node."; | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         parent = mkOption { |         parent = mkOption { | ||||||
|           type = str; |           type = str; | ||||||
|           default = "h"; |           default = "h"; | ||||||
|           description = "keybinding to navigate to the parent node"; |           description = "Navigate to the parent node."; | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         children = mkOption { |         children = mkOption { | ||||||
|           type = str; |           type = str; | ||||||
|           default = "l"; |           default = "l"; | ||||||
|           description = "keybinding to navigate to the child node"; |           description = "Navigate to the child node."; | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         root = mkOption { |         root = mkOption { | ||||||
|           type = str; |           type = str; | ||||||
|           default = "0"; |           default = "0"; | ||||||
|           description = "keybinding to navigate to the root node"; |           description = "Navigate to the root node."; | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         visualName = mkOption { |         visualName = mkOption { | ||||||
|           type = str; |           type = str; | ||||||
|           default = "v"; |           default = "v"; | ||||||
|           description = "visual selection of name"; |           description = "Select the name visually."; | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         visualScope = mkOption { |         visualScope = mkOption { | ||||||
|           type = str; |           type = str; | ||||||
|           default = "V"; |           default = "V"; | ||||||
|           description = "visual selection of scope"; |           description = "Select the scope visually."; | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         yankName = mkOption { |         yankName = mkOption { | ||||||
|           type = str; |           type = str; | ||||||
|           default = "y"; |           default = "y"; | ||||||
|           description = "yank the name to system clipboard"; |           description = "Yank the name to system clipboard."; | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         yankScope = mkOption { |         yankScope = mkOption { | ||||||
|           type = str; |           type = str; | ||||||
|           default = "Y"; |           default = "Y"; | ||||||
|           description = "yank the scope to system clipboard"; |           description = "Yank the scope to system clipboard."; | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         insertName = mkOption { |         insertName = mkOption { | ||||||
|           type = str; |           type = str; | ||||||
|           default = "i"; |           default = "i"; | ||||||
|           description = "insert at start of name"; |           description = "Insert at the start of name."; | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         insertScope = mkOption { |         insertScope = mkOption { | ||||||
|           type = str; |           type = str; | ||||||
|           default = "I"; |           default = "I"; | ||||||
|           description = "insert at start of scope"; |           description = "Insert at the start of scope."; | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         appendName = mkOption { |         appendName = mkOption { | ||||||
|           type = str; |           type = str; | ||||||
|           default = "a"; |           default = "a"; | ||||||
|           description = "insert at end of name"; |           description = "Insert at the end of name."; | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         appendScope = mkOption { |         appendScope = mkOption { | ||||||
|           type = str; |           type = str; | ||||||
|           default = "A"; |           default = "A"; | ||||||
|           description = "insert at end of scope"; |           description = "Insert at the end of scope."; | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         rename = mkOption { |         rename = mkOption { | ||||||
|           type = str; |           type = str; | ||||||
|           default = "r"; |           default = "r"; | ||||||
|           description = "rename the node"; |           description = "Rename the node."; | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         delete = mkOption { |         delete = mkOption { | ||||||
|           type = str; |           type = str; | ||||||
|           default = "d"; |           default = "d"; | ||||||
|           description = "delete the node"; |           description = "Delete the node."; | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         foldCreate = mkOption { |         foldCreate = mkOption { | ||||||
|           type = str; |           type = str; | ||||||
|           default = "f"; |           default = "f"; | ||||||
|           description = "create a new fold"; |           description = "Create a new fold of the node."; | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         foldDelete = mkOption { |         foldDelete = mkOption { | ||||||
|           type = str; |           type = str; | ||||||
|           default = "F"; |           default = "F"; | ||||||
|           description = "delete the current fold"; |           description = "Delete the current fold of the node."; | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         comment = mkOption { |         comment = mkOption { | ||||||
|           type = str; |           type = str; | ||||||
|           default = "c"; |           default = "c"; | ||||||
|           description = "comment the node"; |           description = "Comment the node."; | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         select = mkOption { |         select = mkOption { | ||||||
|           type = str; |           type = str; | ||||||
|           default = "<enter>"; |           default = "<enter>"; | ||||||
|           description = "goto selected symbol"; |           description = "Goto the node."; | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         moveDown = mkOption { |         moveDown = mkOption { | ||||||
|           type = str; |           type = str; | ||||||
|           default = "J"; |           default = "J"; | ||||||
|           description = "move focused node down"; |           description = "Move the node down."; | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         moveUp = mkOption { |         moveUp = mkOption { | ||||||
|           type = str; |           type = str; | ||||||
|           default = "K"; |           default = "K"; | ||||||
|           description = "move focused node up"; |           description = "Move the node up."; | ||||||
|  |         }; | ||||||
|  | 
 | ||||||
|  |         togglePreview = mkOption { | ||||||
|  |           type = str; | ||||||
|  |           default = "s"; | ||||||
|  |           description = "Toggle the preview."; | ||||||
|  |         }; | ||||||
|  | 
 | ||||||
|  |         vsplit = mkOption { | ||||||
|  |           type = str; | ||||||
|  |           default = "<C-v>"; | ||||||
|  |           description = "Open the node in a vertical split."; | ||||||
|  |         }; | ||||||
|  | 
 | ||||||
|  |         hsplit = mkOption { | ||||||
|  |           type = str; | ||||||
|  |           default = "<C-s>"; | ||||||
|  |           description = "Open the node in a horizontal split."; | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         telescope = mkOption { |         telescope = mkOption { | ||||||
|           type = str; |           type = str; | ||||||
|           default = "t"; |           default = "t"; | ||||||
|           description = "fuzzy finder at current level"; |           description = "Start fuzzy finder at the current level."; | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         help = mkOption { |         help = mkOption { | ||||||
|           type = str; |           type = str; | ||||||
|           default = "g?"; |           default = "g?"; | ||||||
|           description = "open mapping help window"; |           description = "Open the mappings help window."; | ||||||
|         }; |         }; | ||||||
|       }; |       }; | ||||||
| 
 | 
 | ||||||
|  | @ -232,7 +250,7 @@ in { | ||||||
|         useDefaultMappings = mkOption { |         useDefaultMappings = mkOption { | ||||||
|           type = bool; |           type = bool; | ||||||
|           default = true; |           default = true; | ||||||
|           description = "use default Navbuddy keybindings (disables user-specified keybinds)"; |           description = "Add the default Navbuddy keybindings in addition to the keybinding added by this module."; | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         window = { |         window = { | ||||||
|  | @ -242,13 +260,13 @@ in { | ||||||
|           border = mkOption { |           border = mkOption { | ||||||
|             type = borderType; |             type = borderType; | ||||||
|             default = config.vim.ui.borders.globalStyle; |             default = config.vim.ui.borders.globalStyle; | ||||||
|             description = "border style to use"; |             description = "The border style to use."; | ||||||
|           }; |           }; | ||||||
| 
 | 
 | ||||||
|           scrolloff = mkOption { |           scrolloff = mkOption { | ||||||
|             type = nullOr int; |             type = nullOr int; | ||||||
|             default = null; |             default = null; | ||||||
|             description = "Scrolloff value within navbuddy window"; |             description = "The scrolloff value within a navbuddy window."; | ||||||
|           }; |           }; | ||||||
| 
 | 
 | ||||||
|           sections = { |           sections = { | ||||||
|  | @ -265,7 +283,7 @@ in { | ||||||
|               border = mkOption { |               border = mkOption { | ||||||
|                 type = borderType; |                 type = borderType; | ||||||
|                 default = config.vim.ui.borders.globalStyle; |                 default = config.vim.ui.borders.globalStyle; | ||||||
|                 description = "border style to use for the left section of Navbuddy UI"; |                 description = "The border style to use for the left section of the Navbuddy UI."; | ||||||
|               }; |               }; | ||||||
|             }; |             }; | ||||||
| 
 | 
 | ||||||
|  | @ -282,7 +300,7 @@ in { | ||||||
|               border = mkOption { |               border = mkOption { | ||||||
|                 type = borderType; |                 type = borderType; | ||||||
|                 default = config.vim.ui.borders.globalStyle; |                 default = config.vim.ui.borders.globalStyle; | ||||||
|                 description = "border style to use for the middle section of Navbuddy UI"; |                 description = "The border style to use for the middle section of the Navbuddy UI."; | ||||||
|               }; |               }; | ||||||
|             }; |             }; | ||||||
| 
 | 
 | ||||||
|  | @ -292,13 +310,13 @@ in { | ||||||
|               border = mkOption { |               border = mkOption { | ||||||
|                 type = borderType; |                 type = borderType; | ||||||
|                 default = config.vim.ui.borders.globalStyle; |                 default = config.vim.ui.borders.globalStyle; | ||||||
|                 description = "border style to use for the right section of Navbuddy UI"; |                 description = "The border style to use for the right section of the Navbuddy UI."; | ||||||
|               }; |               }; | ||||||
| 
 | 
 | ||||||
|               preview = mkOption { |               preview = mkOption { | ||||||
|                 type = enum ["leaf" "always" "never"]; |                 type = enum ["leaf" "always" "never"]; | ||||||
|                 default = "leaf"; |                 default = "leaf"; | ||||||
|                 description = "display mode of the preview on the right section"; |                 description = "The display mode of the preview on the right section."; | ||||||
|               }; |               }; | ||||||
|             }; |             }; | ||||||
|           }; |           }; | ||||||
|  | @ -317,13 +335,13 @@ in { | ||||||
|           auto_attach = mkOption { |           auto_attach = mkOption { | ||||||
|             type = bool; |             type = bool; | ||||||
|             default = true; |             default = true; | ||||||
|             description = "Whether to attach to LSP server manually"; |             description = "Whether to attach to LSP server manually."; | ||||||
|           }; |           }; | ||||||
| 
 | 
 | ||||||
|           preference = mkOption { |           preference = mkOption { | ||||||
|             type = nullOr (listOf str); |             type = nullOr (listOf str); | ||||||
|             default = null; |             default = null; | ||||||
|             description = "list of lsp server names in order of preference"; |             description = "The preference list ranking LSP servers."; | ||||||
|           }; |           }; | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|  | @ -331,25 +349,25 @@ in { | ||||||
|           followNode = mkOption { |           followNode = mkOption { | ||||||
|             type = bool; |             type = bool; | ||||||
|             default = true; |             default = true; | ||||||
|             description = "keep the current node in focus on the source buffer"; |             description = "Whether to keep the current node in focus in the source buffer."; | ||||||
|           }; |           }; | ||||||
| 
 | 
 | ||||||
|           highlight = mkOption { |           highlight = mkOption { | ||||||
|             type = bool; |             type = bool; | ||||||
|             default = true; |             default = true; | ||||||
|             description = "highlight the currently focused node"; |             description = "Whether to highlight the currently focused node in the source buffer."; | ||||||
|           }; |           }; | ||||||
| 
 | 
 | ||||||
|           reorient = mkOption { |           reorient = mkOption { | ||||||
|             type = enum ["smart" "top" "mid" "none"]; |             type = enum ["smart" "top" "mid" "none"]; | ||||||
|             default = "smart"; |             default = "smart"; | ||||||
|             description = "reorient buffer after changing nodes"; |             description = "The mode for reorienting the source buffer after moving nodes."; | ||||||
|           }; |           }; | ||||||
| 
 | 
 | ||||||
|           scrolloff = mkOption { |           scrolloff = mkOption { | ||||||
|             type = nullOr int; |             type = nullOr int; | ||||||
|             default = null; |             default = null; | ||||||
|             description = "scrolloff value when navbuddy is open"; |             description = "The scrolloff value in the source buffer when Navbuddy is open."; | ||||||
|           }; |           }; | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -64,6 +64,11 @@ in { | ||||||
|         ${cfg.navbuddy.mappings.moveDown} = mkLuaInline "actions.move_down()"; |         ${cfg.navbuddy.mappings.moveDown} = mkLuaInline "actions.move_down()"; | ||||||
|         ${cfg.navbuddy.mappings.moveUp} = mkLuaInline "actions.move_up()"; |         ${cfg.navbuddy.mappings.moveUp} = mkLuaInline "actions.move_up()"; | ||||||
| 
 | 
 | ||||||
|  |         ${cfg.navbuddy.mappings.togglePreview} = mkLuaInline "actions.toggle_preview()"; | ||||||
|  | 
 | ||||||
|  |         ${cfg.navbuddy.mappings.vsplit} = mkLuaInline "actions.vsplit()"; | ||||||
|  |         ${cfg.navbuddy.mappings.hsplit} = mkLuaInline "actions.hsplit()"; | ||||||
|  | 
 | ||||||
|         ${cfg.navbuddy.mappings.telescope} = mkLuaInline '' |         ${cfg.navbuddy.mappings.telescope} = mkLuaInline '' | ||||||
|           actions.telescope({ |           actions.telescope({ | ||||||
|             layout_strategy = "horizontal", |             layout_strategy = "horizontal", | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 GitHub
					GitHub