Set leader key first

extraConfig is included after the plugin config
=> Let's create a fake plugin derivation, so that we can use it to set
configuration before the plugin configurations.
This commit is contained in:
Jakob Lechner 2024-06-14 13:11:18 +02:00
parent 9de22b4026
commit 0ba830ca4d

View file

@ -1,13 +1,14 @@
{ lib, nixosConfig, config, pkgs, ... }:
let
fakePlugin = pkgs.runCommand "neovim-fake-plugin" { } "mkdir $out";
in
{
programs.neovim = {
enable = true;
vimAlias = true;
defaultEditor = true;
extraConfig = ''
" use space as leader
let mapleader = " "
colorscheme NeoSolarized
"""""""""""""""""
@ -66,8 +67,17 @@
lua require('init')
'';
plugins = [
{
plugin = fakePlugin;
config = ''
" use space as leader
let mapleader = " "
'';
}
] ++
# nix-env -f '<nixpkgs>' -qaP -A vimPlugins
plugins = with pkgs.vimPlugins; [
(with pkgs.vimPlugins; [
#Valloric/MatchTagAlways
#frankier/neovim-colors-solarized-truecolor-only
#nvie/vim-rst-tables
@ -86,7 +96,7 @@
config = "lua require('lsp_signature').setup()";
}
)
];
]);
};
xdg.configFile."nvim/lua/init.lua".text = builtins.concatStringsSep "\n" (