{ config
, pkgs
, ...
}:

{
  programs.neovim = {
    enable = true;
    extraConfig = builtins.readFile ./init.vim;
    withNodeJs = false;
    vimAlias = true;
    withPython3 = true;
    extraPackages = with pkgs; [
      gcc
      python37Packages.yapf
      hlint
      ocamlformat
      ocamlPackages.ocaml-lsp
    ];
    plugins = with pkgs.vimPlugins; [
      # neovim only
      nvim-lspconfig
      (nvim-treesitter.withPlugins (_: pkgs.tree-sitter.allGrammars))
      completion-nvim

      # tpope
      vim-surround
      vim-unimpaired
      vim-repeat
      # vim-fugitive

      # syntax
      rust-vim
      vim-nix
      vimtex

      # handy
      # vim-gitgutter
      tabular
      emmet-vim
      vimwiki
      fzf-vim
    ];
  };
}