about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--configs/zsh/init.zsh12
-rw-r--r--users/fcuny/common.nix1
-rw-r--r--users/zsh.nix21
3 files changed, 34 insertions, 0 deletions
diff --git a/configs/zsh/init.zsh b/configs/zsh/init.zsh
new file mode 100644
index 0000000..2f791d7
--- /dev/null
+++ b/configs/zsh/init.zsh
@@ -0,0 +1,12 @@
+# Print timing statistics for everything which takes longer than 5 seconds of
+# user + system time ('sleep 6' does not work because of 0% user/system time!).
+REPORTTIME=5
+
+PROMPT='%K{cyan}%F{black}%m%k%f %~%F{red}${vcs_info_msg_0_}%f %# '
+
+# For tramp (emacs).
+if [ "$TERM" = "dumb" ]; then
+  unset PROMPT
+  PS1='$ '
+  unsetopt zle
+fi
diff --git a/users/fcuny/common.nix b/users/fcuny/common.nix
index 4c81bae..b4d405b 100644
--- a/users/fcuny/common.nix
+++ b/users/fcuny/common.nix
@@ -17,5 +17,6 @@
     ./git.nix
     ./go.nix
     ./tmux.nix
+    ./zsh.nix
   ];
 }
diff --git a/users/zsh.nix b/users/zsh.nix
new file mode 100644
index 0000000..be827b4
--- /dev/null
+++ b/users/zsh.nix
@@ -0,0 +1,21 @@
+{config, lib, pkgs, ...}:
+
+{
+
+  xdg.configFile."zsh/personal".source = config.lib.file.mkOutOfStoreSymlink ../configs/zsh;
+
+  programs.zsh = {
+    enable = true;
+    enableAutosuggestions = true;
+    enableCompletion = true;
+    defaultKeymap = "emacs";
+    history = {
+      save = 100000;
+      extended = true;
+      ignoreDups = true;
+    };
+    initExtra = ''
+      source ${config.xdg.configHome}/zsh/personal/init.zsh
+    '';
+  };
+}