summaryrefslogtreecommitdiff
path: root/nixvim/plugins/bufferline.nix
blob: 85dc127346eb26bcaa75df4baceb7c262b203f6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{ lib, ... }:
let
  applyDefaultOpts = map (
    lib.recursiveUpdate {
      mode = "n";
      options = {
        noremap = true;
        silent = true;
      };
    }
  );
in
{
  keymaps =
    applyDefaultOpts [
      {
        action = "BufferLinePickClose";
        key = "<leader>q";
      }
    ]
    ++ map (i: {
      action = "BufferLineGoToBuffer ${toString i}";
      key = "<leader>${toString i}";
    }) (lib.range 1 9);

  plugins.bufferline = {
    enable = true;

    alwaysShowBufferline = false;
    diagnostics = "nvim_lsp";
    mode = "buffers";
    numbers = "ordinal";
    separatorStyle = "slant";
  };
}