mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
plugins/barbar: refactoring + nix flake update (#317)
* flake: update inputs * plugins/barbar: refactoring + fix options
This commit is contained in:
parent
d40db46d7f
commit
35c570deac
3 changed files with 359 additions and 210 deletions
24
flake.lock
generated
24
flake.lock
generated
|
@ -9,11 +9,11 @@
|
||||||
"utils": "utils"
|
"utils": "utils"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1669854260,
|
"lastModified": 1680308980,
|
||||||
"narHash": "sha256-Z8NAL3g4i5LAhxveNGJhrVDHxIBbUf1lVIy/Thr2RMU=",
|
"narHash": "sha256-aUEHV0jk2qIFP3jlsWYWhBbm+w/N9gzH3e4I5DcdB5s=",
|
||||||
"owner": "lovesegfault",
|
"owner": "lovesegfault",
|
||||||
"repo": "beautysh",
|
"repo": "beautysh",
|
||||||
"rev": "d616eb8d9d05ee4fb33de9c5521d99c3f0695d52",
|
"rev": "9845efc3ea3e86cc0d41465d720a47f521b2799c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -91,11 +91,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1679705136,
|
"lastModified": 1680487167,
|
||||||
"narHash": "sha256-MDlZUR7wJ3PlPtqwwoGQr3euNOe0vdSSteVVOef7tBY=",
|
"narHash": "sha256-9FNIqrxDZgSliGGN2XJJSvcDYmQbgOANaZA4UWnTdg4=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "8f40f2f90b9c9032d1b824442cfbbe0dbabd0dbd",
|
"rev": "53dad94e874c9586e71decf82d972dfb640ef044",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -157,11 +157,11 @@
|
||||||
"nixpkgs-stable": "nixpkgs-stable"
|
"nixpkgs-stable": "nixpkgs-stable"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1678976941,
|
"lastModified": 1680599552,
|
||||||
"narHash": "sha256-skNr08frCwN9NO+7I77MjOHHAw+L410/37JknNld+W4=",
|
"narHash": "sha256-rQQJFGvWQ3Sr+m/r5KGIFN0iVaVKr6u9uraCz6jSKj4=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "pre-commit-hooks.nix",
|
"repo": "pre-commit-hooks.nix",
|
||||||
"rev": "32b1dbedfd77892a6e375737ef04d8efba634e9e",
|
"rev": "3342d7c51119030490fdcd07351b53b10806891c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -180,11 +180,11 @@
|
||||||
},
|
},
|
||||||
"utils": {
|
"utils": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1667395993,
|
"lastModified": 1678901627,
|
||||||
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
"narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
"rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -7,6 +7,56 @@
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.plugins.barbar;
|
cfg = config.plugins.barbar;
|
||||||
helpers = import ../helpers.nix {inherit lib;};
|
helpers = import ../helpers.nix {inherit lib;};
|
||||||
|
basePluginPath = ["plugins" "barbar"];
|
||||||
|
|
||||||
|
bufferOptions = {
|
||||||
|
bufferIndex = helpers.mkNullOrOption types.bool ''
|
||||||
|
Whether to show the index of the associated buffer with respect to the ordering of the
|
||||||
|
buffers in the tabline.
|
||||||
|
'';
|
||||||
|
|
||||||
|
bufferNumber =
|
||||||
|
helpers.mkNullOrOption types.bool
|
||||||
|
"Whether to show the `bufnr` for the associated buffer.";
|
||||||
|
|
||||||
|
button =
|
||||||
|
helpers.mkNullOrOption (with types; either str (enum [false]))
|
||||||
|
"the button which is clicked to close / save a buffer, or indicate that it is pinned.";
|
||||||
|
|
||||||
|
diagnostics =
|
||||||
|
helpers.mkCompositeOption "Diagnostics icons"
|
||||||
|
(
|
||||||
|
genAttrs
|
||||||
|
["error" "warn" "info" "hint"]
|
||||||
|
(
|
||||||
|
name:
|
||||||
|
helpers.mkCompositeOption "${name} diagnostic icon" {
|
||||||
|
enable = helpers.defaultNullOpts.mkBool false "Enable the ${name} diagnostic symbol";
|
||||||
|
icon = helpers.mkNullOrOption types.str "${name} diagnostic symbol";
|
||||||
|
}
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
filetype = {
|
||||||
|
customColors =
|
||||||
|
helpers.defaultNullOpts.mkBool false
|
||||||
|
"Sets the icon's highlight group. If false, will use nvim-web-devicons colors";
|
||||||
|
|
||||||
|
enable = helpers.defaultNullOpts.mkBool true "Show the filetype icon.";
|
||||||
|
};
|
||||||
|
|
||||||
|
separator = {
|
||||||
|
left = helpers.defaultNullOpts.mkStr "▎" "Left seperator";
|
||||||
|
right = helpers.defaultNullOpts.mkStr "" "Right seperator";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
stateOptions =
|
||||||
|
{
|
||||||
|
modified = bufferOptions;
|
||||||
|
pinned = bufferOptions;
|
||||||
|
}
|
||||||
|
// bufferOptions;
|
||||||
|
|
||||||
keymaps = {
|
keymaps = {
|
||||||
previous = "Previous";
|
previous = "Previous";
|
||||||
|
@ -32,18 +82,69 @@ with lib; let
|
||||||
orderByWindowNumber = "OrderByWindowNumber";
|
orderByWindowNumber = "OrderByWindowNumber";
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
options.plugins.barbar = {
|
# All the following renames/removes are from 2023-04-05.
|
||||||
|
# TODO: Remove them in 1-2 months.
|
||||||
|
imports = [
|
||||||
|
(mkRemovedOptionModule (basePluginPath ++ ["closable"]) "")
|
||||||
|
(
|
||||||
|
mkRenamedOptionModule
|
||||||
|
(basePluginPath ++ ["animations"])
|
||||||
|
(basePluginPath ++ ["animation"])
|
||||||
|
)
|
||||||
|
(
|
||||||
|
mkRenamedOptionModule
|
||||||
|
(basePluginPath ++ ["diagnostics"])
|
||||||
|
(basePluginPath ++ ["icons" "diagnostics"])
|
||||||
|
)
|
||||||
|
(mkRemovedOptionModule (basePluginPath ++ ["icons" "enable"]) "")
|
||||||
|
(
|
||||||
|
mkRenamedOptionModule
|
||||||
|
(basePluginPath ++ ["icons" "customColors"])
|
||||||
|
(basePluginPath ++ ["icons" "filetype" "customColors"])
|
||||||
|
)
|
||||||
|
(
|
||||||
|
mkRenamedOptionModule
|
||||||
|
(basePluginPath ++ ["icons" "separatorActive"])
|
||||||
|
(basePluginPath ++ ["icons" "separator" "left"])
|
||||||
|
)
|
||||||
|
(
|
||||||
|
mkRenamedOptionModule
|
||||||
|
(basePluginPath ++ ["icons" "separatorInactive"])
|
||||||
|
(basePluginPath ++ ["icons" "inactive" "separator" "left"])
|
||||||
|
)
|
||||||
|
(
|
||||||
|
mkRenamedOptionModule
|
||||||
|
(basePluginPath ++ ["icons" "separatorVisible"])
|
||||||
|
(basePluginPath ++ ["icons" "visible" "separator" "left"])
|
||||||
|
)
|
||||||
|
(
|
||||||
|
mkRenamedOptionModule
|
||||||
|
(basePluginPath ++ ["icons" "closeTab"])
|
||||||
|
(basePluginPath ++ ["icons" "button"])
|
||||||
|
)
|
||||||
|
(
|
||||||
|
mkRenamedOptionModule
|
||||||
|
(basePluginPath ++ ["icons" "closeTabModified"])
|
||||||
|
(basePluginPath ++ ["icons" "modified" "button"])
|
||||||
|
)
|
||||||
|
];
|
||||||
|
|
||||||
|
options.plugins.barbar =
|
||||||
|
helpers.extraOptionsOptions
|
||||||
|
// {
|
||||||
enable = mkEnableOption "barbar.nvim";
|
enable = mkEnableOption "barbar.nvim";
|
||||||
|
|
||||||
package = helpers.mkPackageOption "barbar" pkgs.vimPlugins.barbar-nvim;
|
package = helpers.mkPackageOption "barbar" pkgs.vimPlugins.barbar-nvim;
|
||||||
|
|
||||||
animations = helpers.defaultNullOpts.mkBool true "Enable animations";
|
animation = helpers.defaultNullOpts.mkBool true "Enable/disable animations";
|
||||||
|
|
||||||
autoHide = helpers.defaultNullOpts.mkBool false "Auto-hide the tab bar when there is only one buffer";
|
autoHide =
|
||||||
|
helpers.defaultNullOpts.mkBool false
|
||||||
|
"Enable/disable auto-hiding the tab bar when there is a single buffer.";
|
||||||
|
|
||||||
tabpages = helpers.defaultNullOpts.mkBool true "current/total tabpages indicator (top right corner)";
|
tabpages =
|
||||||
|
helpers.defaultNullOpts.mkBool true
|
||||||
closable = helpers.defaultNullOpts.mkBool true "Enable the close button";
|
"Enable/disable current/total tabpages indicator (top right corner).";
|
||||||
|
|
||||||
clickable = helpers.defaultNullOpts.mkBool true ''
|
clickable = helpers.defaultNullOpts.mkBool true ''
|
||||||
Enable clickable tabs
|
Enable clickable tabs
|
||||||
|
@ -51,25 +152,6 @@ in {
|
||||||
- middle-click: delete buffer
|
- middle-click: delete buffer
|
||||||
'';
|
'';
|
||||||
|
|
||||||
diagnostics = {
|
|
||||||
error = {
|
|
||||||
enable = helpers.defaultNullOpts.mkBool false "Enable the error diagnostic symbol";
|
|
||||||
icon = helpers.defaultNullOpts.mkStr "Ⓧ " "Error diagnostic symbol";
|
|
||||||
};
|
|
||||||
warn = {
|
|
||||||
enable = helpers.defaultNullOpts.mkBool false "Enable the warning diagnostic symbol";
|
|
||||||
icon = helpers.defaultNullOpts.mkStr "⚠️ " "Warning diagnostic symbol";
|
|
||||||
};
|
|
||||||
info = {
|
|
||||||
enable = helpers.defaultNullOpts.mkBool false "Enable the info diagnostic symbol";
|
|
||||||
icon = helpers.defaultNullOpts.mkStr "ⓘ " "Info diagnostic symbol";
|
|
||||||
};
|
|
||||||
hint = {
|
|
||||||
enable = helpers.defaultNullOpts.mkBool false "Enable the hint diagnostic symbol";
|
|
||||||
icon = helpers.defaultNullOpts.mkStr "💡" "Hint diagnostic symbol";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
excludeFileTypes = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
|
excludeFileTypes = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
|
||||||
Excludes buffers of certain filetypes from the tabline
|
Excludes buffers of certain filetypes from the tabline
|
||||||
'';
|
'';
|
||||||
|
@ -78,75 +160,107 @@ in {
|
||||||
Excludes buffers with certain filenames from the tabline
|
Excludes buffers with certain filenames from the tabline
|
||||||
'';
|
'';
|
||||||
|
|
||||||
hide = {
|
focusOnClose =
|
||||||
extensions = helpers.defaultNullOpts.mkBool false "Hide file extensions";
|
helpers.defaultNullOpts.mkEnumFirstDefault ["left" "right"]
|
||||||
inactive = helpers.defaultNullOpts.mkBool false "Hide inactive buffers";
|
''
|
||||||
alternate = helpers.defaultNullOpts.mkBool false "Hide alternate buffers";
|
A buffer to this direction will be focused (if it exists) when closing the current buffer.
|
||||||
current = helpers.defaultNullOpts.mkBool false "Hide current buffer";
|
'';
|
||||||
visible = helpers.defaultNullOpts.mkBool false "Hide visible buffers";
|
|
||||||
};
|
|
||||||
|
|
||||||
highlightAlternate = helpers.defaultNullOpts.mkBool false "Highlight alternate buffers";
|
highlightAlternate = helpers.defaultNullOpts.mkBool false "Highlight alternate buffers";
|
||||||
|
|
||||||
highlightInactiveFileIcons = helpers.defaultNullOpts.mkBool false "Highlight file icons in inactive buffers";
|
highlightInactiveFileIcons =
|
||||||
|
helpers.defaultNullOpts.mkBool false
|
||||||
|
"Highlight file icons in inactive buffers";
|
||||||
|
|
||||||
highlightVisible = helpers.defaultNullOpts.mkBool true "Highlight visible buffers";
|
highlightVisible = helpers.defaultNullOpts.mkBool true "Highlight visible buffers";
|
||||||
|
|
||||||
icons = {
|
icons =
|
||||||
enable =
|
stateOptions
|
||||||
helpers.defaultNullOpts.mkNullable
|
// (
|
||||||
(with types; (either bool (enum ["numbers" "both"])))
|
mapAttrs (name: description:
|
||||||
"true"
|
mkOption {
|
||||||
''
|
type = types.submodule {
|
||||||
Enable/disable icons if set to 'numbers', will show buffer index in the tabline if set to
|
options = stateOptions;
|
||||||
'both', will show buffer index and icons in the tabline
|
};
|
||||||
'';
|
default = {};
|
||||||
|
inherit description;
|
||||||
|
})
|
||||||
|
{
|
||||||
|
alternate = "The icons used for an alternate buffer.";
|
||||||
|
current = "The icons for the current buffer.";
|
||||||
|
inactive = "The icons for inactive buffers.";
|
||||||
|
visible = "The icons for visible buffers.";
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
customColors =
|
hide = {
|
||||||
helpers.defaultNullOpts.mkNullable
|
alternate = helpers.mkNullOrOption types.bool "Hide alternate buffers";
|
||||||
(types.either types.bool types.str)
|
current = helpers.mkNullOrOption types.bool "Hide current buffer";
|
||||||
"false"
|
extensions = helpers.mkNullOrOption types.bool "Hide file extensions";
|
||||||
''
|
inactive = helpers.mkNullOrOption types.bool "Hide inactive buffers";
|
||||||
If set, the icon color will follow its corresponding buffer
|
visible = helpers.mkNullOrOption types.bool "Hide visible buffers";
|
||||||
highlight group. By default, the Buffer*Icon group is linked to the
|
|
||||||
Buffer* group (see Highlighting below). Otherwise, it will take its
|
|
||||||
default value as defined by devicons.
|
|
||||||
'';
|
|
||||||
|
|
||||||
separatorActive = helpers.defaultNullOpts.mkStr "▎" "Icon for the active tab separator";
|
|
||||||
separatorInactive = helpers.defaultNullOpts.mkStr "▎" "Icon for the inactive tab separator";
|
|
||||||
separatorVisible = helpers.defaultNullOpts.mkStr "▎" "Icon for the visible tab separator";
|
|
||||||
closeTab = helpers.defaultNullOpts.mkStr "" "Icon for the close tab button";
|
|
||||||
closeTabModified = helpers.defaultNullOpts.mkStr "●" "Icon for the close tab button of a modified buffer";
|
|
||||||
pinned = helpers.defaultNullOpts.mkStr "車" "Icon for the pinned tabs";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
insertAtEnd = helpers.defaultNullOpts.mkBool false ''
|
insertAtEnd = helpers.defaultNullOpts.mkBool false ''
|
||||||
If true, new buffers will be inserted at the end of the list.
|
If true, new buffers will be inserted at the end of the list.
|
||||||
Default is to insert after current buffer.
|
Default is to insert after current buffer.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
insertAtStart = helpers.defaultNullOpts.mkBool false ''
|
insertAtStart = helpers.defaultNullOpts.mkBool false ''
|
||||||
If true, new buffers will be inserted at the start of the list.
|
If true, new buffers will be inserted at the start of the list.
|
||||||
Default is to insert after current buffer.
|
Default is to insert after current buffer.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
maximumPadding = helpers.defaultNullOpts.mkInt 4 "Sets the maximum padding width with which to surround each tab";
|
maximumPadding =
|
||||||
minimumPadding = helpers.defaultNullOpts.mkInt 1 "Sets the minimum padding width with which to surround each tab";
|
helpers.defaultNullOpts.mkInt 4
|
||||||
maximumLength = helpers.defaultNullOpts.mkInt 30 "Sets the maximum buffer name length.";
|
"Sets the maximum padding width with which to surround each tab";
|
||||||
|
|
||||||
|
minimumPadding =
|
||||||
|
helpers.defaultNullOpts.mkInt 1
|
||||||
|
"Sets the minimum padding width with which to surround each tab";
|
||||||
|
|
||||||
|
maximumLength =
|
||||||
|
helpers.defaultNullOpts.mkInt 30
|
||||||
|
"Sets the maximum buffer name length.";
|
||||||
|
|
||||||
semanticLetters = helpers.defaultNullOpts.mkBool true ''
|
semanticLetters = helpers.defaultNullOpts.mkBool true ''
|
||||||
If set, the letters for each buffer in buffer-pick mode will be assigned based on their name.
|
If set, the letters for each buffer in buffer-pick mode will be assigned based on their
|
||||||
|
name.
|
||||||
Otherwise or in case all letters are already assigned, the behavior is to assign letters in
|
Otherwise or in case all letters are already assigned, the behavior is to assign letters in
|
||||||
order of usability (see `letters` option)
|
order of usability (see `letters` option)
|
||||||
'';
|
'';
|
||||||
|
|
||||||
letters = helpers.defaultNullOpts.mkStr "asdfjkl;ghnmxcvbziowerutyqpASDFJKLGHNMXCVBZIOWERUTYQP" ''
|
letters =
|
||||||
|
helpers.defaultNullOpts.mkStr
|
||||||
|
"asdfjkl;ghnmxcvbziowerutyqpASDFJKLGHNMXCVBZIOWERUTYQP"
|
||||||
|
''
|
||||||
New buffer letters are assigned in this order.
|
New buffer letters are assigned in this order.
|
||||||
This order is optimal for the qwerty keyboard layout but might need adjustement for other layouts.
|
This order is optimal for the qwerty keyboard layout but might need adjustement for other layouts.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
sidebarFiletypes =
|
||||||
|
helpers.mkNullOrOption
|
||||||
|
(
|
||||||
|
with types;
|
||||||
|
attrsOf (
|
||||||
|
either
|
||||||
|
(enum [true])
|
||||||
|
(types.submodule {
|
||||||
|
options = {
|
||||||
|
text = helpers.mkNullOrOption types.str "The text used for the offset";
|
||||||
|
|
||||||
|
event =
|
||||||
|
helpers.mkNullOrOption types.str
|
||||||
|
"The event which the sidebar executes when leaving.";
|
||||||
|
};
|
||||||
|
})
|
||||||
|
)
|
||||||
|
)
|
||||||
|
"Set the filetypes which barbar will offset itself for";
|
||||||
|
|
||||||
noNameTitle = helpers.mkNullOrOption types.str ''
|
noNameTitle = helpers.mkNullOrOption types.str ''
|
||||||
Sets the name of unnamed buffers. By default format is "[Buffer X]" where X is the buffer number.
|
Sets the name of unnamed buffers.
|
||||||
|
By default format is "[Buffer X]" where X is the buffer number.
|
||||||
But only a static string is accepted here.
|
But only a static string is accepted here.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -165,52 +279,99 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = let
|
config = let
|
||||||
setupOptions = {
|
setupOptions =
|
||||||
animation = cfg.animations;
|
{
|
||||||
|
inherit (cfg) animation;
|
||||||
auto_hide = cfg.autoHide;
|
auto_hide = cfg.autoHide;
|
||||||
clickable = cfg.clickable;
|
inherit (cfg) tabpages;
|
||||||
closable = cfg.closable;
|
inherit (cfg) clickable;
|
||||||
|
|
||||||
diagnostics = [
|
|
||||||
cfg.diagnostics.error
|
|
||||||
cfg.diagnostics.warn
|
|
||||||
cfg.diagnostics.info
|
|
||||||
cfg.diagnostics.hint
|
|
||||||
];
|
|
||||||
|
|
||||||
exclude_ft = cfg.excludeFileTypes;
|
exclude_ft = cfg.excludeFileTypes;
|
||||||
exclude_name = cfg.excludeFileNames;
|
exclude_name = cfg.excludeFileNames;
|
||||||
|
focus_on_close = cfg.focusOnClose;
|
||||||
hide = cfg.hide;
|
|
||||||
|
|
||||||
highlight_alternate = cfg.highlightAlternate;
|
highlight_alternate = cfg.highlightAlternate;
|
||||||
highlight_inactive_file_icons = cfg.highlightInactiveFileIcons;
|
highlight_inactive_file_icons = cfg.highlightInactiveFileIcons;
|
||||||
highlight_visible = cfg.highlightVisible;
|
highlight_visible = cfg.highlightVisible;
|
||||||
|
icons = let
|
||||||
|
handleBufferOption = bufferOption:
|
||||||
|
with bufferOption; {
|
||||||
|
buffer_index = bufferIndex;
|
||||||
|
buffer_number = bufferNumber;
|
||||||
|
inherit button;
|
||||||
|
diagnostics = helpers.ifNonNull' bufferOption.diagnostics (
|
||||||
|
/*
|
||||||
|
Because the keys of this lua table are not strings (but
|
||||||
|
`vim.diagnostic.severity.XXXX`), we have to manualy build a raw lua string here.
|
||||||
|
*/
|
||||||
|
let
|
||||||
|
setIcons = filterAttrs (n: v: v != null) cfg.icons.diagnostics;
|
||||||
|
setIconsList =
|
||||||
|
mapAttrsToList
|
||||||
|
(name: value: {
|
||||||
|
key = "vim.diagnostic.severity.${strings.toUpper name}";
|
||||||
|
value = helpers.ifNonNull' value (helpers.toLuaObject {
|
||||||
|
enabled = value.enable;
|
||||||
|
inherit (value) icon;
|
||||||
|
});
|
||||||
|
})
|
||||||
|
setIcons;
|
||||||
|
in
|
||||||
|
helpers.mkRaw (
|
||||||
|
"{"
|
||||||
|
+ concatStringsSep ","
|
||||||
|
(
|
||||||
|
map
|
||||||
|
(iconOption: "[${iconOption.key}] = ${iconOption.value}")
|
||||||
|
setIconsList
|
||||||
|
)
|
||||||
|
+ "}"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
filetype = with filetype; {
|
||||||
|
custom_color = customColors;
|
||||||
|
enabled = enable;
|
||||||
|
};
|
||||||
|
inherit separator;
|
||||||
|
};
|
||||||
|
|
||||||
icon_close_tab = cfg.icons.closeTab;
|
handleStateOption = stateOption:
|
||||||
icon_close_tab_modified = cfg.icons.closeTabModified;
|
with stateOption;
|
||||||
icon_pinned = cfg.icons.pinned;
|
{
|
||||||
icon_separator_active = cfg.icons.separatorActive;
|
modified = handleBufferOption modified;
|
||||||
icon_separator_inactive = cfg.icons.separatorInactive;
|
pinned = handleBufferOption pinned;
|
||||||
icon_separator_visible = cfg.icons.separatorVisible;
|
}
|
||||||
icons = cfg.icons.enable;
|
// (
|
||||||
icon_custom_colors = cfg.icons.customColors;
|
handleBufferOption
|
||||||
|
(
|
||||||
insert_at_start = cfg.insertAtStart;
|
getAttrs (attrNames stateOption)
|
||||||
|
stateOption
|
||||||
|
)
|
||||||
|
);
|
||||||
|
in
|
||||||
|
(
|
||||||
|
handleStateOption
|
||||||
|
(
|
||||||
|
getAttrs
|
||||||
|
(attrNames stateOptions)
|
||||||
|
cfg.icons
|
||||||
|
)
|
||||||
|
)
|
||||||
|
// (
|
||||||
|
genAttrs
|
||||||
|
["alternate" "current" "inactive" "visible"]
|
||||||
|
(optionName: handleStateOption cfg.icons.${optionName})
|
||||||
|
);
|
||||||
|
inherit (cfg) hide;
|
||||||
insert_at_end = cfg.insertAtEnd;
|
insert_at_end = cfg.insertAtEnd;
|
||||||
|
insert_at_start = cfg.insertAtStart;
|
||||||
letters = cfg.letters;
|
|
||||||
|
|
||||||
maximum_padding = cfg.maximumPadding;
|
maximum_padding = cfg.maximumPadding;
|
||||||
minimum_padding = cfg.minimumPadding;
|
minimum_padding = cfg.minimumPadding;
|
||||||
maximum_length = cfg.maximumLength;
|
maximum_length = cfg.maximumLength;
|
||||||
|
|
||||||
no_name_title = cfg.noNameTitle;
|
|
||||||
|
|
||||||
semantic_letters = cfg.semanticLetters;
|
semantic_letters = cfg.semanticLetters;
|
||||||
|
inherit (cfg) letters;
|
||||||
tabpages = cfg.tabpages;
|
no_name_title = cfg.noNameTitle;
|
||||||
};
|
sidebar_filetypes = cfg.sidebarFiletypes;
|
||||||
|
}
|
||||||
|
// cfg.extraOptions;
|
||||||
|
|
||||||
userKeymapsList =
|
userKeymapsList =
|
||||||
mapAttrsToList
|
mapAttrsToList
|
||||||
|
|
|
@ -20,59 +20,47 @@
|
||||||
# All the upstream default options of barbar
|
# All the upstream default options of barbar
|
||||||
defaults = {
|
defaults = {
|
||||||
plugins.barbar = {
|
plugins.barbar = {
|
||||||
animations = true;
|
enable = true;
|
||||||
|
|
||||||
|
animation = true;
|
||||||
autoHide = false;
|
autoHide = false;
|
||||||
tabpages = true;
|
|
||||||
closable = true;
|
|
||||||
clickable = true;
|
clickable = true;
|
||||||
diagnostics = {
|
|
||||||
error = {
|
|
||||||
enable = false;
|
|
||||||
icon = "Ⓧ ";
|
|
||||||
};
|
|
||||||
warn = {
|
|
||||||
enable = false;
|
|
||||||
icon = "⚠️ ";
|
|
||||||
};
|
|
||||||
info = {
|
|
||||||
enable = false;
|
|
||||||
icon = "ⓘ ";
|
|
||||||
};
|
|
||||||
hint = {
|
|
||||||
enable = false;
|
|
||||||
icon = "💡";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
excludeFileTypes = [];
|
excludeFileTypes = [];
|
||||||
excludeFileNames = [];
|
excludeFileNames = [];
|
||||||
hide = {
|
focusOnClose = "left";
|
||||||
extensions = false;
|
hide = {};
|
||||||
inactive = false;
|
|
||||||
alternate = false;
|
|
||||||
current = false;
|
|
||||||
visible = false;
|
|
||||||
};
|
|
||||||
highlightAlternate = false;
|
highlightAlternate = false;
|
||||||
highlightInactiveFileIcons = false;
|
highlightInactiveFileIcons = false;
|
||||||
highlightVisible = true;
|
highlightVisible = true;
|
||||||
icons = {
|
icons = {
|
||||||
enable = true;
|
bufferIndex = false;
|
||||||
customColors = false;
|
bufferNumber = false;
|
||||||
separatorActive = "▎";
|
button = "";
|
||||||
separatorInactive = "▎";
|
diagnostics = {};
|
||||||
separatorVisible = "▎";
|
filetype = {enable = true;};
|
||||||
closeTab = "";
|
inactive = {
|
||||||
closeTabModified = "●";
|
separator = {
|
||||||
pinned = "車";
|
left = "▎";
|
||||||
|
right = "";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
modified = {button = "●";};
|
||||||
|
pinned = {button = "";};
|
||||||
|
separator = {
|
||||||
|
left = "▎";
|
||||||
|
right = "";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
insertAtEnd = false;
|
insertAtEnd = false;
|
||||||
insertAtStart = false;
|
insertAtStart = false;
|
||||||
|
letters = "asdfjkl;ghnmxcvbziowerutyqpASDFJKLGHNMXCVBZIOWERUTYQP";
|
||||||
|
maximumLength = 30;
|
||||||
maximumPadding = 4;
|
maximumPadding = 4;
|
||||||
minimumPadding = 1;
|
minimumPadding = 1;
|
||||||
maximumLength = 30;
|
|
||||||
semanticLetters = true;
|
|
||||||
letters = "asdfjkl;ghnmxcvbziowerutyqpASDFJKLGHNMXCVBZIOWERUTYQP";
|
|
||||||
noNameTitle = null;
|
noNameTitle = null;
|
||||||
|
semanticLetters = true;
|
||||||
|
sidebarFiletypes = {};
|
||||||
|
tabpages = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue