summary refs log tree commit diff stats
path: root/user/settings/neovim.nix
blob: f42387ee5ba5bb0b3614bbf59e9adb4242aa736b (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
{ config
, lib
, pkgs
, ...
}: {
  programs.neovim = {
    enable = true;
    defaultEditor = true;
    vimAlias = true;
    vimdiffAlias = true;
    withNodeJs = true;
    plugins = with pkgs.vimPlugins; [
      commentary
      coc-git
      coc-json
      coc-yaml
      direnv-vim
      vim-tridactyl
      vim-surround
    ];
    extraLuaConfig = builtins.readFile ../nvim/init.lua;
    coc = {
      enable = true;
      settings = {
        "json.enable" = true;
        "suggest.enablePreview" = true;
        "coc.preferences.formatOnSaveFiletypes" = [ "nix" ];
        "nil.formatting.command" = "nixpkgs-fmt";
        semantictokens = {
          filetypes = [ "nix" ];
        };
        languageserver = {
          nix = {
            command = "${pkgs.nil}/bin/nil";
            filetypes = [ "nix" ];
          };
        };
      };
    };
  };
}