very important zsh things
This commit is contained in:
parent
0c51473d17
commit
f7d89ec656
22
.zshrc
22
.zshrc
|
@ -48,9 +48,17 @@ alias home="cd $HOME"
|
|||
alias ff=firefox
|
||||
alias bell="tput bel"
|
||||
alias fd=fdfind
|
||||
alias nobak="touch .nobackup"
|
||||
# alias shutdown="confirm shutdown"
|
||||
|
||||
### Functions
|
||||
function random() {
|
||||
if [ $# -ne 1 ] || ! [[ $1 =~ ^[0-9]+$ ]] || [ $1 -lt 1 ]; then
|
||||
echo "Error: Please provide one positive integer argument" >&2
|
||||
return 1
|
||||
fi
|
||||
echo $(( (RANDOM % $1) + 1 ))
|
||||
}
|
||||
function largefiles () { exec 2>/dev/null; du -ah "$@" | grep -P "^\d+(G|T|P|E)\s" }
|
||||
function midfiles () { exec 2>/dev/null; du -ah "$@" | grep -P "^\d+(M|G|T|P|E)\s" }
|
||||
function smallfiles () { exec 2>/dev/null; du -ah "$@" | grep -P "^\d+(B|K)\s" }
|
||||
|
@ -271,13 +279,6 @@ else
|
|||
eval "$(zoxide init zsh)"
|
||||
fi
|
||||
|
||||
### load unversioned zsh code
|
||||
if [ -f ~/.zsh.local ]; then
|
||||
source ~/.zsh.local
|
||||
else
|
||||
touch ~/.zsh.local
|
||||
fi
|
||||
|
||||
### --- pyenv Config -------------------------------------
|
||||
export PYENV_ROOT="$HOME/.pyenv"
|
||||
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
|
||||
|
@ -302,3 +303,10 @@ function load_nvm() {
|
|||
}
|
||||
alias nvim="load_nvm && nvim"
|
||||
# zprof
|
||||
|
||||
### load unversioned zsh code
|
||||
if [ -f ~/.zsh.local ]; then
|
||||
source ~/.zsh.local
|
||||
else
|
||||
touch ~/.zsh.local
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue