This commit is contained in:
Joe Lillibridge 2024-10-29 17:03:47 -05:00
parent a9fc82a83c
commit 860848da23
No known key found for this signature in database
2 changed files with 80 additions and 51 deletions

56
.gitignore vendored
View File

@ -1 +1,55 @@
.vscode/extensions *.sock
*.swp
.1password
.anyconnect
.awesomecache
.bash_history
.cache
.CFUserTextEncoding
.cisco
.colima
.config/gtk-2.0/
.config/zsh/plugins
.docker/
.DS_Store
.gitignore_global
.gk/repoMapping.json
.gnupg
.gnupg_*
.lesshst
.local/bin/
.local/share
.node_repl_history
.npm
.nvm
.rest-client
.sonarlint
.ssh
.tldrc
.Trash
.vault-token
.viminfo
.vscode
.wget-hsts
.yarn
.yarnrc
.zcompcache
.zcompdump
.zsh_history
.zsh_sessions
awesomecache
Desktop
Development
Documents
Downloads
Library
Movies
Music
node_modules
OneDrive\ \-\ Target\ Corporation
package.json
Pictures
Public
src
tmp
yarn.lock

75
.zshrc
View File

@ -1,71 +1,47 @@
system_type=$(uname -s) system_type=$(uname -s)
# shell options # shell options
setopt auto_cd setopt auto_cd append_history share_history histignorealldups
setopt append_history share_history histignorealldups
# aliases # aliases
alias ls="ls -F" get_ls_command() {
alias top10="print -l -- ${(o)history%% *} | uniq -c | sort -nr | head -n 10" command -v lsd &>/dev/null
if [ $? -eq 0 ]; then
echo "lsd"
else
echo "ls"
fi
}
alias ls="$(get_ls_command) -F"
# git aliases
alias g=git
alias gi=git
# Homebrew aliases # Homebrew aliases
alias b="brew"
alias bv="brew-visit" # points to the function below because I'm complicated alias bv="brew-visit" # points to the function below because I'm complicated
alias bi="brew info" alias bi="brew info"
alias bs="brew search" alias bs="brew search"
# YADM aliases
alias y="yadm"
alias ys="yadm status"
# These depend on some installed packages, so just to be safe # These depend on some installed packages, so just to be safe
[[ "$(command -v bat)" ]] && alias cat="bat" [[ "$(command -v bat)" ]] && alias cat="bat"
[[ "$(command -v htop)" ]] && alias top="htop" [[ "$(command -v htop)" ]] && alias top="htop"
# environment variables # environment variables
export PATH="$PATH:${HOME}/.local/bin"
export CLICOLOR=1 export CLICOLOR=1
# export ZSH_HIGHLIGHT_HIGHLIGHTERS_DIR=/opt/homebrew/share/zsh-syntax-highlighting/highlighters # export ZSH_HIGHLIGHT_HIGHLIGHTERS_DIR=/opt/homebrew/share/zsh-syntax-highlighting/highlighters
# Functions # Load functions
fpath=("$HOME/.functions" "${fpath[@]}")
autoload -Uz ql f brew-visit tre compinit && compinit
fd() { [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh && source <(fzf --zsh)
# DESC: I forget
# ARGS: $1 (optional):
# REQS: ???
# USAGE: fd [path]
local dir
dir=$(find ${1:-.} -path '*/\.*' -prune \
-o -type d -print 2> /dev/null | fzf +m) &&
cd "$dir"
}
f() {
# DESC: Opens the Finder to specified directory. (Default is current oath)
# ARGS: $1 (optional): Path to open in finder
# REQS: MacOS
# USAGE: f [path]
open -a "Finder" "${1:-.}"
}
ql() {
# DESC: Opens files in MacOS Quicklook
# ARGS: $1 (optional): File to open in Quicklook
# REQS: MacOS
# USAGE: ql [file1] [file2]
qlmanage -p "${*}" &>/dev/null
}
brew-visit() {
# DESC: Open a Homebrew formula's web page
# ARGS: $1: Homebrew formula name
# REQS: MacOS
# USAGE: brew-visit [url]
open -a Safari `brew info "${1}" | grep ^http | head -1`
}
# See https://github.com/dduan/tre/blob/main/README.md
tre() { command tre "$@" -e && source "/tmp/tre_aliases_$USER" 2>/dev/null; }
autoload -Uz compinit
compinit
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
source <(fzf --zsh)
[ -f ~/.config/op/plugins.sh ] && source ~/.config/op/plugins.sh [ -f ~/.config/op/plugins.sh ] && source ~/.config/op/plugins.sh
[ -f /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ] && source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh [ -f /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ] && source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
[ -f /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh ] && source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh [ -f /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh ] && source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh
@ -73,8 +49,7 @@ source <(fzf --zsh)
[ -f /opt/homebrew/share/liquidprompt ] && source /opt/homebrew/share/liquidprompt [ -f /opt/homebrew/share/liquidprompt ] && source /opt/homebrew/share/liquidprompt
[ -e "${HOME}/.iterm2_shell_integration.zsh" ] && source "${HOME}/.iterm2_shell_integration.zsh" [ -e "${HOME}/.iterm2_shell_integration.zsh" ] && source "${HOME}/.iterm2_shell_integration.zsh"
if it2check if it2check; then
then
iterm2_print_user_vars() { iterm2_print_user_vars() {
it2git it2git
} }