Eigene helix config
This commit is contained in:
parent
c0fd70572c
commit
76c76e9e7c
3 changed files with 88 additions and 80 deletions
|
@ -11,6 +11,7 @@
|
||||||
./unlock.nix
|
./unlock.nix
|
||||||
./mpclient.nix
|
./mpclient.nix
|
||||||
./neovim
|
./neovim
|
||||||
|
./helix.nix
|
||||||
./nvd.nix
|
./nvd.nix
|
||||||
];
|
];
|
||||||
nixpkgs.overlays = import ../../overlays {inherit lib;};
|
nixpkgs.overlays = import ../../overlays {inherit lib;};
|
||||||
|
|
86
home-manager/roles/helix.nix
Normal file
86
home-manager/roles/helix.nix
Normal file
|
@ -0,0 +1,86 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
language-servers = {
|
||||||
|
inherit
|
||||||
|
(pkgs.nodePackages)
|
||||||
|
typescript-language-server
|
||||||
|
vscode-json-languageserver-bin
|
||||||
|
vscode-html-languageserver-bin
|
||||||
|
vscode-css-languageserver-bin
|
||||||
|
;
|
||||||
|
inherit (pkgs.python3Packages) python-lsp-server;
|
||||||
|
inherit
|
||||||
|
(pkgs)
|
||||||
|
rust-analyzer
|
||||||
|
taplo
|
||||||
|
# toml
|
||||||
|
|
||||||
|
nil
|
||||||
|
# nix
|
||||||
|
|
||||||
|
texlab
|
||||||
|
# latex
|
||||||
|
|
||||||
|
lean
|
||||||
|
yaml-language-server
|
||||||
|
languagetool
|
||||||
|
;
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
home = {
|
||||||
|
packages = builtins.attrValues language-servers;
|
||||||
|
sessionVariables = {
|
||||||
|
EDITOR = "hx";
|
||||||
|
VISUAL = "hx";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
programs.helix = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
theme = "catppuccin_latte";
|
||||||
|
keys = let
|
||||||
|
common_keys = {
|
||||||
|
"C-s" = ":w";
|
||||||
|
"C-f" = ":format";
|
||||||
|
"C-r" = ":reflow";
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
normal = common_keys;
|
||||||
|
insert =
|
||||||
|
common_keys
|
||||||
|
// {
|
||||||
|
up = ["normal_mode" "move_line_up"];
|
||||||
|
down = ["normal_mode" "move_line_down"];
|
||||||
|
left = ["normal_mode" "move_char_left"];
|
||||||
|
right = ["normal_mode" "move_char_right"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
editor = {
|
||||||
|
whitespace.render = {
|
||||||
|
space = "all";
|
||||||
|
tab = "all";
|
||||||
|
};
|
||||||
|
lsp.display-messages = true;
|
||||||
|
indent-guides.render = true;
|
||||||
|
cursorline = true;
|
||||||
|
color-modes = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
languages = [
|
||||||
|
{
|
||||||
|
name = "haskell";
|
||||||
|
config.languageServerHaskell.formattingProvider = "fourmolu";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "nix";
|
||||||
|
formatter = {
|
||||||
|
command = "alejandra";
|
||||||
|
args = ["-q"];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
|
@ -3,7 +3,6 @@
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
list = builtins.attrValues;
|
|
||||||
cocSettings = {
|
cocSettings = {
|
||||||
"diagnostic.maxWindowHeight" = 60;
|
"diagnostic.maxWindowHeight" = 60;
|
||||||
"diagnostic.virtualText" = true;
|
"diagnostic.virtualText" = true;
|
||||||
|
@ -21,85 +20,14 @@
|
||||||
explorer.icon.enableNerdfont = true;
|
explorer.icon.enableNerdfont = true;
|
||||||
explorer.file.child.template = "[git | 2] [selection | clip | 1] [indent][icon | 1] [diagnosticError & 1][diagnosticWarning & 1][filename omitCenter 1][modified][readonly] [linkIcon & 1][link growRight 1 omitCenter 5][size]";
|
explorer.file.child.template = "[git | 2] [selection | clip | 1] [indent][icon | 1] [diagnosticError & 1][diagnosticWarning & 1][filename omitCenter 1][modified][readonly] [linkIcon & 1][link growRight 1 omitCenter 5][size]";
|
||||||
};
|
};
|
||||||
language-servers = {
|
|
||||||
inherit
|
|
||||||
(pkgs.nodePackages)
|
|
||||||
typescript-language-server
|
|
||||||
vscode-json-languageserver-bin
|
|
||||||
vscode-html-languageserver-bin
|
|
||||||
vscode-css-languageserver-bin
|
|
||||||
;
|
|
||||||
inherit (pkgs.python3Packages) python-lsp-server;
|
|
||||||
inherit
|
|
||||||
(pkgs)
|
|
||||||
rust-analyzer
|
|
||||||
taplo
|
|
||||||
# toml
|
|
||||||
|
|
||||||
nil
|
|
||||||
# nix
|
|
||||||
|
|
||||||
texlab
|
|
||||||
# latex
|
|
||||||
|
|
||||||
lean
|
|
||||||
yaml-language-server
|
|
||||||
;
|
|
||||||
};
|
|
||||||
in {
|
in {
|
||||||
imports = [./spelling.nix];
|
imports = [./spelling.nix];
|
||||||
programs.helix = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
theme = "catppuccin_latte";
|
|
||||||
keys = let
|
|
||||||
common_keys = {
|
|
||||||
"C-s" = ":w";
|
|
||||||
"C-f" = ":format";
|
|
||||||
"C-r" = ":reflow";
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
normal = common_keys;
|
|
||||||
insert =
|
|
||||||
common_keys
|
|
||||||
// {
|
|
||||||
up = ["normal_mode" "move_line_up"];
|
|
||||||
down = ["normal_mode" "move_line_down"];
|
|
||||||
left = ["normal_mode" "move_char_left"];
|
|
||||||
right = ["normal_mode" "move_char_right"];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
editor = {
|
|
||||||
whitespace.render = {
|
|
||||||
space = "all";
|
|
||||||
tab = "all";
|
|
||||||
};
|
|
||||||
lsp.display-messages = true;
|
|
||||||
indent-guides.render = true;
|
|
||||||
cursorline = true; # Not in released helix
|
|
||||||
color-modes = true; # Not in released helix
|
|
||||||
};
|
|
||||||
};
|
|
||||||
languages = [
|
|
||||||
{
|
|
||||||
name = "haskell";
|
|
||||||
config.languageServerHaskell.formattingProvider = "fourmolu";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "nix";
|
|
||||||
formatter = {
|
|
||||||
command = "alejandra";
|
|
||||||
args = ["-q"];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
programs.neovim = {
|
programs.neovim = {
|
||||||
enable = true;
|
enable = true;
|
||||||
vimAlias = true;
|
vimAlias = true;
|
||||||
vimdiffAlias = true;
|
vimdiffAlias = true;
|
||||||
extraConfig = builtins.readFile ./vimrc;
|
extraConfig = builtins.readFile ./vimrc;
|
||||||
plugins = list {
|
plugins = builtins.attrValues {
|
||||||
inherit
|
inherit
|
||||||
(pkgs.vimPlugins)
|
(pkgs.vimPlugins)
|
||||||
# coc-tabnine (TODO: Why doesn‘t it work?)
|
# coc-tabnine (TODO: Why doesn‘t it work?)
|
||||||
|
@ -190,11 +118,4 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
xdg.configFile."nvim/coc-settings.json".text = builtins.toJSON cocSettings;
|
xdg.configFile."nvim/coc-settings.json".text = builtins.toJSON cocSettings;
|
||||||
home = {
|
|
||||||
packages = [pkgs.languagetool] ++ builtins.attrValues language-servers;
|
|
||||||
sessionVariables = {
|
|
||||||
EDITOR = "nvim";
|
|
||||||
VISUAL = "nvim";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue