From 4af64edfc5c72f662b65897694e78d9eee661727 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 24 Oct 2020 18:55:08 +0200 Subject: Reformat zsh.nix --- user/settings/zsh.nix | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) (limited to 'user/settings') diff --git a/user/settings/zsh.nix b/user/settings/zsh.nix index 6e34a5a0..d7c8c0d4 100644 --- a/user/settings/zsh.nix +++ b/user/settings/zsh.nix @@ -30,12 +30,13 @@ in zsh-completions ]; - home.activation.linkOldZshHistory = config.lib.dag.entryAfter ["writeBoundary"] '' - if [[ ! -f ${config.home.sessionVariables.XDG_DATA_HOME}/zsh/history ]]; then - mkdir -p ${config.home.sessionVariables.XDG_DATA_HOME}/zsh/ - ln ~/.cache/zsh/history ${config.home.sessionVariables.XDG_DATA_HOME}/zsh/history - fi - ''; + home.activation.linkOldZshHistory = + config.lib.dag.entryAfter [ "writeBoundary" ] '' + if [[ ! -f ${config.home.sessionVariables.XDG_DATA_HOME}/zsh/history ]]; then + mkdir -p ${config.home.sessionVariables.XDG_DATA_HOME}/zsh/ + ln ~/.cache/zsh/history ${config.home.sessionVariables.XDG_DATA_HOME}/zsh/history + fi + ''; programs.zsh = { enable = true; @@ -135,13 +136,13 @@ in shellAliases = { l = "ls ${lsOptions} -Bp"; - l1="ls -1"; - ls="ls ${lsOptions} -hF"; - la="ls ${lsOptions} -hA"; - ll="ls ${lsOptions} ${lsIsoDate} -hl"; - lal="ll -A"; - lla="lal"; - llr="ll -t"; + l1 = "ls -1"; + ls = "ls ${lsOptions} -hF"; + la = "ls ${lsOptions} -hA"; + ll = "ls ${lsOptions} ${lsIsoDate} -hl"; + lal = "ll -A"; + lla = "lal"; + llr = "ll -t"; cg = "cd-gitroot"; cdg = "cd-gitroot"; @@ -149,8 +150,10 @@ in https = "http --default-scheme https"; history = "fc -l $(( $LINES - 2 ))"; - hist-freq-lines = "fc -l -10000 | cut -d' ' -f4- | sort | uniq -c | sort -g | tail -n100 | less"; - hist-freq-commands = "fc -l -10000 | cut -d' ' -f4 | sort | uniq -c | sort -g | tail -n10 | less"; + hist-freq-lines = + "fc -l -10000 | cut -d' ' -f4- | sort | uniq -c | sort -g | tail -n100 | less"; + hist-freq-commands = + "fc -l -10000 | cut -d' ' -f4 | sort | uniq -c | sort -g | tail -n10 | less"; wprop = "xprop | egrep '^WM_(CLASS|NAME|WINDOW_ROLE|TYPE)'"; # Enable the following commands to support aliases. @@ -214,7 +217,7 @@ in hop = "home-manager packages"; hol = "home-manager generations"; - nish = "nix-shell"; + nish = "nix-shell"; nic = "nix-channel"; nica = "nix-channel --add"; nicl = "nix-channel --list"; @@ -263,5 +266,6 @@ in '' + builtins.readFile ../zsh/zshrc; }; - home.file."${zshrc}".onChange = "${pkgs.zsh}/bin/zsh -i -c 'autoload -Uz compinit && compinit && zcompile ${zshrc}'"; + home.file."${zshrc}".onChange = + "${pkgs.zsh}/bin/zsh -i -c 'autoload -Uz compinit && compinit && zcompile ${zshrc}'"; } -- cgit 1.4.1