nix-community.nixvim/plugins/bufferlines/barbar.nix
Pedro Alves 4ddd3969e5
nixvim: support standalone nixvim
This represents a major rearchitecture for nixvim, so I'm leaving this up to track the progress for now, and to serve as a reference for any breaking changes during transition.

The main change is, of course, being able to use nixvim standalone. To do this, you should use the new build function, which takes in two arguments: the system architecture (e.g. x86_64-linux) and the configuration. For the new configuration, do not use the programs.nixvim. prefix.

For module development, the main change is that you should no longer prefix your modules with programs.nixvim..
2022-09-18 11:19:23 +01:00

58 lines
1.6 KiB
Nix

{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.plugins.barbar;
in
{
options.plugins.barbar = {
enable = mkEnableOption "Enable barbar.nvim";
animations = mkOption {
type = types.nullOr types.bool;
default = null;
description = "Enable animations";
};
autoHide = mkOption {
type = types.nullOr types.bool;
default = null;
description = "Auto-hide the tab bar when there is only one buffer";
};
closeable = mkOption {
type = types.nullOr types.bool;
default = null;
description = "Enable the close button";
};
icons = mkOption {
type = with types; nullOr (oneOf [bool (enum ["numbers both"])]);
default = null;
description = "Enable/disable icons";
};
iconCustomColors = mkOption {
type = with types; nullOr (oneOf [bool str]);
default = null;
description = "Sets the icon highlight group";
};
# Keybinds concept:
# keys = {
# previousBuffer = mkBindDef "normal" "Previous buffer" { action = ":BufferPrevious<CR>"; silent = true; } "<A-,>";
# nextBuffer = mkBindDef "normal" "Next buffer" { action = ":BufferNext<CR>"; silent = true; } "<A-.>";
# movePrevious = mkBindDef "normal" "Re-order to previous" { action = ":BufferMovePrevious<CR>"; silent = true; } "<A-<>";
# moveNext = mkBindDef "normal" "Re-order to next" { action = ":BufferMoveNext<CR>"; silent = true; } "<A->>";
# # TODO all the other ones.....
# };
};
config = mkIf cfg.enable {
extraPlugins = with pkgs.vimPlugins; [
barbar-nvim nvim-web-devicons
];
# maps = genMaps cfg.keys;
};
}