Improve aliases

This commit is contained in:
Augusto Gunsch 2022-01-23 11:30:51 -03:00
parent 8b5ee9eec1
commit 4bc49c6f07
No known key found for this signature in database
GPG Key ID: F7EEFE29825C72DC
1 changed files with 10 additions and 18 deletions

View File

@ -26,28 +26,17 @@ alias feh="feh -."
# vi keybindings # vi keybindings
alias info="info --vi-keys" alias info="info --vi-keys"
alias less="less -R"
alias find="find -name"
alias sl="ls"
alias la="ls -a"
alias venv="source venv/bin/activate"
# grepa # search functions
alias grepa="grep -I -n --color=always -r --exclude-dir=venv --exclude-dir=node_modules" alias grepa="grep -I -n --color=always -r --exclude-dir=venv --exclude-dir=node_modules"
# less
alias less="less -R"
# find
alias find="find -name"
# sl
alias sl="ls"
#la
alias la="ls -a"
search() {
grepa "$@" .
}
goto() { goto() {
open="$(search "$@" | fzf --ansi -1)" open="$(grepa "$@" | fzf --ansi -1)"
if [ ! -z "$open" ]; then if [ ! -z "$open" ]; then
file="$(echo "$open" | cut -d: -f1 -)" file="$(echo "$open" | cut -d: -f1 -)"
line="$(echo "$open" | cut -d: -f2 -)" line="$(echo "$open" | cut -d: -f2 -)"
@ -55,3 +44,6 @@ goto() {
vim "$file" -c "cd %:p:h" -c "normal! $line"gg vim "$file" -c "cd %:p:h" -c "normal! $line"gg
fi fi
} }
# NVM - Dynamic loading trick
alias nvm="unalias nvm && source /usr/share/nvm/init-nvm.sh && nvm"