diff options
author | makefu <makefu@nixos.dev> | 2015-12-15 15:33:34 +0100 |
---|---|---|
committer | makefu <makefu@nixos.dev> | 2015-12-15 15:51:07 +0100 |
commit | d4792eb7231acf5bf66409adb4e777433998678b (patch) | |
tree | 8e711c8f270a174d271188841fdcfcfc3465a93d /makefu/2configs/zsh-user.nix | |
parent | b5eafa4c03e9f7059e30ec137c5b0bbe6e47e3a7 (diff) |
prepare zshrc, makes ~/.zshrc obsolete
Diffstat (limited to 'makefu/2configs/zsh-user.nix')
-rw-r--r-- | makefu/2configs/zsh-user.nix | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/makefu/2configs/zsh-user.nix b/makefu/2configs/zsh-user.nix index 3089b706a..266ce256a 100644 --- a/makefu/2configs/zsh-user.nix +++ b/makefu/2configs/zsh-user.nix @@ -5,6 +5,36 @@ let mainUser = config.krebs.build.user.name; in { - programs.zsh.enable = true; users.extraUsers.${mainUser}.shell = "/run/current-system/sw/bin/zsh"; + programs.zsh= { + enable = true; + interactiveShellInit = '' + HISTSIZE=900001 + HISTFILESIZE=$HISTSIZE + SAVEHIST=$HISTSIZE + + setopt HIST_IGNORE_ALL_DUPS + setopt HIST_IGNORE_SPACE + setopt HIST_FIND_NO_DUPS + bindkey -e + # shift-tab + bindkey '^[[Z' reverse-menu-complete + + autoload -U compinit && compinit + zstyle ':completion:*' menu select + ''; + + promptInit = '' + RPROMPT="" + autoload colors && colors + case $UID in + 0) PROMPT="%{$fg[red]%}%~%{$reset_color%} " ;; + 9001) PROMPT="%{$fg[green]%}%~%{$reset_color%} " ;; + *) PROMPT="%{$fg[yellow]%}%n %{$fg[green]%}%~%{$reset_color%} " ;; + esac + if test -n "$SSH_CLIENT"; then + PROMPT="%{$fg[magenta]%}%m $PROMPT" + fi + ''; + }; } |