From c6000303ea8b60aae354bd142102a9a7f34b0f55 Mon Sep 17 00:00:00 2001 From: Rubin Bhandari Date: Sun, 19 May 2024 15:29:16 +0545 Subject: [PATCH 1/2] feat: add dropbar for vscode still breadcrumbs --- lua/lazyvim/plugins/extras/editor/dropbar.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/editor/dropbar.lua diff --git a/lua/lazyvim/plugins/extras/editor/dropbar.lua b/lua/lazyvim/plugins/extras/editor/dropbar.lua new file mode 100644 index 00000000..1adabcdd --- /dev/null +++ b/lua/lazyvim/plugins/extras/editor/dropbar.lua @@ -0,0 +1,10 @@ +return { + { + "Bekaboo/dropbar.nvim", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + "nvim-telescope/telescope-fzf-native.nvim", + }, + config = {}, + }, +} From 50671abd14d162f3c090d0058a2dacf3fd388ff0 Mon Sep 17 00:00:00 2001 From: Rubin Bhandari Date: Sun, 19 May 2024 19:29:08 +0545 Subject: [PATCH 2/2] Update dropbar.lua --- lua/lazyvim/plugins/extras/editor/dropbar.lua | 50 ++++++++++++++++++- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/dropbar.lua b/lua/lazyvim/plugins/extras/editor/dropbar.lua index 1adabcdd..eded8966 100644 --- a/lua/lazyvim/plugins/extras/editor/dropbar.lua +++ b/lua/lazyvim/plugins/extras/editor/dropbar.lua @@ -1,10 +1,56 @@ return { { "Bekaboo/dropbar.nvim", - event = { "BufReadPre", "BufNewFile" }, + event = "LazyFile", dependencies = { "nvim-telescope/telescope-fzf-native.nvim", }, - config = {}, + keys = { + { + "D", + function() + require("dropbar.api").pick() + end, + desc = "Winbar pick", + }, + }, + opts = function() + local menu_utils = require("dropbar.utils.menu") + + -- Closes all the windows in the current dropbar. + local function close() + local menu = menu_utils.get_current() + while menu and menu.prev_menu do + menu = menu.prev_menu + end + if menu then + menu:close() + end + end + + return { + menu = { + preview = false, + keymaps = { + -- Navigate back to the parent menu. + ["h"] = "q", + -- Expands the entry if possible. + ["l"] = function() + local menu = menu_utils.get_current() + if not menu then + return + end + local row = vim.api.nvim_win_get_cursor(menu.win)[1] + local component = menu.entries[row]:first_clickable() + if component then + menu:click_on(component, nil, 1, "l") + end + end, + ["q"] = close, + [""] = close, + }, + }, + } + end, }, }