mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
Update dropbar.lua
This commit is contained in:
parent
c6000303ea
commit
50671abd14
1 changed files with 48 additions and 2 deletions
|
|
@ -1,10 +1,56 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"Bekaboo/dropbar.nvim",
|
"Bekaboo/dropbar.nvim",
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
event = "LazyFile",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-telescope/telescope-fzf-native.nvim",
|
"nvim-telescope/telescope-fzf-native.nvim",
|
||||||
},
|
},
|
||||||
config = {},
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>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"] = "<C-w>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,
|
||||||
|
["<esc>"] = close,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue