helix: add module

This commit is contained in:
Philipp Mildenberger 2022-01-04 00:09:24 +01:00 committed by Robert Helgesson
parent e8a68de7ab
commit 32da35f65b
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
11 changed files with 376 additions and 0 deletions

View file

@ -0,0 +1 @@
{ helix-example-settings = ./example-settings.nix; }

View file

@ -0,0 +1,118 @@
{ config, lib, pkgs, ... }:
with lib;
{
config = {
programs.helix = {
enable = true;
settings = {
theme = "base16";
lsp.display-messages = true;
keys.normal = {
space.space = "file_picker";
space.w = ":w";
space.q = ":q";
};
};
languages = [{
name = "rust";
auto-format = false;
}];
themes = {
base16 = let
transparent = "none";
gray = "#665c54";
dark-gray = "#3c3836";
white = "#fbf1c7";
black = "#282828";
red = "#fb4934";
green = "#b8bb26";
yellow = "#fabd2f";
orange = "#fe8019";
blue = "#83a598";
magenta = "#d3869b";
cyan = "#8ec07c";
in {
"ui.menu" = transparent;
"ui.menu.selected" = { modifiers = [ "reversed" ]; };
"ui.linenr" = {
fg = gray;
bg = dark-gray;
};
"ui.popup" = { modifiers = [ "reversed" ]; };
"ui.linenr.selected" = {
fg = white;
bg = black;
modifiers = [ "bold" ];
};
"ui.selection" = {
fg = black;
bg = blue;
};
"ui.selection.primary" = { modifiers = [ "reversed" ]; };
"comment" = { fg = gray; };
"ui.statusline" = {
fg = white;
bg = dark-gray;
};
"ui.statusline.inactive" = {
fg = dark-gray;
bg = white;
};
"ui.help" = {
fg = dark-gray;
bg = white;
};
"ui.cursor" = { modifiers = [ "reversed" ]; };
"variable" = red;
"variable.builtin" = orange;
"constant.numeric" = orange;
"constant" = orange;
"attributes" = yellow;
"type" = yellow;
"ui.cursor.match" = {
fg = yellow;
modifiers = [ "underlined" ];
};
"string" = green;
"variable.other.member" = red;
"constant.character.escape" = cyan;
"function" = blue;
"constructor" = blue;
"special" = blue;
"keyword" = magenta;
"label" = magenta;
"namespace" = blue;
"diff.plus" = green;
"diff.delta" = yellow;
"diff.minus" = red;
"diagnostic" = { modifiers = [ "underlined" ]; };
"ui.gutter" = { bg = black; };
"info" = blue;
"hint" = dark-gray;
"debug" = dark-gray;
"warning" = yellow;
"error" = red;
};
};
};
test.stubs.helix = { };
nmt.script = ''
assertFileContent \
home-files/.config/helix/config.toml \
${./settings-expected.toml}
assertFileContent \
home-files/.config/helix/languages.toml \
${./languages-expected.toml}
assertFileContent \
home-files/.config/helix/themes/base16.toml \
${./theme-base16-expected.toml}
'';
};
}

View file

@ -0,0 +1,3 @@
[[language]]
auto-format = false
name = "rust"

View file

@ -0,0 +1,11 @@
theme = "base16"
[keys]
[keys.normal]
[keys.normal.space]
q = ":q"
space = "file_picker"
w = ":w"
[lsp]
display-messages = true

View file

@ -0,0 +1,74 @@
attributes = "#fabd2f"
constant = "#fe8019"
"constant.character.escape" = "#8ec07c"
"constant.numeric" = "#fe8019"
constructor = "#83a598"
debug = "#3c3836"
"diff.delta" = "#fabd2f"
"diff.minus" = "#fb4934"
"diff.plus" = "#b8bb26"
error = "#fb4934"
function = "#83a598"
hint = "#3c3836"
info = "#83a598"
keyword = "#d3869b"
label = "#d3869b"
namespace = "#83a598"
special = "#83a598"
string = "#b8bb26"
type = "#fabd2f"
"ui.menu" = "none"
variable = "#fb4934"
"variable.builtin" = "#fe8019"
"variable.other.member" = "#fb4934"
warning = "#fabd2f"
[comment]
fg = "#665c54"
[diagnostic]
modifiers = ["underlined"]
["ui.cursor"]
modifiers = ["reversed"]
["ui.cursor.match"]
fg = "#fabd2f"
modifiers = ["underlined"]
["ui.gutter"]
bg = "#282828"
["ui.help"]
bg = "#fbf1c7"
fg = "#3c3836"
["ui.linenr"]
bg = "#3c3836"
fg = "#665c54"
["ui.linenr.selected"]
bg = "#282828"
fg = "#fbf1c7"
modifiers = ["bold"]
["ui.menu.selected"]
modifiers = ["reversed"]
["ui.popup"]
modifiers = ["reversed"]
["ui.selection"]
bg = "#83a598"
fg = "#282828"
["ui.selection.primary"]
modifiers = ["reversed"]
["ui.statusline"]
bg = "#3c3836"
fg = "#fbf1c7"
["ui.statusline.inactive"]
bg = "#fbf1c7"
fg = "#3c3836"