1
0
Fork 0

Update vim config

This commit is contained in:
Malte Brandy 2021-07-05 21:09:01 +02:00
parent d4b7a4bbbe
commit a09b413eb2
No known key found for this signature in database
GPG key ID: 226A2D41EF5378C9

View file

@ -1,10 +1,37 @@
{ pkgs, config, ... }: { pkgs, config, ... }:
let let
neovim = pkgs.neovim.override { list = builtins.attrValues;
configure = { cocSettings = {
customRC = builtins.readFile ./vimrc; "diagnostic.maxWindowHeight" = 60;
packages.myVimPackage = { "diagnostic.virtualText" = true;
start = builtins.attrValues { "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) inherit (pkgs.vimPlugins)
# coc-tabnine (TODO: Why doesnt it work?) # coc-tabnine (TODO: Why doesnt it work?)
# TODO: tabnine config in home-manager # TODO: tabnine config in home-manager
@ -58,36 +85,9 @@ let
; ;
}; };
}; };
};
};
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 ];
home = { home = {
file.".config/nvim/coc-settings.json".text = builtins.toJSON cocSettings; file.".config/nvim/coc-settings.json".text = builtins.toJSON cocSettings;
packages = [ neovim pkgs.neuron-language-server ]; packages = [ neovim pkgs.neuron-language-server ];
sessionVariables.EDITOR = "${neovim}/bin/nvim"; sessionVariables.EDITOR = "nvim";
}; };
} }