From 7122ccd20877d6735db1c8636bdf9e77cd6c21d2 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Tue, 5 Jan 2021 11:26:49 +0000 Subject: [PATCH] add vim-airline --- .gitignore | 1 + .tmp | 2 +- flake.nix | 7 ++- nixvim.nix | 48 +++++++++++++++++++- plugins/default.nix | 1 + plugins/helpers.nix | 2 +- plugins/statuslines/airline.nix | 75 +++++++++++++++++++++++++++++++ plugins/statuslines/lightline.nix | 16 +------ test.sh | 8 ++++ 9 files changed, 142 insertions(+), 18 deletions(-) create mode 100644 .gitignore create mode 100644 plugins/statuslines/airline.nix create mode 100755 test.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..3018b3a6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.tmp/ diff --git a/.tmp b/.tmp index b4c86e26..40b0361a 120000 --- a/.tmp +++ b/.tmp @@ -1 +1 @@ -/nix/store/5ixvasljzz7fixv2nd28c8d6bsnam3ap-nixos-system-nixos-21.03.20201227.2f47650 \ No newline at end of file +/nix/store/r2p2qi63zznjdf0gjif7v8qmsm5g72d7-nixos-system-nixos-21.03.20201227.2f47650 \ No newline at end of file diff --git a/flake.nix b/flake.nix index cd59532f..170ff892 100644 --- a/flake.nix +++ b/flake.nix @@ -35,7 +35,12 @@ package = pkgs.neovim-nightly; colorschemes.gruvbox.enable = true; - plugins.lightline.enable = true; + options.number = true; + + plugins.airline = { + enable = true; + powerline = true; + }; }; }) ]; diff --git a/nixvim.nix b/nixvim.nix index e37dfe28..bba63534 100644 --- a/nixvim.nix +++ b/nixvim.nix @@ -21,6 +21,8 @@ let }; }; }; + + helpers = import ./plugins/helpers.nix { lib = lib; }; in { options = { @@ -60,6 +62,18 @@ in type = types.attrsOf types.anything; default = { }; }; + + options = mkOption { + type = types.attrsOf types.anything; + default = { }; + description = "The configuration options, e.g. line numbers"; + }; + + globals = mkOption { + type = types.attrsOf types.anything; + default = {}; + description = "Global variables"; + }; }; }; @@ -85,7 +99,11 @@ in environment.systemPackages = [ wrappedNeovim ]; programs.nixvim = { configure = { - customRC = cfg.extraConfigVim + (optionalString (cfg.colorscheme != "") '' + customRC = '' + lua <