From e3c22cb86708b9a910a8bee48ee7da2ab4c732ab Mon Sep 17 00:00:00 2001 From: robin Date: Sat, 31 Jan 2026 09:46:35 +0000 Subject: [PATCH] MAC copy to ~/.zshrc --- zshrc.zshrc | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 zshrc.zshrc diff --git a/zshrc.zshrc b/zshrc.zshrc new file mode 100644 index 0000000..4027f48 --- /dev/null +++ b/zshrc.zshrc @@ -0,0 +1,81 @@ +alias pyviz='source ~/pyviz/bin/activate' + +export STM32_PRG_PATH=/Applications/STMicroelectronics/STM32Cube/STM32CubeProgrammer/STM32CubeProgrammer.app/Contents/MacOs/bin + +# ------------------------------------------------------------ +# Basic environment +# ------------------------------------------------------------ + +export EDITOR=vi +export PAGER=less +export LANG=en_GB.UTF-8 + +# ------------------------------------------------------------ +# History (zsh-native, better than bash) +# ------------------------------------------------------------ + +HISTFILE=~/.zsh_history +HISTSIZE=50000 +SAVEHIST=50000 + +setopt INC_APPEND_HISTORY +setopt SHARE_HISTORY +setopt HIST_IGNORE_ALL_DUPS +setopt HIST_REDUCE_BLANKS + +# ------------------------------------------------------------ +# Completion system +# ------------------------------------------------------------ + +autoload -Uz compinit +compinit + +# ------------------------------------------------------------ +# Git branch helper (explicit NO GIT REPO) +# ------------------------------------------------------------ + + + + + +# ------------------------------------------------------------ +# Aliases (bash-compatible) +# ------------------------------------------------------------ + +alias ll='ls -lh' +alias la='ls -A' +alias l='ls -CF' +alias gs='git status' +alias gd='git diff' + +# ------------------------------------------------------------ +# Path additions (example) +# ------------------------------------------------------------ + +export PATH="$HOME/bin:$PATH" + + +# ------------------------------------------------------------ +# Git branch helper (branch only, explicit NO GIT REPO) +# ------------------------------------------------------------ + +git_branch() { + if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then + git symbolic-ref --short HEAD 2>/dev/null || echo "DETACHED" + else + echo "NO GIT REPO" + fi +} + +# ------------------------------------------------------------ +# Prompt with colours +# ------------------------------------------------------------ + +setopt PROMPT_SUBST +setopt NO_NOMATCH + +# Colours: +# %F{colour} ... %f = foreground colour on/off + +PROMPT='%n@%F{208}%m%f %F{green}%~%f [%F{red}$(git_branch)%f] %# ' +