summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/zsh-user.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2015-12-15 18:46:25 +0100
committermakefu <github@syntax-fehler.de>2015-12-15 18:46:25 +0100
commit36b34fdebe5de5a705df78d5cf0221101bc3d610 (patch)
tree146b28d31c7890bd07237a266780e06b1d1bb59c /makefu/2configs/zsh-user.nix
parent55ad05879b8ba97e369bfd72810028dd4622e356 (diff)
parent3371d54618aa017be77e2494c1cf82331152f3b7 (diff)
Merge branch 'master' of gum.krebsco.de:stockholm
Diffstat (limited to 'makefu/2configs/zsh-user.nix')
-rw-r--r--makefu/2configs/zsh-user.nix32
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
+ '';
+ };
}