Apply some recommendations from git dx book
This commit is contained in:
parent
82e3fa9114
commit
911dd07d1e
9 changed files with 114 additions and 37 deletions
29
home/dot_shell_aliases
Normal file
29
home/dot_shell_aliases
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
if [ -x /usr/bin/dircolors ]; then
|
||||
alias ls='ls --color=auto'
|
||||
alias dir='dir --color=auto'
|
||||
alias vdir='vdir --color=auto'
|
||||
alias grep='grep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
fi
|
||||
|
||||
function la {
|
||||
ls_out=$(\ls -lah --color=always "$@")
|
||||
let "allowed_lines = $(tput lines) - 3"
|
||||
if [ $(echo "$ls_out" | wc -l) -le $allowed_lines ]; then
|
||||
echo "$ls_out"
|
||||
else
|
||||
echo "$ls_out" | less -r
|
||||
fi
|
||||
}
|
||||
|
||||
function search() {
|
||||
quoted=$(python -c "import urllib.parse, sys; print(urllib.parse.quote_plus(' '.join(sys.argv[1:])))" "${@}")
|
||||
w3m "https://duckduckgo.com/?q=${quoted}"
|
||||
}
|
||||
|
||||
alias black='black --line-length 99'
|
||||
|
||||
alias cdtmp='cd $(mktemp -d)'
|
||||
|
||||
alias g='git'
|
||||
Loading…
Add table
Add a link
Reference in a new issue