lets try helix

This commit is contained in:
Daniel Lovbrotte Olsen 2022-06-05 15:46:48 +02:00
parent b8d6d45b1c
commit 279b8d54f6
3 changed files with 45 additions and 2 deletions

View File

@ -2,6 +2,22 @@
let
cfg = config.profiles.base;
helixDesktop = pkgs.makeDesktopItem {
name = "Helix";
type = "Application";
desktopName = "Helix";
genericName = "Text Editor";
comment = "Edit text files";
tryExec = "hx";
exec = "kitty hx %F";
terminal = false; # Until you can globally set a prefered terminal we hardcoding this
mimeTypes = [ "ext/english" "text/plain" "text/x-makefile" "text/x-c++hdr" "text/x-c++src" "text/x-chdr" "text/x-csrc" "text/x-java" "text/x-moc" "text/x-pascal" "text/x-tcl" "text/x-tex" "application/x-shellscript" "text/x-c" "text/x-c++" ];
categories = [ "Utility" "TextEditor" ];
keywords = [ "Text" "editor" ];
startupNotify = false;
};
in {
options.machine = {
@ -23,13 +39,15 @@ in {
};
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
nix-output-monitor
nix-top
nix-index
unstable.comma
rnix-lsp
helixDesktop
ldns
mtr
@ -117,6 +135,24 @@ in {
programs.obs-studio.enable = (config.profiles.gui.enable && cfg.plus);
programs.helix = {
enable = true;
package = pkgs.unstable.helix;
settings = {
editor.line-number = "relative";
editor.mouse = false;
keys.normal = {
# Empty keys: Ø, æ, Æ, å, Å, *,
"ø" = "collapse_selection"; # For ;
"minus" = "search"; # For /
"_" = "rsearch"; # for =
"plus" = "trim_selections"; # for _
"å"."d" = "goto_prev_diag"; # for [d
"¨"."d" = "goto_next_diag";
};
};
};
programs.git = {
enable = true;
userEmail = "daniel.olsen99@gmail.com";
@ -173,12 +209,16 @@ in {
enableSshSupport = true;
};
home.sessionVariables = {
EDITOR = "hx";
};
xdg.mimeApps = {
enable = true;
defaultApplications = {
"image/png" = [ "sxiv.desktop" "gimp.desktop" ];
"image/jpeg" = [ "sxiv.desktop" ];
"text/plain" = [ "gedit.desktop" "kakoune.desktop" "code.desktop" ];
"text/plain" = [ "Helix.desktop" "gedit.desktop" "code.desktop" ];
"video/x-matroska" = [ "mpv.desktop" ];
};
associations.removed = {

View File

@ -18,6 +18,7 @@ in
home.keyboard = {
layout = "no";
variant = "nodeadkeys";
};
services.random-background = {

View File

@ -37,6 +37,8 @@ in
gne = "git n";
gds = "git diff --staged";
glg = "git log --oneline";
nano = "hx"; # Behavioral training
};
initExtra = ''
source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme