Adds comments and new aliases to zshrc

This commit is contained in:
2024-03-24 16:56:04 -04:00
parent 19285a539d
commit a2558e0296

View File

@@ -32,6 +32,7 @@ export LESSHISTFILE="-"
#------------------------------ path ------------------------------ #------------------------------ path ------------------------------
# Helper function to prepend to the $PATH
path_prepend() { path_prepend() {
declare arg declare arg
for arg in "$@"; do for arg in "$@"; do
@@ -43,6 +44,7 @@ path_prepend() {
done done
} && export path_prepend } && export path_prepend
# Helper function to prepend to the $FPATH
fpath_prepend() { fpath_prepend() {
declare arg declare arg
for arg in "$@"; do for arg in "$@"; do
@@ -54,7 +56,7 @@ fpath_prepend() {
done done
} && export fpath_prepend } && export fpath_prepend
# last arg will be first in path # last arg will be first in $PATH
path_prepend \ path_prepend \
"/usr/local/bin" \ "/usr/local/bin" \
"/opt/homebrew/bin" \ "/opt/homebrew/bin" \
@@ -64,6 +66,7 @@ path_prepend \
"$HOME/.local/bin" \ "$HOME/.local/bin" \
"$SCRIPTS" "$SCRIPTS"
# last arg will be first in $FPATH
fpath_prepend \ fpath_prepend \
"$(brew --prefix)/share/zsh/site-functions" \ "$(brew --prefix)/share/zsh/site-functions" \
"$(brew --prefix)/share/zsh-completions" \ "$(brew --prefix)/share/zsh-completions" \
@@ -91,6 +94,8 @@ export HISTFILE=$ZDOTDIR/history
#------------------------------ cdpath ------------------------------ #------------------------------ cdpath ------------------------------
setopt autocd setopt autocd
# NOTE: This may be overriden in local env overrides (typically located in $XDG_DATA_HOME/zsh/env.zsh
export CDPATH=".:$GHREPOS:$GHREPOS/ansible:$REPOS/github.com:$DOTFILES:$LOCAL_REPOS:$HOME" export CDPATH=".:$GHREPOS:$GHREPOS/ansible:$REPOS/github.com:$DOTFILES:$LOCAL_REPOS:$HOME"
#------------------------------ options ------------------------------ #------------------------------ options ------------------------------
@@ -136,36 +141,37 @@ prompt pure
#------------------------------ aliases ------------------------------ #------------------------------ aliases ------------------------------
alias bk='cd "${OLDPWD}"' alias bk='cd "${OLDPWD}"' # change to last directory
alias cl='printf "\e[H\e[2J"' alias cl='printf "\e[H\e[2J"' # clear the terminal
alias clear='printf "\e[H\e[2J"' alias clear='printf "\e[H\e[2J"' # clear the terminal
alias czets='cd "${ZETDIR}"' alias czets='cd "${ZETDIR}"' # move into zettlekasten notes
alias dv='dirs -v' alias dv='dirs -v' # list directory info
alias g='git' alias g='git' # access git commands quickly
alias ga='git add' alias ga='git add' # add files to git quickly
alias gcb='git checkout -b' alias gcb='git checkout -b' # checkout a new git branch, creating if needed.
alias gco='git checkout' alias gco='git checkout' # checkout an already existing git branch
alias gcm='git commit -a -m' alias gcm='git commit -a -m' # commit files to git quickly
alias gen='just --justfile "$ANSIBLE_GEN_DIR/justfile"' alias gen='just --justfile "$ANSIBLE_GEN_DIR/justfile"' # generate template files / directories
alias gp='git push' alias gp='git push' # push repo to git
alias gs='git status' alias gs='git status' # git status quickly
alias hn='hugo new' alias hn='hugo new' # generate a hugo site
alias hnc='hugo new content' alias hnc='hugo new content' # generate new hugo site content quickly
alias l='ls -lah --color=auto' alias l='ls -lahH --color=auto' # better ls command.
alias reload='exec zsh -l' alias lfs='ls -lahH --color=auto "$ZDOTDIR/functions"' # List functions.
alias t='tmux' alias reload='exec zsh -l' # reload the shell, useful when making changes.
alias ts='~/.local/scripts/tmux-sessionator' alias t='tmux' # access tmux quickly
alias tss='~/.local/scripts/tmux-sessionator --choose' alias ts='~/.local/scripts/tmux-sessionator' # create new tmux session, fuzzy finding common locations.
alias tls='tmux list-sessions' alias tss='~/.local/scripts/tmux-sessionator --choose' # attach to an existing tmux session.
alias temp='cd $(mktemp -d)' alias tls='tmux list-sessions' # list tmux sessions
alias vi='nvim' alias temp='cd $(mktemp -d)' # create a temporary directory and move into it.
alias newxf='~/.local/scripts/newx --function' alias vi='nvim' # set vi to open neovim
alias nlnv='nvim "$LOCAL_ENV"' alias newf='"$SCRIPS"/newx --function' # generate a new shell function
alias nvim='unset VIMINIT && unset MYVIMRC && nvim' alias nlnv='nvim "$LOCAL_ENV"' # open local environment overrides file in neovime
alias nvim-mhoush='NVIM_APPNAME=m-housh && nvim' alias nvim='unset VIMINIT && unset MYVIMRC && nvim' # alias nvim to unset vimrc, useful when using both vim & neovim
alias nvim-kickstart='NVIM_APPNAME=kickstart nvim' alias nvim-mhoush='NVIM_APPNAME=m-housh && nvim' # set neovim to use my config.
alias nvim-lazy='NVIM_APPNAME=lazy nvim' alias nvim-kickstart='NVIM_APPNAME=kickstart nvim' # set neovim to use kickstart config.
alias wget="wget --hsts-file=$XDG_DATA_HOME/wget-hsts" alias nvim-lazy='NVIM_APPNAME=lazy nvim' # set neovim to use lazy config.
alias wget="wget --hsts-file=$XDG_DATA_HOME/wget-hsts" # set wget history location.
#------------------------------ local configs ------------------------------ #------------------------------ local configs ------------------------------
# TODO: The .zshrc-local is a legacy location and should be removed once my machines are # TODO: The .zshrc-local is a legacy location and should be removed once my machines are