turns out its OK to have nonexistent paths in your PATH...

This commit is contained in:
Gabe Venberg 2024-02-23 12:58:00 -06:00
parent 1b0f26329b
commit 73f4b49613

View file

@ -27,13 +27,10 @@
export TIMEFMT="%J %*U user %*S system %P cpu %*E total" export TIMEFMT="%J %*U user %*S system %P cpu %*E total"
export PIPENV_VENV_IN_PROJECT=true export PIPENV_VENV_IN_PROJECT=true
export POETRY_VIRTUALENVS_IN_PROJECT=true export POETRY_VIRTUALENVS_IN_PROJECT=true
#test that these nonstandard paths exist before adding to PATH. #turns out its ok to have nonexistent paths in $PATH
testPath="$HOME/.local/bin" export PATH="$PATH:$HOME/.local/bin/"
[ -d "$testPath" ] && export PATH="$PATH:$testPath"
export PATH="$PATH:/opt"
testPath="$HOME/.cargo/bin"
[ -d "$testPath" ] && export PATH="$PATH:$testPath"
export PATH="$PATH:/opt" export PATH="$PATH:/opt"
export PATH="$PATH:$HOME/.cargo/bin"
#prompt #prompt
setprompt() { setprompt() {
@ -151,7 +148,6 @@ setprompt() {
#aliases #aliases
alias vim="nvim" alias vim="nvim"
alias vimdiff="nvim -d" alias vimdiff="nvim -d"
alias mutt="neomutt"
alias please='sudo $(fc -ln -1)' alias please='sudo $(fc -ln -1)'
alias la='ls -la' alias la='ls -la'
alias ll='ls -l' alias ll='ls -l'
@ -161,10 +157,11 @@ setprompt() {
# needs to have a number immediately after it. # needs to have a number immediately after it.
alias slideshow='feh --full-screen --randomize --auto-zoom --recursive --slideshow-delay' alias slideshow='feh --full-screen --randomize --auto-zoom --recursive --slideshow-delay'
# converts all .doc and .docx files in the local directory to pdfs using libreoffice # converts all .doc and .docx files in the local directory to pdfs using libreoffice
alias doc2pdf='loffice --convert-to pdf --headless *.docx#' alias doc2pdf='loffice --convert-to pdf --headless *.docx'
#common options for sshfs #common options for sshfs
alias sshmnt='sshfs -o idmap=user,compression=no,reconnect,follow_symlinks,dir_cache=yes,ServerAliveInterval=15' alias sshmnt='sshfs -o idmap=user,compression=no,reconnect,follow_symlinks,dir_cache=yes,ServerAliveInterval=15'
alias pyactivate='source ./.venv/bin/activate' alias pyactivate='source ./.venv/bin/activate'
tre() { command tre "$@" -e && source "/tmp/tre_aliases_$USER" 2>/dev/null; }
#setup grep to be a bit more nice #setup grep to be a bit more nice
local GREP_OPTIONS="" local GREP_OPTIONS=""
@ -178,11 +175,9 @@ setprompt() {
alias grep="grep $GREP_OPTIONS" alias grep="grep $GREP_OPTIONS"
#fzf stuff #fzf stuff
#zsh key bindings (different distros put these in different places.) testPath="/usr/share/fzf/key-bindings.zsh"
testPath=$(find /usr/share -path '*fzf/*key-bindings.zsh' -print -quit 2> /dev/null)
[ -f "$testPath" ] && source $testPath [ -f "$testPath" ] && source $testPath
#zsh completions, if it exists. testPath="/usr/share/fzf/completion.zsh"
testPath=$(find /usr/share -path '*fzf/*completion.zsh' -print -quit 2> /dev/null)
[ -f "$testPath" ] && source $testPath [ -f "$testPath" ] && source $testPath
#if it was installed using git, can just source the one file: #if it was installed using git, can just source the one file:
testPath="$HOME/.fzf.zsh" testPath="$HOME/.fzf.zsh"