.zsh/aliases.sh

120 lines
3.8 KiB
Bash
Raw Normal View History

2012-05-18 13:09:58 +04:00
#!/bin/zsh
# vim: set filetype=zsh
# list dir operations
alias ls='ls --classify --color --human-readable --group-directories-first'
alias la='ls -a'
alias ll='ls -l'
alias l='ll'
alias lh='ls -h'
alias lla='ls -la'
alias llh='ls -lh'
alias llah='ls -lah'
alias llha='llah'
2013-04-10 12:33:09 +04:00
alias fls="fls -rd"
2012-05-18 13:09:58 +04:00
# file operations
2012-08-01 17:12:00 +04:00
alias cp='nocorrect cp --verbose --preserve=all'
2012-05-18 13:09:58 +04:00
alias mv='nocorrect mv --verbose'
alias rm='nocorrect rm -v'
alias ln='ln -vi'
alias chmod='chmod -v'
alias chown='chown -v'
alias chgrp='chgrp -v'
alias mkdir='mkdir -v'
alias rmdir='rmdir -v'
# fs statistics
alias df='df -hT'
alias dfm='df -mT'
2012-06-06 14:53:12 +04:00
alias fs='du -shcx (|.)* | sort -h'
2012-05-18 13:09:58 +04:00
alias du='du --human-readable --total'
# process operations
alias nohup='nohup > /dev/null $1'
2013-04-10 12:33:09 +04:00
alias k='killall'
2012-05-18 13:09:58 +04:00
which sudo &>/dev/null && alias sk='sudo killall'
# autofixing
alias cd..='cd ..'
alias cd~='cd ~'
alias cd-='cd -'
2013-04-10 12:33:09 +04:00
2012-05-18 13:09:58 +04:00
alias grep='grep --color=always'
which grc &>/dev/null && {
alias grc='grc --colour=auto'
alias ping='grc ping'
alias last='grc last'
alias netstat='grc netstat'
alias traceroute='grc traceroute'
alias make='grc make'
alias gcc='grc gcc'
alias configure='grc ./configure'
alias configure='grc configure'
alias netstat='grc netstat'
alias ping='grc ping'
alias cat="grc cat"
alias tail="grc tail"
2013-04-10 12:33:09 +04:00
alias head="grc head"
2012-05-18 13:09:58 +04:00
}
alias killall="killall --interactive --verbose"
2013-03-26 17:40:26 +04:00
alias free="free -t -h"
2012-05-18 13:09:58 +04:00
which git &>/dev/null && alias git="nocorrect git"
which hg &>/dev/null && alias hg="nocorrect hg"
which scrot &>/dev/null && alias scrot="scrot --border --count --quality 75 $HOME'/screenshots/%d-%b-%y_%H-%M-%S_\$wx\$h.png' --exec 'du -h \$f'"
which sudo &>/dev/null && alias su='sudo su -'
which hd &>/dev/null && alias hd='hexdump -C'
2013-04-10 12:33:09 +04:00
2013-04-01 15:39:04 +04:00
which sudo &>/dev/null && alias krnlconfig="sudo make MENUCONFIG_MODE=single_menu MENUCONFIG_COLOR=mono menuconfig"
2012-05-18 13:09:58 +04:00
which valgrind &>/dev/null && alias valgrind='valgrind --tool=callgrind'
2013-04-01 15:39:04 +04:00
which cgdb &>/dev/null && alias cgdb='LANG=ru_RU.koi8-r cgdb'
2012-05-18 13:09:58 +04:00
which rsync &>/dev/null && alias cpb='rsync --progress -h' \
&& alias cpbs='rsync --progress -h -rax --delete-excluded'
which alsamixer &>/dev/null && alias alsamixer='alsamixer -g' && alias equilizer='alsamixer -D equal'
[ -x /usr/libexec/mc/mc-wrapper.sh ] && alias mc='. /usr/libexec/mc/mc-wrapper.sh -x'
which network.sh &>/dev/null && alias net='network.sh'
which colordiff &>/dev/null && alias diff='colordiff'
alias make="make -j$((`getconf _NPROCESSORS_ONLN`+1))"
which colormake &>/dev/null && alias make="colormake -j$((`getconf _NPROCESSORS_ONLN`+1))"
2012-05-18 13:09:58 +04:00
which colorgcc &>/dev/null && {
2013-04-10 12:33:09 +04:00
alias c++='/usr/lib/colorgcc/bin/c++'
alias cc='/usr/lib/colorgcc/bin/cc'
alias g++='/usr/lib/colorgcc/bin/g++'
alias gcc='/usr/lib/colorgcc/bin/gcc'
2012-05-18 13:09:58 +04:00
}
which astyle &>/dev/null && {
alias astyle-glib='astyle --style=gnu --indent=spaces=2 --max-instatement-indent=80 \
--indent-preprocessor --indent-col1-comments --break-blocks=all \
--pad-oper --pad-header --break-closing-brackets --add-brackets'
}
2012-05-27 15:21:34 +04:00
which network-profile.sh &>/dev/null && alias net=network-profile.sh
2013-02-26 11:17:51 +04:00
which iconv &>/dev/null && alias cp1251toUTF8='iconv -f cp1251 -t utf8'
2013-04-10 12:33:09 +04:00
which vim &>/dev/null && {
alias vim='TERM=xterm-256color vim'
alias svim='sudo TERM=xterm-256color vim'
alias v='vim'
alias sv='svim'
alias vimdiff='TERM=xterm-256color vimdiff'
alias svimdiff='sudo TERM=xterm-256color vimdiff'
alias vdiff='vimdiff'
alias svdiff='svimdiff'
alias vd='vdiff'
alias svd='svdiff'
}
2013-04-01 15:43:37 +04:00
which eix &>/dev/null && alias eix='TERM=screen eix'
2013-04-10 12:33:09 +04:00
which mc &>/dev/null && {
alias mc='TERM=xterm-256color mc'
alias smc='sudo TERM=xterm-256color mc'
alias m='mc'
alias sm='smc'
}
which git &>/dev/null && alias git='TERM=xterm-256color git'