From bf3f685e3b6fe4a78bdd9ff3a4a50c95a670dc7a Mon Sep 17 00:00:00 2001 From: Tobias Date: Tue, 19 Nov 2024 22:14:40 +0100 Subject: [PATCH] Moving files from old zsh-shell repo in here --- README.MD | 7 +++++++ zshrc | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 README.MD create mode 100644 zshrc diff --git a/README.MD b/README.MD new file mode 100644 index 0000000..985e8a0 --- /dev/null +++ b/README.MD @@ -0,0 +1,7 @@ +This is just a nice little zsh conf file with a homemade prompt + +To use this config, copy zshrc to ~/.zshrc and create ~/.zsh_history + +You need to have zsh, zsh-syntax-highlighting and git installed + +GLHF diff --git a/zshrc b/zshrc new file mode 100644 index 0000000..21c6c7b --- /dev/null +++ b/zshrc @@ -0,0 +1,34 @@ +HISTFILE="$HOME/.zsh_history" +HISTSIZE=10000000 +SAVEHIST=10000000 + +autoload -U compinit promptinit + +promptinit + +compinit +zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*' +fpath=(/usr/local/share/zsh-completions $fpath) + +function git_branch_name() +{ + branch=$(git symbolic-ref HEAD 2> /dev/null | awk 'BEGIN{FS="/"} {print $NF}') + if [[ $branch == "" ]]; + then + : + else + echo '('$branch')' + fi +} +# Enable substitution in the prompt. +setopt prompt_subst + +PROMPT='%F{051}%n%f %F{120}%~%f %F{050}$(git_branch_name)%f %F{120}=>%f ' + +bindkey "^[[1;5C" forward-word +bindkey "^[[1;5D" backward-word +bindkey '\e[1~' beginning-of-line +bindkey '\e[4~' end-of-line +bindkey '\e[3~' delete-char + +source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh