dotfiles/home/aliases

55 lines
1.2 KiB
Plaintext
Raw Normal View History

2021-11-28 07:15:06 -05:00
export PATH="$HOME/.local/bin:$HOME/.cargo/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 ../../../../../.."
2020-09-08 15:25:32 -04:00
# improved reset and clear
alias reset="tput reset"
alias clear="tput reset"
# better du
2021-11-27 08:28:43 -05:00
alias du="du -hd 1"
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-03-12 12:49:08 -05:00
# pipe yd-dlp to mpv
ytmpv() {
yt-dlp -q -o - "$1" | mpv -
}
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-02-06 12:48:48 -05:00
alias nvm="unalias nvm && [ -z $NVM_LOADED ] && export NVM_LOADED=1 && source /usr/share/nvm/init-nvm.sh ; nvm"
alias node="unalias node && [ -z $NVM_LOADED ] && export NVM_LOADED=1 && source /usr/share/nvm/init-nvm.sh ; node"