aboutsummaryrefslogtreecommitdiff
path: root/users/fcuny/configs/zsh
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-02-12 13:27:37 -0800
committerFranck Cuny <franck@fcuny.net>2022-02-12 13:27:37 -0800
commit931ebdbff2d489acba6898ffbc5b022e4706ba82 (patch)
tree2fa49741448d091029554bae535b7b0651465e88 /users/fcuny/configs/zsh
parenthome-manager: re-organize configuration for myself (diff)
downloadinfra-931ebdbff2d489acba6898ffbc5b022e4706ba82.tar.gz
configs: move personal configuration with user
Diffstat (limited to 'users/fcuny/configs/zsh')
-rw-r--r--users/fcuny/configs/zsh/init.zsh27
1 files changed, 27 insertions, 0 deletions
diff --git a/users/fcuny/configs/zsh/init.zsh b/users/fcuny/configs/zsh/init.zsh
new file mode 100644
index 0000000..1dba48e
--- /dev/null
+++ b/users/fcuny/configs/zsh/init.zsh
@@ -0,0 +1,27 @@
+# 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