mirror of
https://github.com/nix-community/home-manager
synced 2024-11-30 06:59:45 +01:00
programs.neovim: dont wrap init.vim (#2058)
since we want to write it ourself in ~/.config/nvim/init.vim
This commit is contained in:
parent
95da56b783
commit
c7e79b5337
4 changed files with 32 additions and 7 deletions
|
@ -51,8 +51,7 @@ let
|
|||
(map (x: if x ? plugin && x.optional == true then x.plugin else null)
|
||||
cfg.plugins);
|
||||
};
|
||||
customRC = pkgs.lib.concatMapStrings pluginConfig cfg.plugins
|
||||
+ cfg.extraConfig;
|
||||
beforePlugins = "";
|
||||
};
|
||||
|
||||
extraMakeWrapperArgs = lib.optionalString (cfg.extraPackages != [ ])
|
||||
|
@ -242,11 +241,14 @@ in {
|
|||
|
||||
home.packages = [ cfg.finalPackage ];
|
||||
|
||||
xdg.configFile."nvim/init.vim".text = neovimConfig.neovimRcContent;
|
||||
xdg.configFile = mkIf (neovimConfig.neovimRcContent != "") {
|
||||
"nvim/init.vim".text = neovimConfig.neovimRcContent;
|
||||
};
|
||||
programs.neovim.finalPackage = pkgs.wrapNeovimUnstable cfg.package
|
||||
(neovimConfig // {
|
||||
wrapperArgs = (lib.escapeShellArgs neovimConfig.wrapperArgs) + " "
|
||||
+ extraMakeWrapperArgs;
|
||||
wrapRc = false;
|
||||
});
|
||||
|
||||
programs.bash.shellAliases = mkIf cfg.vimdiffAlias { vimdiff = "nvim -d"; };
|
||||
|
|
|
@ -1 +1,5 @@
|
|||
{ neovim-plugin-config = ./plugin-config.nix; }
|
||||
{
|
||||
neovim-plugin-config = ./plugin-config.nix;
|
||||
# waiting for a nixpkgs patch
|
||||
# neovim-no-init = ./no-init.nix;
|
||||
}
|
||||
|
|
22
tests/modules/programs/neovim/no-init.nix
Normal file
22
tests/modules/programs/neovim/no-init.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
package = pkgs.neovim-unwrapped;
|
||||
vimAlias = true;
|
||||
withNodeJs = false;
|
||||
withPython3 = true;
|
||||
withRuby = false;
|
||||
|
||||
extraPython3Packages = (ps: with ps; [ jedi pynvim ]);
|
||||
};
|
||||
nmt.script = ''
|
||||
vimrc="home-files/.config/nvim/init.vim"
|
||||
assertPathNotExists "$vimrc"
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -1,6 +1,3 @@
|
|||
" configuration generated by NIX
|
||||
set nocompatible
|
||||
|
||||
set packpath^=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-vim-pack-dir
|
||||
set runtimepath^=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-vim-pack-dir
|
||||
|
||||
|
|
Loading…
Reference in a new issue