about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--users/fcuny/cli/zsh.nix34
-rw-r--r--users/fcuny/configs/zsh/init.zsh27
2 files changed, 30 insertions, 31 deletions
diff --git a/users/fcuny/cli/zsh.nix b/users/fcuny/cli/zsh.nix
index 3358e50..a27a3c1 100644
--- a/users/fcuny/cli/zsh.nix
+++ b/users/fcuny/cli/zsh.nix
@@ -2,8 +2,6 @@
 
 {
 
-  xdg.configFile."zsh/personal".source = config.lib.file.mkOutOfStoreSymlink ../configs/zsh;
-
   programs.zsh = {
     enable = true;
     enableAutosuggestions = true;
@@ -14,10 +12,38 @@
       extended = true;
       ignoreDups = true;
     };
-    initExtra = ''
-      source ${config.xdg.configHome}/zsh/personal/init.zsh
+
+    initExtraFirst = ''
       # Activate home-manager environment, if not already enabled
       [ -d "$HOME/.nix-profile" ] || /nix/var/nix/profiles/per-user/$USER/home-manager/activate &> /dev/null
     '';
+
+    initExtra = ''
+      # 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
+
+      autoload -U colors && colors
+
+      autoload -Uz vcs_info add-zsh-hook
+      setopt prompt_subst
+
+      add-zsh-hook precmd vcs_info
+
+      # Enable checking for (un)staged changes, enabling use of %u and %c
+      zstyle ':vcs_info:*' check-for-changes true
+
+      PROMPT='%K{cyan}%F{black}%m%k%f %~%F{red}$vcs_info_msg_0_%f %# '
+
+      # man zshall /forward-word /backward-word - word splitting as with bash
+      WORDCHARS='*?_-.[]~=&;!#$%^(){}<>'
+
+      # For tramp (emacs).
+      if [ "$TERM" = "dumb" ]; then
+        unset PROMPT
+        PS1='$ '
+        unsetopt zle
+      fi
+    '';
   };
 }
diff --git a/users/fcuny/configs/zsh/init.zsh b/users/fcuny/configs/zsh/init.zsh
deleted file mode 100644
index 1dba48e..0000000
--- a/users/fcuny/configs/zsh/init.zsh
+++ /dev/null
@@ -1,27 +0,0 @@
-# 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
-
-autoload -U colors && colors
-
-autoload -Uz vcs_info add-zsh-hook
-setopt prompt_subst
-
-add-zsh-hook precmd vcs_info
-# Enable checking for (un)staged changes, enabling use of %u and %c
-zstyle ':vcs_info:*' check-for-changes true
-# Set custom strings for an unstaged vcs repo changes (*) and staged changes (+)
-zstyle ':vcs_info:*' unstagedstr "%F{yellow}●%f"
-zstyle ':vcs_info:*' stagedstr   "%F{green}●%f"
-# Set the format of the Git information for vcs_info
-zstyle ':vcs_info:git:*' formats       " (%b%c%u)"
-zstyle ':vcs_info:git:*' actionformats " (%b|%a%u%c)"
-
-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