1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-11-08 19:46:06 +01:00

added formatter + reformat existing codebase (#175)

This commit is contained in:
Gaétan Lepage 2023-02-20 11:42:13 +01:00 committed by GitHub
parent 0bf4313f22
commit 264de8cefb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
96 changed files with 3727 additions and 3341 deletions

View file

@ -1,11 +1,14 @@
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.colorschemes.base16;
helpers = import ../helpers.nix { inherit lib; };
themes = import ./base16-list.nix;
in
{
pkgs,
config,
lib,
...
}:
with lib; let
cfg = config.colorschemes.base16;
helpers = import ../helpers.nix {inherit lib;};
themes = import ./base16-list.nix;
in {
options = {
colorschemes.base16 = {
enable = mkEnableOption "base16";
@ -34,7 +37,7 @@ in
config = mkIf cfg.enable {
colorscheme = "base16-${cfg.colorscheme}";
extraPlugins = [ cfg.package ];
extraPlugins = [cfg.package];
plugins.airline.theme = mkIf (cfg.setUpBar) "base16";
plugins.lightline.colorscheme = null;

View file

@ -1,11 +1,14 @@
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.colorschemes.gruvbox;
helpers = import ../helpers.nix { inherit lib; };
colors = types.enum [ "bg" "red" "green" "yellow" "blue" "purple" "aqua" "gray" "fg" "bg0_h" "bg0" "bg1" "bg2" "bg3" "bg4" "gray" "orange" "bg0_s" "fg0" "fg1" "fg2" "fg3" "fg4" ];
in
{
pkgs,
config,
lib,
...
}:
with lib; let
cfg = config.colorschemes.gruvbox;
helpers = import ../helpers.nix {inherit lib;};
colors = types.enum ["bg" "red" "green" "yellow" "blue" "purple" "aqua" "gray" "fg" "bg0_h" "bg0" "bg1" "bg2" "bg3" "bg4" "gray" "orange" "bg0_s" "fg0" "fg1" "fg2" "fg3" "fg4"];
in {
options = {
colorschemes.gruvbox = {
enable = mkEnableOption "gruvbox";
@ -18,13 +21,13 @@ in
undercurl = mkEnableOption "undercurled text";
contrastDark = mkOption {
type = types.nullOr (types.enum [ "soft" "medium" "hard" ]);
type = types.nullOr (types.enum ["soft" "medium" "hard"]);
default = null;
description = "Contrast for the dark mode";
};
contrastLight = mkOption {
type = types.nullOr (types.enum [ "soft" "medium" "hard" ]);
type = types.nullOr (types.enum ["soft" "medium" "hard"]);
default = null;
description = "Contrast for the light mode";
};
@ -110,13 +113,12 @@ in
transparentBg = mkEnableOption "transparent background";
trueColor = mkEnableOption "true color support";
};
};
config = mkIf cfg.enable {
colorscheme = "gruvbox";
extraPlugins = [ cfg.package ];
extraPlugins = [cfg.package];
globals = {
gruvbox_bold = mkIf (!cfg.bold) 0;

View file

@ -1,29 +1,37 @@
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.colorschemes.nord;
helpers = import ../helpers.nix { inherit lib; };
in
{
pkgs,
config,
lib,
...
}:
with lib; let
cfg = config.colorschemes.nord;
helpers = import ../helpers.nix {inherit lib;};
in {
options = {
colorschemes.nord = {
enable = mkEnableOption "nord";
package = helpers.mkPackageOption "nord.vim" pkgs.vimPlugins.nord-nvim;
contrast = mkEnableOption
contrast =
mkEnableOption
"Make sidebars and popup menus like nvim-tree and telescope have a different background";
borders = mkEnableOption
borders =
mkEnableOption
"Enable the border between verticaly split windows visable";
disable_background = mkEnableOption
disable_background =
mkEnableOption
"Disable the setting of background color so that NeoVim can use your terminal background";
cursorline_transparent = mkEnableOption
cursorline_transparent =
mkEnableOption
"Set the cursorline transparent/visible";
enable_sidebar_background = mkEnableOption
enable_sidebar_background =
mkEnableOption
"Re-enables the background of the sidebar if you disabled the background of everything";
italic = mkOption {
@ -36,7 +44,7 @@ in
config = mkIf cfg.enable {
colorscheme = "nord";
extraPlugins = [ cfg.package ];
extraPlugins = [cfg.package];
globals = {
nord_contrast = mkIf cfg.contrast 1;

View file

@ -1,10 +1,13 @@
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.colorschemes.one;
helpers = import ../helpers.nix { inherit lib; };
in
{
pkgs,
config,
lib,
...
}:
with lib; let
cfg = config.colorschemes.one;
helpers = import ../helpers.nix {inherit lib;};
in {
options = {
colorschemes.one = {
enable = mkEnableOption "vim-one";
@ -15,7 +18,7 @@ in
config = mkIf cfg.enable {
colorscheme = "one";
extraPlugins = [ cfg.package ];
extraPlugins = [cfg.package];
options = {
termguicolors = true;

View file

@ -1,10 +1,13 @@
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.colorschemes.onedark;
helpers = import ../helpers.nix { inherit lib; };
in
{
pkgs,
config,
lib,
...
}:
with lib; let
cfg = config.colorschemes.onedark;
helpers = import ../helpers.nix {inherit lib;};
in {
options = {
colorschemes.onedark = {
enable = mkEnableOption "onedark";
@ -15,7 +18,7 @@ in
config = mkIf cfg.enable {
colorscheme = "onedark";
extraPlugins = [ cfg.package ];
extraPlugins = [cfg.package];
options = {
termguicolors = true;

View file

@ -1,76 +1,72 @@
{ pkgs
, config
, lib
, ...
}@args:
{
pkgs,
config,
lib,
...
} @ args:
with lib; let
cfg = config.colorschemes.tokyonight;
helpers = import ../helpers.nix args;
in
{
in {
options = {
colorschemes.tokyonight = {
enable = mkEnableOption "tokyonight";
package = helpers.mkPackageOption "tokyonight" pkgs.vimPlugins.tokyonight-nvim;
style = helpers.defaultNullOpts.mkEnumFirstDefault [ "storm" "night" "day" ] "Theme style";
style = helpers.defaultNullOpts.mkEnumFirstDefault ["storm" "night" "day"] "Theme style";
terminalColors =
helpers.defaultNullOpts.mkBool true
"Configure the colors used when opening a :terminal in Neovim";
"Configure the colors used when opening a :terminal in Neovim";
transparent = helpers.defaultNullOpts.mkBool false "disable setting the background color";
styles =
let
mkBackgroundStyle = name:
helpers.defaultNullOpts.mkEnumFirstDefault [ "dark" "transparent" "normal" ]
"Background style for ${name}";
in
{
comments =
helpers.defaultNullOpts.mkNullable (types.attrsOf types.anything) "{italic = true;}"
"Define comments highlight properties";
keywords =
helpers.defaultNullOpts.mkNullable (types.attrsOf types.anything) "{italic = true;}"
"Define keywords highlight properties";
functions =
helpers.defaultNullOpts.mkNullable (types.attrsOf types.anything) "{}"
"Define functions highlight properties";
variables =
helpers.defaultNullOpts.mkNullable (types.attrsOf types.anything) "{}"
"Define variables highlight properties";
sidebars = mkBackgroundStyle "sidebars";
floats = mkBackgroundStyle "floats";
};
styles = let
mkBackgroundStyle = name:
helpers.defaultNullOpts.mkEnumFirstDefault ["dark" "transparent" "normal"]
"Background style for ${name}";
in {
comments =
helpers.defaultNullOpts.mkNullable (types.attrsOf types.anything) "{italic = true;}"
"Define comments highlight properties";
keywords =
helpers.defaultNullOpts.mkNullable (types.attrsOf types.anything) "{italic = true;}"
"Define keywords highlight properties";
functions =
helpers.defaultNullOpts.mkNullable (types.attrsOf types.anything) "{}"
"Define functions highlight properties";
variables =
helpers.defaultNullOpts.mkNullable (types.attrsOf types.anything) "{}"
"Define variables highlight properties";
sidebars = mkBackgroundStyle "sidebars";
floats = mkBackgroundStyle "floats";
};
sidebars =
helpers.defaultNullOpts.mkNullable (types.listOf types.str) ''["qf" "help"]''
"Set a darker background on sidebar-like windows";
"Set a darker background on sidebar-like windows";
dayBrightness =
helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) "0.3"
"Adjusts the brightness of the colors of the **Day** style";
"Adjusts the brightness of the colors of the **Day** style";
hideInactiveStatusline =
helpers.defaultNullOpts.mkBool false
"Enabling this option will hide inactive statuslines and replace them with a thin border";
"Enabling this option will hide inactive statuslines and replace them with a thin border";
dimInactive = helpers.defaultNullOpts.mkBool false "dims inactive windows";
lualineBold =
helpers.defaultNullOpts.mkBool false
"When true, section headers in the lualine theme will be bold";
"When true, section headers in the lualine theme will be bold";
};
};
config = mkIf cfg.enable {
colorscheme = "tokyonight";
extraPlugins = [ cfg.package ];
options = { termguicolors = true; };
extraConfigLuaPre =
let
setupOptions = with cfg; {
inherit (cfg) style transparent styles sidebars;
terminal_colors = terminalColors;
hide_inactive_statusline = hideInactiveStatusline;
dim_inactive = dimInactive;
lualine_bold = lualineBold;
day_brightness = dayBrightness;
};
in
''
require("tokyonight").setup(${helpers.toLuaObject setupOptions})
'';
extraPlugins = [cfg.package];
options = {termguicolors = true;};
extraConfigLuaPre = let
setupOptions = with cfg; {
inherit (cfg) style transparent styles sidebars;
terminal_colors = terminalColors;
hide_inactive_statusline = hideInactiveStatusline;
dim_inactive = dimInactive;
lualine_bold = lualineBold;
day_brightness = dayBrightness;
};
in ''
require("tokyonight").setup(${helpers.toLuaObject setupOptions})
'';
};
}