1
0
Fork 0
nixos-config/home-manager/roles/neovim/default.nix
Malte Brandy 57123b08e1 Reformat
2022-03-08 02:42:46 +01:00

107 lines
2.7 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
pkgs,
config,
...
}: let
list = builtins.attrValues;
cocSettings = {
"diagnostic.maxWindowHeight" = 60;
"diagnostic.virtualText" = true;
"diagnostic.virtualTextCurrentLineOnly" = false;
"codeLens.enable" = true;
languageserver = {
nix = {
command = "rnix-lsp";
filetypes = ["nix"];
};
haskell = {
command = "haskell-language-server";
args = ["--lsp" "-d" "-l" "/tmp/LanguageServer.log"];
rootPatterns = [".hie-bios" "cabal.project"];
filetypes = ["hs" "lhs" "haskell"];
settings.languageServerHaskell.formattingProvider = "fourmolu";
};
};
explorer.icon.enableNerdfont = true;
explorer.file.child.template = "[git | 2] [selection | clip | 1] [indent][icon | 1] [diagnosticError & 1][diagnosticWarning & 1][filename omitCenter 1][modified][readonly] [linkIcon & 1][link growRight 1 omitCenter 5][size]";
};
in {
imports = [./spelling.nix];
programs.neovim = {
enable = true;
vimAlias = true;
vimdiffAlias = true;
extraConfig = builtins.readFile ./vimrc;
plugins = list {
inherit
(pkgs.vimPlugins)
# coc-tabnine (TODO: Why doesnt it work?)
# TODO: tabnine config in home-manager
# TODO: tabnine lsp: nix, rust, pandoc/latex lsp? was noch?
# ===
# Basic IDE plugins
coc-nvim
airline
# same word highlighting when not supported by language
coc-highlight
coc-explorer
# searches
coc-fzf
fzf-vim
# general whitespace
vim-trailing-whitespace
vim-autoformat
# Git
coc-git
# statusline, numberline and explorer infos
fugitive
# various git commands
# Commenting and Uncommenting
nerdcommenter
# Theme
papercolor-theme
vim-airline-themes
LanguageTool-nvim
vim-css-color
vista-vim
# ===
# Languages
# haskell syntax highlighting
haskell-vim
vim-hoogle
# nix syntax highlighting
vim-nix
vim-markdown
# latex
vimtex
coc-vimtex
# not sure if I need two
# ledger
vim-ledger
# rust
coc-rls
# python
coc-python
# css
coc-css
# yaml
coc-yaml
# json
coc-json
# html
coc-html
# dhall
dhall-vim
;
};
};
xdg.configFile."nvim/coc-settings.json".text = builtins.toJSON cocSettings;
home = {
packages = [pkgs.languagetool];
sessionVariables = {
EDITOR = "nvim";
VISUAL = "nvim";
};
};
}