dotfiles/nix/home/programs/helix/default.nix
2023-11-03 11:07:59 -07:00

47 lines
1.1 KiB
Nix

{ pkgs, ... }:
{
programs.helix = {
enable = true;
languages = {
language-server.rnix-lsp = {
command = "${pkgs.rnix-lsp}/bin/rnix-lsp";
};
language = [
{
name = "nix";
auto-format = true;
language-servers = [
{ name = "rnix-lsp"; }
];
}
];
};
settings = {
theme = "catppuccin_mocha";
editor = {
line-number = "relative";
lsp.display-messages = true;
cursor-shape = {
insert = "underline";
normal = "block";
select = "block";
};
};
keys = {
normal = {
g = { a = "code_action"; }; # Maps `ga` to show possible code actions
"ret" = [ "move_line_down" "goto_first_nonwhitespace" ]; # Maps the enter key to move to start of next line
X = "extend_line_above";
D = "delete_char_backward";
";" = "command_mode";
"S-ret" = [ "move_line_up" "goto_first_nonwhitespace" ];
};
insert = {
j = { j = "normal_mode"; }; # Maps `jk` to exit insert mode
};
};
};
};
}