Options

PROMPT='%~ %F{yellow}%f '
export EDITOR='/opt/homebrew/bin/nvim'
export OPENER='/usr/bin/open'

setopt autocd
setopt correct
setopt correctall

Aliases

alias vim='nvim'
alias less='bat'
alias mutt='neomutt'
alias publish='$HOME/Dropbox/org/publish.sh'

History

setopt extended_history       # record timestamp of command in HISTFILE
setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE
setopt hist_ignore_dups       # ignore duplicated commands history list
setopt hist_ignore_space      # ignore commands that start with space
setopt hist_verify            # show command with history expansion to user before running it
setopt share_history          # share command history data

functions

Blog Publish

function publish() {
   $HOME/Dropbox/org/publish.sh
}

restart window manager and key-daemon

for mac

function restart_screen {
    if [[ $(uname) == 'Darwin' ]]; then
        brew services restart yabai > /dev/null
        brew services restart sketchybar > /dev/null
        echo "restarted yabai and sketchybar"
    fi
}

Competions & Suggestions

brew install zsh-autosuggestions
# zsh completions
if type brew &>/dev/null
then
  FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"

  autoload -Uz compinit
  compinit
fi

source $(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh

LF’CD’

’cd’ to that directory when you exit when using ’lf’ (terminal file manager)

lfcd () {
    tmp="$(mktemp)"
    lf -last-dir-path="$tmp" "$@"
    if [ -f "$tmp" ]; then
        dir="$(cat "$tmp")"
        rm -f "$tmp"
        if [ -d "$dir" ]; then
            if [ "$dir" != "$(pwd)" ]; then
                cd "$dir"
            fi
        fi
    fi
}

alias lf='lfcd'

others

# Node Version Manager
export NVM_DIR="$HOME/.nvm"
  [ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh"  # This loads nvm
  [ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm"  # This loads nvm bash_completion

# fzf
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

# brew install zoxide
eval "$(zoxide init zsh)"
alias cd='z'

# brew install bottom
alias htop='btm'

# brew install exa
alias ls='exa -l --group-directories-first --no-user --git -s mod -r'

google cloud

Google Cloud Compute

# The next line updates PATH for the Google Cloud SDK.
if [ -f '$HOME/google-cloud-sdk/path.zsh.inc' ]; then . '$HOME/google-cloud-sdk/path.zsh.inc'; fi

# The next line enables shell command completion for gcloud.
if [ -f '$HOME/google-cloud-sdk/completion.zsh.inc' ]; then . '$HOME/google-cloud-sdk/completion.zsh.inc'; fi

Date: 2022-08-05 Fri 17:11