summaryrefslogtreecommitdiff
path: root/nvim/default.nix
blob: a1a2aa6971bea2cbec11356e79a61104132b2ca6 (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
{}: rec {

  pkgs = (import ../pkgs.nix).stable {};

  init = pkgs.writeText "nvim-init.lua" ''
    vim.cmd('source ${pkgs.vimPlugins.vim-plug}/plug.vim')

    local Plug = vim.fn['plug#']

    vim.call('plug#begin')

    Plug('${pkgs.vimPlugins.nerdtree}', { ['on'] = 'NERDTreeToggle' })
    Plug('${pkgs.vimPlugins.nerdtree-git-plugin}')
    Plug('${pkgs.vimPlugins.vim-gitgutter}')

    Plug('${pkgs.vimPlugins.nvim-lspconfig}')
    Plug('${pkgs.vimPlugins.nvim-cmp}')
    Plug('${pkgs.vimPlugins.cmp-nvim-lsp}')

    vim.call('plug#end')

    vim.cmd('source ${./init.vim}')

    ${builtins.readFile ./init.lua}
  '';

  nvim = pkgs.writeShellScriptBin "nvim" ''
    exec ${pkgs.neovim}/bin/nvim -u ${init} "$@"
  '';
}