From 09e2e500ce835564dea5f5b0e74de7977d964757 Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Thu, 8 Oct 2015 14:31:40 +0200 Subject: [PATCH] Split zsh config --- zsh/.zsh/00-base.sh | 4 +++ zsh/.zsh/01-completion.zsh | 5 ++++ zsh/.zsh/02-prompt.zsh | 4 +++ zsh/.zsh/03-aliases.zsh | 4 +++ zsh/.zsh/10-base.zsh | 50 -------------------------------------- zsh/.zsh/10-helpers.zsh | 4 +++ 6 files changed, 21 insertions(+), 50 deletions(-) create mode 100644 zsh/.zsh/00-base.sh create mode 100644 zsh/.zsh/01-completion.zsh create mode 100644 zsh/.zsh/02-prompt.zsh create mode 100644 zsh/.zsh/03-aliases.zsh delete mode 100644 zsh/.zsh/10-base.zsh create mode 100644 zsh/.zsh/10-helpers.zsh diff --git a/zsh/.zsh/00-base.sh b/zsh/.zsh/00-base.sh new file mode 100644 index 0000000..1b36459 --- /dev/null +++ b/zsh/.zsh/00-base.sh @@ -0,0 +1,4 @@ +# Lines configured by zsh-newuser-install +bindkey -e + +export EDITOR="vim" diff --git a/zsh/.zsh/01-completion.zsh b/zsh/.zsh/01-completion.zsh new file mode 100644 index 0000000..2467430 --- /dev/null +++ b/zsh/.zsh/01-completion.zsh @@ -0,0 +1,5 @@ +zstyle :compinstall filename '/home/madmaurice/.zshrc' +zstyle ':completion:*' menu select + +autoload -Uz compinit +compinit diff --git a/zsh/.zsh/02-prompt.zsh b/zsh/.zsh/02-prompt.zsh new file mode 100644 index 0000000..dd3535d --- /dev/null +++ b/zsh/.zsh/02-prompt.zsh @@ -0,0 +1,4 @@ +autoload -U colors && colors + +PROMPT="%{$fg[red]%}%n%{$fg[yellow]%}@%{$fg[green]%}%M%{$fg[yellow]%} > %{$reset_color%}" +RPROMPT="%{$fg[yellow]%}%~%{$reset_color%}" diff --git a/zsh/.zsh/03-aliases.zsh b/zsh/.zsh/03-aliases.zsh new file mode 100644 index 0000000..e855d89 --- /dev/null +++ b/zsh/.zsh/03-aliases.zsh @@ -0,0 +1,4 @@ +alias ls="ls --color=auto" +alias ll="ls -l" +alias la="ls -la" +alias emacs="vim" diff --git a/zsh/.zsh/10-base.zsh b/zsh/.zsh/10-base.zsh deleted file mode 100644 index 9080979..0000000 --- a/zsh/.zsh/10-base.zsh +++ /dev/null @@ -1,50 +0,0 @@ -# Lines configured by zsh-newuser-install -bindkey -e -# End of lines configured by zsh-newuser-install -# The following lines were added by compinstall -zstyle :compinstall filename '/home/madmaurice/.zshrc' -zstyle ':completion:*' menu select - -autoload -Uz compinit -compinit - -autoload -U colors && colors - -PROMPT="%{$fg[red]%}> %{$reset_color%}" -RPROMPT="%{$fg[red]%}%~%{$reset_color%}" - -alias ls="ls --color=auto" -alias cd..="cd .." -alias ..="cd .." -alias disks="df -h" -alias space="du -shx" -alias emacs="vim" -alias gitlog="git log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" -alias sf="screenfetch" - -catwhich() { - cat $(which $@) -} - -runfor() { - while read line; do - $@ $line - done -} - -mkpasswd() { - LEN=${1:-30} - base64 < /dev/urandom | fold -w $LEN | sed 1q -} - -mkpasswd2() { - LEN=${1:-30} - tr -cd ' -~' < /dev/urandom | fold -w $LEN | sed 1q -} - -export EDITOR="vim" - -# Load any local only zshrc -[ -f "$HOME/.zshrc.local" ] && source "$HOME/.zshrc.local" - -# End of lines added by compinstall diff --git a/zsh/.zsh/10-helpers.zsh b/zsh/.zsh/10-helpers.zsh new file mode 100644 index 0000000..06630bb --- /dev/null +++ b/zsh/.zsh/10-helpers.zsh @@ -0,0 +1,4 @@ +mkpasswd() { + LEN=${1:-30} + tr -cd ' -~' < /dev/urandom | fold -w $LEN | sed 1q +}