Skip to content

Commit

Permalink
minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
sammcj committed Sep 3, 2023
1 parent 98f6838 commit 5b92a28
Show file tree
Hide file tree
Showing 12 changed files with 357 additions and 834 deletions.
23 changes: 10 additions & 13 deletions 0-paths.rc
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
# shellcheck disable=SC2148 disable=SC1090 shell=bash

export PATH="/usr/local/bin:$PATH"
export PATH="/opt/homebrew/bin:$PATH"
export PATH="/opt/homebrew/sbin:$PATH"
export PATH="/opt/homebrew/opt/gnu-getopt/bin:$PATH"
export PATH="/usr/local/bin:${PATH}"
export PATH="/opt/homebrew/bin:${PATH}"
export PATH="/opt/homebrew/sbin:${PATH}"
export PATH="/opt/homebrew/opt/gnu-getopt/bin:${PATH}"

export PATH="$PATH:$HOME/Library/Mobile\ Documents/com\~apple\~CloudDocs/Dropbox\ Import/bin"
export PATH="$PATH:$HOME/git/scripts"
export PATH="$PATH:$HOME/.local/bin"
export PATH="${PATH}:${HOME}/Library/Mobile\ Documents/com\~apple\~CloudDocs/Dropbox\ Import/bin"
export PATH="${PATH}:${HOME}/git/scripts"
export PATH="${PATH}:${HOME}/.local/bin:${HOME}/bin"

# Golang
export PATH="$PATH:$HOME/go/bin"
export PATH="${PATH}:${HOME}/go/bin"

# added by Miniconda3 installer
export PATH="/Users/samm/miniconda3/bin:$PATH"

# override conda with python 3.10 as it doesn't support it ?
# export PATH="/opt/homebrew/opt/python@3.10/libexec/bin:$PATH"
export PATH="/Users/samm/miniconda3/bin:${PATH}"

### Kubernetes / k8s related exports ###

# Krew Kubernetes plugin manager
# export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
# export PATH="${KREW_ROOT:-$HOME/.krew}/bin:${PATH}"

#source $HOME/.helm/helmenv.sh
4 changes: 2 additions & 2 deletions 1-zgen.rc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ if ! zgen saved; then
MichaelAquilina/zsh-you-should-us
lukechilds/zsh-better-npm-completion
3v1n0/zsh-bash-completions-fallback
devndive/zsh-saml2aws-auto
mrkmg/borgbackup-zsh-completion

# git related
Expand All @@ -46,10 +45,11 @@ if ! zgen saved; then
# fzf wrappers
sunlei/zsh-ssh
torifat/npms
bigH/git-fuzzy
EOPLUGINS

## zsh completion generator ##
zgen load RobSis/zsh-completion-generator
# zgen load RobSis/zsh-completion-generator # Disabled for now as was the cause of 25% of my load time

## Not in use at present ##
# nnao45/zsh-kubectl-completion
Expand Down
11 changes: 9 additions & 2 deletions 10-prompt.rc
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@ function collapse_pwd {
echo "$(pwd | sed -e "s,^$HOME,~,")"
}

PROMPT='%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}$(collapse_pwd)%{$reset_color%}$(git_prompt_info) '
__PROMPT_USER="%{$fg[magenta]%}%n%{$reset_color%}"
__PROMPT_HOST="%{$fg[yellow]%}%m%{$reset_color%}"
__PROMPT_DIR="%{$fg_bold[green]%}$(collapse_pwd)%{$reset_color%}"
__PROMPT_GIT="$(git_prompt_info)"
# __PROMPT_KUBE="$(kube_ps1)"

ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}"
# PROMPT="${__PROMPT_USER}@${__PROMPT_HOST}:${__PROMPT_DIR}${__PROMPT_GIT} "
PROMPT='%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}:%{$fg_bold[green]%}$(collapse_pwd)%{$reset_color%}$(git_prompt_info) '

ZSH_THEME_GIT_PROMPT_PREFIX="@%{$fg[magenta]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?"
Expand Down
11 changes: 8 additions & 3 deletions 14-source-files.rc
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
# Note: If this doesn't work, make sure you've cleaned up nvm directories and related PATHs
eval "$(/opt/homebrew/bin/fnm env --use-on-cd)"

# Thefuck
# eval "$(thefuck --alias)"

#saml2aws
eval "$(saml2aws --completion-script-zsh)"

Expand All @@ -17,3 +14,11 @@ eval "$(saml2aws --completion-script-zsh)"
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"

# # pnpm
# export PNPM_HOME="/Users/samm/Library/pnpm"
# case ":$PATH:" in
# *":$PNPM_HOME:"*) ;;
# *) export PATH="$PNPM_HOME:$PATH" ;;
# esac
# pnpm end
21 changes: 2 additions & 19 deletions 4-aliases.rc
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,6 @@ alias zshconfig="code ${THIS_DIRECTORY}"
#shellcheck disable=SC2139
alias zshconfigd="cd ${THIS_DIRECTORY}"

# Packages #TODO: Convert this to a function
alias ba="brew update &&
brew upgrade --greedy;
brew upgrade --cask --greedy;
__update_chromium;
pip install -U pip;
pip3 install -U pip;
zgen selfupdate;
zgen update;
vim +PluginUpdate +qall;
npm i -g npm-check-updates;
\ncu --global;
mas upgrade;
gup update;
omz update;
brew cleanup;
brew autoremove"
alias app_store_upgrade_mmas="mas upgrade"
alias go_update_all="gup update"
alias pa="pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U"
Expand All @@ -40,11 +23,11 @@ alias pa="pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip i
alias brew86="arch -x86_64 /usr/local/homebrew/bin/brew"

#shellcheck disable=SC2139
alias brewbackup="brew bundle dump --force --file=${THIS_DIRECTORY}/Brewfile-${HOST}"
alias brewbackup="brew bundle dump --force --file=""${THIS_DIRECTORY}""/Brewfile-""${HOST}"""

# Git
# alias gbd="git branch -d" Moved to functions
#alias gitrb='for branch in `git branch -r --merged | grep -v HEAD`; do echo -e `git show --format="%ci %cr %an" $branch | head -n 1` \\t$branch; done | sort -r'
#alias gitrb='for branch in $(git branch -r --merged | grep -v HEAD); do echo -e $(git show --format="%ci %cr %an" "$branch" | head -n 1) \\t$branch; done | sort -r'
alias amend="git commit --amend --no-edit"
alias bfg="java -jar ~/bin/bfg.jar"
alias ch="commit-hotfix"
Expand Down
31 changes: 26 additions & 5 deletions 5-exports.rc
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
# shellcheck disable=SC2148 disable=SC1090 shell=bash

### Exports ###

# export HOMEBREW_NO_ANALYTICS=1 # Allowing Analytics now as homebrew have reduced how much data they collect, it's a non-profit and it's not going to the USA
export DO_NOT_TRACK=1
export SAM_CLI_TELEMETRY=0 # AWS SAM
export TELEMETRY=0 ENABLE_TELEMETRY=0 SEND_TELEMETRY=0 # General catch-all
export SAM_CLI_TELEMETRY=0 # AWS SAM
export TELEMETRY=0 ENABLE_TELEMETRY=0 SEND_TELEMETRY=0 DO_NOT_TRACK=1 ANALYTICS=0 DISABLE_ANALYTICS=1 NO_ANALYTICS=1 # General catch-all
export GREP_OPTIONS="--color"
# export LSCOLORS="ExFxCxDxBxegedabagacad"
export LS_COLORS="$(vivid generate dracula)"
Expand All @@ -31,3 +28,27 @@ export FZF_COMPLETION_OPTS='--border --info=inline'
# we can't use BASH_SOURCE[0] because it's not available in zsh
DOTFILES_DIR="$(cd "$(dirname "$0")" && pwd)"
export DOTFILES_DIR

# # Global package manager caches to save on disk space
# export PIP_DOWNLOAD_CACHE="${HOME}/Library/Caches/pip"
# export NPM_CONFIG_CACHE="${HOME}/.npm"

## Text formatting shortcuts ##
export _FMT_ITL="\e[3m"
export _FMT_BLD="\e[1m"
export _FMT_RED="\e[31m"
export _FMT_GRN="\e[32m"
export _FMT_YLW="\e[33m"
export _FMT_BLU="\e[34m"
export _FMT_MAG="\e[35m"
export _FMT_CYN="\e[36m"
export _FMT_WHT="\e[37m"
export _FMT_BRED="\e[1;31m"
export _FMT_BGRN="\e[1;32m"
export _FMT_BYLW="\e[1;33m"
export _FMT_BBLU="\e[1;34m"
export _FMT_BMAG="\e[1;35m"
export _FMT_BCYN="\e[1;36m"
export _FMT_BWHT="\e[1;37m"
export _FMT_END="\e[0m" # end of line stop formatting
##
3 changes: 3 additions & 0 deletions 7-history.rc
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ setopt EXTENDED_HISTORY
setopt HIST_SAVE_NO_DUPS
setopt HIST_EXPIRE_DUPS_FIRST
setopt HIST_FIND_NO_DUPS

# When outputting history, print it out with timestamps and command only
alias history="history -i"
Loading

0 comments on commit 5b92a28

Please sign in to comment.