summary refs log tree commit diff stats
path: root/user
diff options
context:
space:
mode:
Diffstat (limited to 'user')
-rw-r--r--user/modules/zsh.nix33
-rw-r--r--user/zsh/.config/zsh/.zshrc49
2 files changed, 33 insertions, 49 deletions
diff --git a/user/modules/zsh.nix b/user/modules/zsh.nix
index adbcaad0..9544f86f 100644
--- a/user/modules/zsh.nix
+++ b/user/modules/zsh.nix
@@ -1,5 +1,10 @@
 { config, pkgs, ... }:
 
+let
+  inherit (pkgs) stdenv;
+  lsOptions = if stdenv.isDarwin then "-p" else "-v --group-directories-first";
+  lsIsoDate = if stdenv.isDarwin then "" else "--time-style=long-iso";
+in
 {
   home.file = {
     ".rm_recycle_home".text = ""; # use trash automatically in home directory
@@ -49,6 +54,34 @@
       ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=7";
     };
 
+    shellAliases = {
+      l = "ls ${lsOptions} -Bp";
+      l1="ls ${lsOptions} -1";
+      ls="ls ${lsOptions} -hF";
+      la="ls ${lsOptions} -hA";
+      ll="ls ${lsOptions} ${lsIsoDate} -hl";
+      lal="ll -A";
+      lla="lal";
+      llr="ll -t";
+
+      https = "http --default-scheme https";
+      kns = "kubens";
+      kx = "kubectx";
+      ava = "pnpx ava";
+      avt = "pnpx ava --tap";
+      avat = "pnpx ava --tap";
+      pino = "pino-pretty";
+      mocha = "pnpx mocha";
+      prettier = "pnpx prettier";
+      standard = "pnpx standard";
+      tsc = "pnpx tsc";
+      tslint = "pnpx tslint";
+      tsnode = "pnpx ts-node";
+      wprop = "xprop | egrep '^WM_(CLASS|NAME|WINDOW_ROLE|TYPE)'";
+
+      watch = "watch "; # enable watch with aliases
+    };
+
     # move to envExtra after 19.09
     initExtra = ''
       case $OSTYPE in
diff --git a/user/zsh/.config/zsh/.zshrc b/user/zsh/.config/zsh/.zshrc
index 1669cecf..698e58b1 100644
--- a/user/zsh/.config/zsh/.zshrc
+++ b/user/zsh/.config/zsh/.zshrc
@@ -6,49 +6,6 @@ setopt transient_rprompt
 
 WORDCHARS=${${WORDCHARS//[-.=]}//[\/]}
 
-gnu_ls_options="-v --group-directories-first"
-gnu_ls_isodate="--time-style=long-iso"
-bsd_ls_options="-p"
-bsd_ls_isodate="-D '%F %k:%M'"
-
-case $os in
-  darwin)
-    ls_options=$bsd_ls_options
-    ;;
-  freebsd)
-    ls_options=$bsd_ls_options
-    ls_isodate=$bsd_ls_isodate
-    ;;
-  linux)
-    ls_options=$gnu_ls_options
-    ls_isodate=$gnu_ls_isodate
-    ;;
-esac
-alias watch="watch " # enable watch with aliases
-alias l="ls ${ls_options} -Bp"
-alias l1="ls ${ls_options} -1"
-alias ls="ls ${ls_options} -hF"
-alias la="ls ${ls_options} -hA"
-alias ll="ls ${ls_options} ${ls_isodate} -hl"
-alias lal="ll -A"
-alias lla="lal"
-alias llr="ll -t"
-
-alias https="http --default-scheme https"
-alias kns="kubens"
-alias kx="kubectx"
-
-alias ava="pnpx ava"
-alias avt="pnpx ava --tap"
-alias avat="pnpx ava --tap"
-alias pino="pino-pretty"
-alias mocha="pnpx mocha"
-alias prettier="pnpx prettier"
-alias standard="pnpx standard"
-alias tsc="pnpx tsc"
-alias tslint="pnpx tslint"
-alias tsnode="pnpx ts-node"
-alias wprop="xprop | egrep '^WM_(CLASS|NAME|WINDOW_ROLE|TYPE)'"
 zmodload zsh/terminfo
 
 bindkey '\e[3~' delete-char
@@ -159,14 +116,8 @@ then
   compdef _helm helm
 fi
 
-
 # General configuration
 
-if [[ -n $commands[gpg2] && -z $commands[gpg] ]]
-then
-  alias gpg=gpg2
-fi
-
 if [[ -n $commands[lunchy] ]]
 then
   LUNCHY_DIR=$(dirname $(gem which lunchy))/../extras