diff options
| author | LMBishop <13875753+LMBishop@users.noreply.github.com> | 2021-12-14 12:29:08 +0000 |
|---|---|---|
| committer | LMBishop <13875753+LMBishop@users.noreply.github.com> | 2021-12-14 12:29:08 +0000 |
| commit | 4178710763ab0b05e690b26be6b8cefd0c86a1c2 (patch) | |
| tree | 7ebcaba296a253cdde73b04a65bdaf95651ccb9a /zsh | |
Initial commit
Diffstat (limited to 'zsh')
| -rw-r--r-- | zsh/.zprofile | 6 | ||||
| -rw-r--r-- | zsh/.zshrc | 54 |
2 files changed, 60 insertions, 0 deletions
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" |
