feat: Adding a new function to print out the path variable in a newline delimited list, new aliases for quick actions and cleanup of zshrc for future changes

This commit is contained in:
2026-03-29 16:21:11 -05:00
parent 64868c6672
commit 4dd3c3eed6
3 changed files with 75 additions and 35 deletions

View File

@@ -7,3 +7,5 @@ alias k="killall" # Quick killall
alias p="ps aux | grep $1" # Quick alias p="ps aux | grep $1" # Quick
alias n="$EDITOR" # Just open the usual editor alias n="$EDITOR" # Just open the usual editor
alias todo="nvim ~/.zettelkasten/TODO.md" alias todo="nvim ~/.zettelkasten/TODO.md"
alias repos="cd ~/repos/"
alias dot="cd ~/repos/dotfiles"

View File

@@ -16,3 +16,16 @@ function rmv() {
rsync -avzhP --remove-source-files --ignore-existing "${@:1:$#-1}" "${@:$#}" && \ rsync -avzhP --remove-source-files --ignore-existing "${@:1:$#-1}" "${@:$#}" && \
find ./* -depth -type d -empty -exec rmdir "{}" \; find ./* -depth -type d -empty -exec rmdir "{}" \;
} }
function new_note() {
nvim
}
function path() {
set -f
array=(${${PATH}//:/\\n})
for element in "${array[@]}"
do
echo $element
done
}

View File

@@ -1,21 +1,38 @@
# call `zprof` to profile all calls in the current shell # call `zprof` to profile all calls in the current shell
# Uncomment here and at the bottom of the file, then fully reopen a terminal # Uncomment here and at the bottom of the file, then fully reopen a terminal
# zmodload zsh/zprof zmodload zsh/zprof
# Path additions
path=(
$GOPATH/bin
$HOME/.cargo/bin
$HOME/.local/bin
$NVM_CONFIG_PREFIX/bin
$path
)
typeset -U path
if type brew; then
source $(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh
else
source /usr/share/zsh/site-functions/zsh-autosuggestions.zsh
fi
# Install oh-my-zsh if it doesn't exist # Install oh-my-zsh if it doesn't exist
if [ ! -d $HOME/.oh-my-zsh/ ] # if [ ! -d $HOME/.oh-my-zsh/ ]
then # then
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" # sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
fi # fi
### ZSH Configuration ### ZSH Configuration
## Path variables ## Path variables
# Path to your oh-my-zsh installation. # Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh" # export ZSH="$HOME/.oh-my-zsh"
export MANPAGER="less -R --use-color -Dd+r -Du+b" # Colored MAN pages export MANPAGER="less -R --use-color -Dd+r -Du+b" # Colored MAN pages
ZSH_THEME="fb-custom" # ZSH_THEME="fb-custom"
# Uncomment the following line to use hyphen-insensitive completion. # Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable. # Case-sensitive completion must be off. _ and - will be interchangeable.
@@ -24,29 +41,40 @@ DISABLE_AUTO_UPDATE="true"
### Plugins ### Plugins
# Install the zsh-autosuggestions plugin if it doesn't exist # Install the zsh-autosuggestions plugin if it doesn't exist
if [ ! -d ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions ] # if [ ! -d ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions ]
then # then
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions # git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# fi
# plugins=(
# zsh-autosuggestions
# virtualenvwrapper # Used for autoloading project .venvs
# )
# ZSH autosuggestions
if type brew &>/dev/null; then
fi fi
plugins=( autoload -Uz compinit
fzf compinit -u
zsh-autosuggestions
virtualenvwrapper # Used for autoloading project .venvs
)
# Load Oh My ZSH # FZF load
source $ZSH/oh-my-zsh.sh source <(fzf --zsh)
# Vim mode setup
set -o vi
# ZSH options # ZSH options
setopt NO_clobber # Do not clobber files by default setopt no_clobber # Do not clobber files by default
setopt hist_ignore_all_dups # Replace old history with the newest call to an identical call setopt hist_ignore_all_dups # Replace old history with the newest call to an identical call
setopt hist_ignore_space # Remove history lines that start with spaces setopt hist_ignore_space # Remove history lines that start with spaces
setopt share_history # Share history between zsh instances without needing explicit sharing
setopt auto_param_slash # Auto append a slash instead of a space if the completion is a dir
# Experimental # Experimental
setopt append_history inc_append_history share_history setopt append_history inc_append_history
setopt auto_param_slash
setopt no_case_glob no_case_match setopt no_case_glob no_case_match
setopt extended_glob null_glob
# Completion options # Completion options
# Give descriptions of what the types of completions given # Give descriptions of what the types of completions given
@@ -58,22 +86,18 @@ zstyle ':completion:*:warnings' format '%BNo matches for: %d%b'
export EDITOR=nvim export EDITOR=nvim
export NVM_CONFIG_PREFIX=$HOME/.local/ export NVM_CONFIG_PREFIX=$HOME/.local/
# Paths to prepend to system path
path=(
$GOPATH/bin
$HOME/.cargo/bin
$HOME/.local/bin
$NVM_CONFIG_PREFIX/bin
$path
)
# Autoload keychain for ssh-agent handling if it is installed # Autoload keychain for ssh-agent handling if it is installed
if command -v keychain &> /dev/null # if command -v keychain &> /dev/null
then # then
eval $(keychain --eval --quiet --nogui --noask) # eval $(keychain --eval --quiet --nogui --noask)
fi # fi
### Environment specific include files # TODO: Replace above with GPG agent
# GPG Agent handling of ssh key authorization and unlocks
# Inclusion of files to extend the configuration
# From a theme to local specific changes, and grouping functions/aliases/exports
include_files=( include_files=(
"$HOME/.config/zsh/fb_theme.zsh" "$HOME/.config/zsh/fb_theme.zsh"
"$HOME/.config/zsh/zsh_local.zsh" "$HOME/.config/zsh/zsh_local.zsh"
@@ -91,5 +115,6 @@ for file in $include_files; do
source $file source $file
done done
# Call to zprof for startup timings # Call to zprof for startup timings
# zprof zprof