neovim: Add coc support (#2154)
This adds two new options: 'programs.neovim.coc.{enable,settings}`.
These settings offer a simple interface over `xdg.configFile."nvim/coc-settings.json`,
using the standard Nix' syntax instead of a multiline string.
This commit is contained in:
parent
0423a7b40c
commit
addc78bea0
4 changed files with 79 additions and 3 deletions
3
tests/modules/programs/neovim/coc-config.expected
Normal file
3
tests/modules/programs/neovim/coc-config.expected
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"foo": "bar"
|
||||
}
|
||||
27
tests/modules/programs/neovim/coc-config.nix
Normal file
27
tests/modules/programs/neovim/coc-config.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
coc = {
|
||||
enable = true;
|
||||
settings = {
|
||||
# my variable
|
||||
foo = "bar";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
cocSettings="$TESTED/home-files/.config/nvim/coc-settings.json"
|
||||
cocSettingsNormalized="$(normalizeStorePaths "$cocSettings")"
|
||||
|
||||
assertFileExists "$cocSettings"
|
||||
assertFileContent "$cocSettingsNormalized" "${./coc-config.expected}"
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
neovim-plugin-config = ./plugin-config.nix;
|
||||
neovim-coc-config = ./coc-config.nix;
|
||||
# waiting for a nixpkgs patch
|
||||
# neovim-no-init = ./no-init.nix;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue