diff options
author | Franck Cuny <franck@fcuny.net> | 2022-03-02 19:39:35 -0800 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2022-03-02 19:39:35 -0800 |
commit | 06a7e0a09adf0b3603b7c6bc06d2a487570d8121 (patch) | |
tree | 291645c47082a0d7e9890caebb6372eec503b9b1 /users/fcuny/cli | |
parent | tahoe: enable wireguard (diff) | |
download | world-06a7e0a09adf0b3603b7c6bc06d2a487570d8121.tar.gz |
zsh: move the configuration inline
I don't have a lot of things I care about for zsh, I can inline everything.
Diffstat (limited to '')
-rw-r--r-- | users/fcuny/cli/zsh.nix | 34 |
1 files changed, 30 insertions, 4 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 + ''; }; } |