aboutsummaryrefslogtreecommitdiffstats
path: root/modules/development/nixvim/default.nix
blob: 00712cc73ecb2202ecce94fab73815e5957f4253 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Neovim configured through Nix
{
  config,
  lib,
  pkgs,
  ...
}:
let
  base16Colors = import ../../colors/base16 { inherit config lib pkgs; };
in
{
  imports = [
    ./colorscheme.nix
    ./keymaps.nix
    ./plugins
  ];

  options.development.nixvim = {
    enable = lib.mkEnableOption "Enables nixvim.";
    package = lib.mkOption {
      type = lib.types.package;
      readOnly = true;
      default = config.programs.nixvim.build.package;
      description = "The nixvim package to use.";
    };
  };

  config = lib.mkIf config.development.nixvim.enable {
    programs.nixvim = {
      enable = true;
      defaultEditor = true;
      opts = {
        number = true;
        relativenumber = true;
        shiftwidth = 2;
        tabstop = 2;
        softtabstop = 2;
        expandtab = true;
        wrap = true;
        linebreak = true;
        breakindent = true;
        showbreak = "↳";
        list = true;
        laststatus = 3;
        foldlevel = 99;
        clipboard = "unnamedplus";
        updatetime = 500;
        fillchars = "eob: ";
        listchars = "tab:  ,trail:_,lead: ";
        exrc = true;
      };
      globals.mapleader = " ";
      clipboard.providers.xclip.enable = true;

      highlight = with base16Colors.colorsWithHashPrefix; {
        WinSeparator = {
          fg = base01;
          bg = base00;
        };
      };

      performance = {
        byteCompileLua.enable = true;
        combinePlugins.enable = true;
      };

      diagnostic = {
        settings = {
          virtual_text = false;
          signs = true;
          underline = true;
          update_in_insert = false;
          float = {
            border = "rounded";
            source = true;
            header = "";
            prefix = "";
          };
        };
      };
    };
  };
}