mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
plugins/glance: init
This commit is contained in:
parent
fc9176c75b
commit
5b35c4eaed
2 changed files with 126 additions and 0 deletions
29
plugins/by-name/glance/default.nix
Normal file
29
plugins/by-name/glance/default.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{ config, lib, ... }:
|
||||
lib.nixvim.plugins.mkNeovimPlugin {
|
||||
name = "glance";
|
||||
packPathName = "glance.nvim";
|
||||
package = "glance-nvim";
|
||||
|
||||
maintainers = [ lib.maintainers.khaneliman ];
|
||||
|
||||
settingsExample = {
|
||||
height = 40;
|
||||
zindex = 50;
|
||||
border = {
|
||||
enable = true;
|
||||
};
|
||||
use_trouble_qf = true;
|
||||
};
|
||||
|
||||
extraConfig = cfg: {
|
||||
warnings =
|
||||
lib.optional
|
||||
(
|
||||
cfg.settings ? use_trouble_qf
|
||||
&& builtins.isBool cfg.settings.use_trouble_qf
|
||||
&& cfg.settings.use_trouble_qf
|
||||
&& !config.plugins.trouble.enable
|
||||
)
|
||||
"Nixvim (plugins.glance): The `trouble` plugin is not enabled, so the `glance` plugin's `use_trouble_qf` setting has no effect.";
|
||||
};
|
||||
}
|
97
tests/test-sources/plugins/by-name/glance/default.nix
Normal file
97
tests/test-sources/plugins/by-name/glance/default.nix
Normal file
|
@ -0,0 +1,97 @@
|
|||
{
|
||||
empty = {
|
||||
plugins.glance.enable = true;
|
||||
};
|
||||
|
||||
default = {
|
||||
plugins.glance = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
height = 18;
|
||||
zindex = 45;
|
||||
preserve_win_context = true;
|
||||
detached.__raw = ''
|
||||
function(winid)
|
||||
-- Automatically detach when parent window width < 100 columns
|
||||
return vim.api.nvim_win_get_width(winid) < 100
|
||||
end
|
||||
'';
|
||||
preview_win_opts = {
|
||||
cursorline = true;
|
||||
number = true;
|
||||
wrap = true;
|
||||
};
|
||||
border = {
|
||||
enable = false;
|
||||
top_char = "―";
|
||||
bottom_char = "―";
|
||||
};
|
||||
list = {
|
||||
position = "right";
|
||||
width = 0.33;
|
||||
};
|
||||
theme = {
|
||||
enable = true;
|
||||
mode = "auto";
|
||||
};
|
||||
mappings = {
|
||||
list = {
|
||||
"j".__raw = ''require('glance').actions.next'';
|
||||
"k".__raw = ''require('glance').actions.previous'';
|
||||
"<Down>".__raw = ''require('glance').actions.next'';
|
||||
"<Up>".__raw = ''require('glance').actions.previous'';
|
||||
"<Tab>".__raw = ''require('glance').actions.next_location'';
|
||||
"<S-Tab>".__raw = ''require('glance').actions.previous_location'';
|
||||
"<C-u>".__raw = ''require('glance').actions.preview_scroll_win(5)'';
|
||||
"<C-d>".__raw = ''require('glance').actions.preview_scroll_win(-5)'';
|
||||
"v".__raw = ''require('glance').actions.jump_vsplit'';
|
||||
"s".__raw = ''require('glance').actions.jump_split'';
|
||||
"t".__raw = ''require('glance').actions.jump_tab'';
|
||||
"<CR>".__raw = ''require('glance').actions.jump'';
|
||||
"o".__raw = ''require('glance').actions.jump'';
|
||||
"l".__raw = ''require('glance').actions.open_fold'';
|
||||
"h".__raw = ''require('glance').actions.close_fold'';
|
||||
"<leader>l".__raw = ''require('glance').actions.enter_win("preview")'';
|
||||
"q".__raw = ''require('glance').actions.close'';
|
||||
"Q".__raw = ''require('glance').actions.close'';
|
||||
"<Esc>".__raw = ''require('glance').actions.close'';
|
||||
"<C-q>".__raw = ''require('glance').actions.quickfix'';
|
||||
};
|
||||
preview = {
|
||||
"Q".__raw = ''require('glance').actions.close'';
|
||||
"<Tab>".__raw = ''require('glance').actions.next_location'';
|
||||
"<S-Tab>".__raw = ''require('glance').actions.previous_location'';
|
||||
"<leader>l".__raw = ''require('glance').actions.enter_win("list")'';
|
||||
};
|
||||
};
|
||||
hooks = { };
|
||||
folds = {
|
||||
fold_closed = "";
|
||||
fold_open = "";
|
||||
folded = true;
|
||||
};
|
||||
indent_lines = {
|
||||
enable = true;
|
||||
icon = "│";
|
||||
};
|
||||
winbar = {
|
||||
enable = true;
|
||||
};
|
||||
use_trouble_qf = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
trouble = {
|
||||
plugins = {
|
||||
glance = {
|
||||
enable = true;
|
||||
|
||||
settings.use_trouble_qf = true;
|
||||
};
|
||||
trouble.enable = true;
|
||||
web-devicons.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue