mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-10 09:14:31 +02:00
plugins/dropbar: init
This commit is contained in:
parent
592e9eaff0
commit
2054094544
3 changed files with 1446 additions and 0 deletions
51
plugins/by-name/dropbar/default.nix
Normal file
51
plugins/by-name/dropbar/default.nix
Normal file
|
@ -0,0 +1,51 @@
|
|||
{ lib, ... }:
|
||||
lib.nixvim.plugins.mkNeovimPlugin {
|
||||
name = "dropbar";
|
||||
packPathName = "dropbar.nvim";
|
||||
package = "dropbar-nvim";
|
||||
|
||||
maintainers = [ lib.maintainers.GaetanLepage ];
|
||||
|
||||
description = ''
|
||||
A polished, IDE-like, highly-customizable winbar for Neovim with drop-down menu support and
|
||||
multiple backends.
|
||||
'';
|
||||
|
||||
settingsOptions = import ./settings-options.nix lib;
|
||||
|
||||
settingsExample = {
|
||||
bar = {
|
||||
enable = true;
|
||||
sources.__raw = ''
|
||||
function(buf, _)
|
||||
local sources = require('dropbar.sources')
|
||||
return {
|
||||
require('dropbar.utils').source.fallback({
|
||||
sources.lsp,
|
||||
sources.treesitter,
|
||||
sources.markdown,
|
||||
})
|
||||
}
|
||||
end
|
||||
'';
|
||||
};
|
||||
menu.keymaps = {
|
||||
h = "<C-w>q";
|
||||
l.__raw = ''
|
||||
function()
|
||||
local dropbar = require('dropbar')
|
||||
local utils = require('dropbar.utils')
|
||||
local menu = utils.menu.get_current()
|
||||
if not menu then
|
||||
return
|
||||
end
|
||||
local cursor = vim.api.nvim_win_get_cursor(menu.win)
|
||||
local component = menu.entries[cursor[1]]:first_clickable(cursor[2])
|
||||
if component then
|
||||
menu:click_on(component, nil, 1, 'l')
|
||||
end
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue