dotfiles/home/aliases

87 lines
2.0 KiB
Plaintext
Raw Normal View History

2022-11-18 03:42:17 -05:00
export PATH="$HOME/.local/bin:$HOME/.cargo/bin:$HOME/.config/composer/vendor/bin:$PATH"
2022-01-18 19:11:06 -05:00
export EDITOR="/usr/local/bin/nvim"
2021-08-22 15:23:16 -04:00
2021-11-27 08:28:43 -05:00
# vim
2021-08-22 15:23:16 -04:00
alias vim="nvim"
2020-09-08 21:03:57 -04:00
2021-11-27 08:28:43 -05:00
# ls
2020-09-08 15:25:32 -04:00
alias ls="ls --color=auto"
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
2021-11-27 08:28:43 -05:00
alias ......="cd ../../../../.."
alias .......="cd ../../../../../.."
2022-11-18 03:42:17 -05:00
alias ........="cd ../../../../../../.."
alias .........="cd ../../../../../../../.."
alias ..........="cd ../../../../../../../../.."
alias ...........="cd ../../../../../../../../../.."
alias ............="cd ../../../../../../../../../../.."
alias .............="cd ../../../../../../../../../../../.."
alias ..............="cd ../../../../../../../../../../../../.."
alias ...............="cd ../../../../../../../../../../../../../.."
alias ................="cd ../../../../../../../../../../../../../../.."
2020-09-08 15:25:32 -04:00
# improved reset and clear
alias reset="tput reset"
alias clear="tput reset"
# better du
2022-11-18 03:42:17 -05:00
alias du="du -ha"
2021-08-05 16:37:38 -04:00
2021-11-27 08:28:43 -05:00
# better feh
2021-01-08 12:34:14 -05:00
alias feh="feh -."
2021-08-20 13:41:01 -04:00
2021-11-27 08:28:43 -05:00
# vi keybindings
2021-08-20 13:41:01 -04:00
alias info="info --vi-keys"
2021-11-27 08:28:43 -05:00
alias less="less -R"
alias sl="ls"
2021-11-28 07:15:06 -05:00
alias la="ls -a"
2022-01-23 09:30:51 -05:00
alias venv="source venv/bin/activate"
2021-11-28 07:15:06 -05:00
2022-01-23 09:30:51 -05:00
# search functions
alias grepa="grep -I -n --color=always -r --exclude-dir=venv --exclude-dir=node_modules"
2021-12-14 11:53:50 -05:00
2022-04-10 14:45:04 -04:00
# cat
alias cat="batcat -p --paging=never"
2022-03-12 12:49:08 -05:00
# pipe yd-dlp to mpv
ytmpv() {
yt-dlp -q -o - "$1" | mpv -
}
2022-06-26 09:41:37 -04:00
# timeking config
alias newsboat="timeking '11:00-24:00' && newsboat"
2021-12-14 11:53:50 -05:00
goto() {
2022-01-23 09:30:51 -05:00
open="$(grepa "$@" | fzf --ansi -1)"
2021-12-14 11:53:50 -05:00
if [ ! -z "$open" ]; then
file="$(echo "$open" | cut -d: -f1 -)"
line="$(echo "$open" | cut -d: -f2 -)"
2022-01-17 17:30:15 -05:00
vim "$file" -c "cd %:p:h" -c "normal! $line"gg
2021-12-14 11:53:50 -05:00
fi
2021-11-27 08:28:43 -05:00
}
2022-01-23 09:30:51 -05:00
# NVM - Dynamic loading trick
2022-06-26 09:41:10 -04:00
alias nvm="load_nvm; nvm"
alias node="load_nvm; node"
alias npm="load_nvm; npm"
alias npx="load_nvm; npx"
alias create-react-app="load_nvm; create-react-app"
export NVM_DIR="$HOME/.nvm"
load_nvm() {
if [ -z $NVM_LOADED ]; then
export NVM_LOADED=1
unalias nvm
unalias node
unalias npm
unalias npx
unalias create-react-app
. "$NVM_DIR/nvm.sh"
. "$NVM_DIR/bash_completion"
fi
}