dotfiles/home/aliases

58 lines
918 B
Plaintext

export PATH="$HOME/.local/bin:$HOME/.cargo/bin:$PATH"
export EDITOR="/usr/bin/nvim"
# vim
alias vim="nvim"
# ls
alias ls="ls --color=auto"
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ......="cd ../../../../.."
alias .......="cd ../../../../../.."
# improved reset and clear
alias reset="tput reset"
alias clear="tput reset"
# better du
alias du="du -hd 1"
# better feh
alias feh="feh -."
# vi keybindings
alias info="info --vi-keys"
# grepa
alias grepa="grep -I -n --color=always -r --exclude-dir=venv"
# less
alias less="less -R"
# find
alias find="find -name"
# sl
alias sl="ls"
#la
alias la="ls -a"
search() {
grepa "$@" . | sed -nE '/^.{,200}$/p'
}
goto() {
open="$(search "$@" | fzf --ansi)"
if [ ! -z "$open" ]; then
file="$(echo "$open" | cut -d: -f1 -)"
line="$(echo "$open" | cut -d: -f2 -)"
vim "$file" -c "normal! $line"gg
fi
}