From 4178710763ab0b05e690b26be6b8cefd0c86a1c2 Mon Sep 17 00:00:00 2001 From: LMBishop <13875753+LMBishop@users.noreply.github.com> Date: Tue, 14 Dec 2021 12:29:08 +0000 Subject: Initial commit --- zsh/.zprofile | 6 ++++++ zsh/.zshrc | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 zsh/.zprofile create mode 100644 zsh/.zshrc (limited to 'zsh') diff --git a/zsh/.zprofile b/zsh/.zprofile new file mode 100644 index 0000000..95d30b4 --- /dev/null +++ b/zsh/.zprofile @@ -0,0 +1,6 @@ +eval "$(/opt/homebrew/bin/brew shellenv)" + +# Setting PATH for Python 3.9 +# The original version is saved in .zprofile.pysave +PATH="/Library/Frameworks/Python.framework/Versions/3.9/bin:${PATH}" +export PATH diff --git a/zsh/.zshrc b/zsh/.zshrc new file mode 100644 index 0000000..48d1304 --- /dev/null +++ b/zsh/.zshrc @@ -0,0 +1,54 @@ +export ZSH="/Users/leonardo/.oh-my-zsh" + +DEFAULT_USER="leonardo" + +autoload -Uz vcs_info + +directory() { + echo "%{$fg_bold[magenta]%}%~%{$reset_color%}" +} + +current_time() { + echo "%{$fg[white]%}[%*]" +} + +return_status() { + local LAST_EXIT_CODE=$? + if [[ $LAST_EXIT_CODE -ne 0 ]]; then + local EXIT_CODE_PROMPT=' ' + EXIT_CODE_PROMPT+="%{$fg_bold[red]%}$LAST_EXIT_CODE%{$reset_color%}" + echo "$EXIT_CODE_PROMPT " + fi +} + +precmd() { + vcs_info + VCS_STATUS="" + if [[ -n ${vcs_info_msg_0_} ]]; then + STATUS=$(command git status --porcelain 2> /dev/null | tail -n1) + if [[ -n $STATUS ]]; then + VCS_STATUS="(%F{yellow}${vcs_info_msg_0_}%f) " + else + VCS_STATUS="(%F{green}${vcs_info_msg_0_}%f) " + fi + fi + PROMPT='%B$(directory)%b %# ' + RPROMPT='$(return_status)${VCS_STATUS}$(current_time)' +} + +zstyle ':vcs_info:*' check-for-changes true +zstyle ':vcs_info:git*' formats "%b%u%c" +zstyle ':vcs_info:git*' actionformats "%b|%a%u%c" +zstyle ':vcs_info:*' unstagedstr ' *' +zstyle ':vcs_info:*' stagedstr ' +' + +setopt prompt_subst + +plugins=(git zsh-autosuggestions) + +source $ZSH/oh-my-zsh.sh + +export PATH="/opt/homebrew/opt/python@3.10/bin:$PATH" +alias vim="nvim" +alias vi="nvim" +alias vimdiff="nvim -d" -- cgit v1.2.3-70-g09d2