2023-07-19 19:49:06 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
2023-11-14 07:18:32 +00:00
|
|
|
}: let
|
2024-03-16 13:25:30 +00:00
|
|
|
inherit (lib.strings) optionalString;
|
2024-03-15 12:01:46 +00:00
|
|
|
inherit (lib.modules) mkIf;
|
2024-03-16 13:25:30 +00:00
|
|
|
inherit (lib.lists) optionals;
|
|
|
|
inherit (lib.nvim.dag) entryAfter;
|
2024-03-10 18:37:49 +00:00
|
|
|
inherit (lib.nvim.lua) toLuaObject;
|
2024-03-16 09:29:32 +00:00
|
|
|
inherit (lib.generators) mkLuaInline;
|
2023-08-10 17:24:30 +00:00
|
|
|
|
2023-07-19 19:49:06 +00:00
|
|
|
cfg = config.vim.ui.breadcrumbs;
|
|
|
|
in {
|
|
|
|
config = mkIf cfg.enable {
|
2023-07-24 18:36:01 +00:00
|
|
|
vim.startPlugins =
|
|
|
|
[
|
|
|
|
"nvim-lspconfig"
|
|
|
|
]
|
2023-08-10 17:24:30 +00:00
|
|
|
++ optionals (cfg.source == "nvim-navic") [
|
2023-08-10 16:35:45 +00:00
|
|
|
"nvim-navic"
|
|
|
|
]
|
2023-08-10 17:24:30 +00:00
|
|
|
++ optionals (config.vim.lsp.lspsaga.enable && cfg.source == "lspsaga") [
|
2023-07-24 18:36:01 +00:00
|
|
|
"lspsaga"
|
|
|
|
]
|
2023-08-10 17:24:30 +00:00
|
|
|
++ optionals cfg.navbuddy.enable [
|
2023-07-24 18:36:01 +00:00
|
|
|
"nvim-navbuddy"
|
2023-08-10 16:35:45 +00:00
|
|
|
"nui-nvim"
|
2023-08-10 17:24:30 +00:00
|
|
|
"nvim-navic"
|
2023-07-24 18:36:01 +00:00
|
|
|
];
|
2023-07-19 19:49:06 +00:00
|
|
|
|
2024-03-10 18:37:49 +00:00
|
|
|
vim.ui.breadcrumbs.navbuddy.setupOpts = {
|
|
|
|
mappings = {
|
2024-03-16 09:29:32 +00:00
|
|
|
${cfg.navbuddy.mappings.close} = mkLuaInline "actions.close()";
|
|
|
|
${cfg.navbuddy.mappings.nextSibling} = mkLuaInline "actions.next_sibling()";
|
|
|
|
${cfg.navbuddy.mappings.previousSibling} = mkLuaInline "actions.previous_sibling()";
|
|
|
|
${cfg.navbuddy.mappings.parent} = mkLuaInline "actions.parent()";
|
|
|
|
${cfg.navbuddy.mappings.children} = mkLuaInline "actions.children()";
|
|
|
|
${cfg.navbuddy.mappings.root} = mkLuaInline "actions.root()";
|
2023-08-10 16:35:45 +00:00
|
|
|
|
2024-03-16 09:29:32 +00:00
|
|
|
${cfg.navbuddy.mappings.visualName} = mkLuaInline "actions.visual_name()";
|
|
|
|
${cfg.navbuddy.mappings.visualScope} = mkLuaInline "actions.visual_scope()";
|
2023-08-10 16:35:45 +00:00
|
|
|
|
2024-03-16 09:29:32 +00:00
|
|
|
${cfg.navbuddy.mappings.yankName} = mkLuaInline "actions.yank_name()";
|
|
|
|
${cfg.navbuddy.mappings.yankScope} = mkLuaInline "actions.yank_scope()";
|
2023-08-10 16:35:45 +00:00
|
|
|
|
2024-03-16 09:29:32 +00:00
|
|
|
${cfg.navbuddy.mappings.insertName} = mkLuaInline "actions.insert_name()";
|
|
|
|
${cfg.navbuddy.mappings.insertScope} = mkLuaInline "actions.insert_scope()";
|
2023-08-10 16:35:45 +00:00
|
|
|
|
2024-03-16 09:29:32 +00:00
|
|
|
${cfg.navbuddy.mappings.appendName} = mkLuaInline "actions.append_name()";
|
|
|
|
${cfg.navbuddy.mappings.appendScope} = mkLuaInline "actions.append_scope()";
|
2023-08-10 16:35:45 +00:00
|
|
|
|
2024-03-16 09:29:32 +00:00
|
|
|
${cfg.navbuddy.mappings.rename} = mkLuaInline "actions.rename()";
|
2023-08-10 16:35:45 +00:00
|
|
|
|
2024-03-16 09:29:32 +00:00
|
|
|
${cfg.navbuddy.mappings.delete} = mkLuaInline "actions.delete()";
|
2023-08-10 16:35:45 +00:00
|
|
|
|
2024-03-16 09:29:32 +00:00
|
|
|
${cfg.navbuddy.mappings.foldCreate} = mkLuaInline "actions.fold_create()";
|
|
|
|
${cfg.navbuddy.mappings.foldDelete} = mkLuaInline "actions.fold_delete()";
|
2023-08-10 16:35:45 +00:00
|
|
|
|
2024-03-16 09:29:32 +00:00
|
|
|
${cfg.navbuddy.mappings.comment} = mkLuaInline "actions.comment()";
|
2023-08-10 16:35:45 +00:00
|
|
|
|
2024-03-16 09:29:32 +00:00
|
|
|
${cfg.navbuddy.mappings.select} = mkLuaInline "actions.select()";
|
2023-08-10 16:35:45 +00:00
|
|
|
|
2024-03-16 09:29:32 +00:00
|
|
|
${cfg.navbuddy.mappings.moveDown} = mkLuaInline "actions.move_down()";
|
|
|
|
${cfg.navbuddy.mappings.moveUp} = mkLuaInline "actions.move_up()";
|
2023-08-10 16:35:45 +00:00
|
|
|
|
2024-03-16 09:29:32 +00:00
|
|
|
${cfg.navbuddy.mappings.telescope} = mkLuaInline ''
|
2024-03-10 18:37:49 +00:00
|
|
|
actions.telescope({
|
|
|
|
layout_strategy = "horizontal",
|
|
|
|
layout_config = {
|
|
|
|
height = 0.60,
|
|
|
|
width = 0.75,
|
|
|
|
prompt_position = "top",
|
|
|
|
preview_width = 0.50
|
|
|
|
},
|
|
|
|
})'';
|
2024-03-16 09:29:32 +00:00
|
|
|
${cfg.navbuddy.mappings.help} = mkLuaInline "actions.help()";
|
2024-03-10 18:37:49 +00:00
|
|
|
};
|
|
|
|
};
|
2023-08-10 16:35:45 +00:00
|
|
|
|
2024-07-20 08:30:48 +00:00
|
|
|
vim.pluginRC.breadcrumbs = entryAfter ["lspconfig"] ''
|
2023-08-10 16:35:45 +00:00
|
|
|
|
2024-03-10 18:37:49 +00:00
|
|
|
${optionalString (cfg.source == "nvim-navic") ''
|
|
|
|
local navic = require("nvim-navic")
|
|
|
|
require("nvim-navic").setup {
|
|
|
|
highlight = true
|
2023-07-20 15:34:36 +00:00
|
|
|
}
|
2023-08-10 16:35:45 +00:00
|
|
|
''}
|
2024-03-10 18:37:49 +00:00
|
|
|
|
|
|
|
${optionalString cfg.navbuddy.enable ''
|
|
|
|
local navbuddy = require("nvim-navbuddy")
|
|
|
|
local actions = require("nvim-navbuddy.actions")
|
|
|
|
navbuddy.setup ${toLuaObject cfg.navbuddy.setupOpts}
|
|
|
|
''}
|
2023-07-19 19:49:06 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|