|
@@ -1,52 +1,91 @@
|
|
|
-
|
|
|
+#
|
|
|
# Editor
|
|
|
--exe emacs \
|
|
|
- && export EDITOR="emacs -nw"
|
|
|
-alias e=$EDITOR
|
|
|
-
|
|
|
-# common aliases
|
|
|
-alias rm="rm -i"
|
|
|
-alias mv="mv -i"
|
|
|
-alias cp="cp -i"
|
|
|
-alias vlock="clear; vlock"
|
|
|
-alias df="df -h"
|
|
|
-alias rsu="sudo zsh"
|
|
|
-alias reload="exec zsh"
|
|
|
-alias grep="grep --color=tty"
|
|
|
+#
|
|
|
+if -exe emacs; then
|
|
|
+ export EDITOR='emacs -nw'
|
|
|
+fi
|
|
|
|
|
|
-alias slog="tail -n 60 -f /var/log/syslog"
|
|
|
-alias mlog="tail -n 60 -f /var/log/mail.log"
|
|
|
+if [ -n "$EDITOR" -a -n "$SUDO_USER" -a "$UID" = 0 -a "$EDITOR[1,5]" = 'emacs' ]; then
|
|
|
+ e="$EDITOR -u $SUDO_USER"
|
|
|
+else
|
|
|
+ alias e=$EDITOR
|
|
|
+fi
|
|
|
|
|
|
-# using colortail if available (freebsd)
|
|
|
--exe colortail \
|
|
|
- && alias slog="colortail -n 60 -k /usr/local/share/examples/colortail/conf.messages -f /var/log/syslog"
|
|
|
+#
|
|
|
+# Pager
|
|
|
+#
|
|
|
+if -exe most; then
|
|
|
+ export PAGER=most
|
|
|
+ alias less='most'
|
|
|
+ alias more='most'
|
|
|
+elif -exe less; then
|
|
|
+ export PAGER=less
|
|
|
+elif -exe more; then
|
|
|
+ export PAGER=more
|
|
|
+fi
|
|
|
|
|
|
-[ -n "$EDITOR" -a -n "$SUDO_USER" -a $UID = 0 -a $EDITOR[1,5] = "emacs" ] \
|
|
|
- && alias e="$EDITOR -u $SUDO_USER"
|
|
|
+#
|
|
|
+# Common aliases
|
|
|
+#
|
|
|
+alias rm='rm -i'
|
|
|
+alias mv='mv -i'
|
|
|
+alias cp='cp -i'
|
|
|
|
|
|
--exe ccze \
|
|
|
- && alias slog="tail -n 60 -f /var/log/syslog | ccze" \
|
|
|
- && alias mlog="tail -n 60 -f /var/log/mail.log | ccze"
|
|
|
+alias vlock='clear;vlock'
|
|
|
+alias q='clear;exit'
|
|
|
|
|
|
--exe pydf \
|
|
|
- && alias df="pydf -h"
|
|
|
--exe colormake \
|
|
|
- && alias make="colormake"
|
|
|
+alias grep="grep --color=tty"
|
|
|
+alias mgrep="grep --color=tty -rnisH"
|
|
|
|
|
|
-# git stuff
|
|
|
-[ -z "$GIT_PAGER" ] \
|
|
|
- && [ -x =less ] && export GIT_PAGER=less
|
|
|
-[ -z "$GIT_PAGER" ] \
|
|
|
- && [ -x =more ] && export GIT_PAGER=more
|
|
|
-[ -z "$GIT_PAGER" ] \
|
|
|
- && export GIT_PAGER=cat
|
|
|
+alias rsu="sudo zsh"
|
|
|
+alias reload="exec zsh"
|
|
|
+
|
|
|
+#
|
|
|
+# Log viewers aliases
|
|
|
+#
|
|
|
+if -exe ccze; then
|
|
|
+ alias slog="tail -n 300 -f /var/log/syslog | ccze"
|
|
|
+ alias mlog="tail -n 300 -f /var/log/mail.log | ccze"
|
|
|
+else
|
|
|
+ alias slog="tail -n 60 -f /var/log/syslog"
|
|
|
+ alias mlog="tail -n 60 -f /var/log/mail.log"
|
|
|
+fi
|
|
|
+# using colortail if available (freebsd)
|
|
|
+if -exe colortail; then
|
|
|
+ alias slog="colortail -n 60 -k /usr/local/share/examples/colortail/conf.messages -f /var/log/syslog"
|
|
|
+fi
|
|
|
|
|
|
-alias git="PAGER=$GIT_PAGER git"
|
|
|
-unset GIT_PAGER
|
|
|
+#
|
|
|
+# System tools aliases
|
|
|
+#
|
|
|
+alias df='df -h'
|
|
|
+if -exe pydf; then
|
|
|
+ alias df="pydf -h"
|
|
|
+fi
|
|
|
|
|
|
-# Pager stuff
|
|
|
--exe most \
|
|
|
- && export PAGER=most && alias more='most' && alias less='most'
|
|
|
+#
|
|
|
+# Devel tools aliases
|
|
|
+#
|
|
|
+if -exe colordiff; then
|
|
|
+ diff='colordiff'
|
|
|
+ if -exe tput; then
|
|
|
+ alias cdiff='colordiff -yW$(tput cols)'
|
|
|
+ fi
|
|
|
+fi
|
|
|
|
|
|
+if -exe colormake; then
|
|
|
+ alias make="colormake"
|
|
|
+fi
|
|
|
|
|
|
+#
|
|
|
+# Git stuff
|
|
|
+#
|
|
|
+if [ -z "$GIT_PAGER" ]; then
|
|
|
+ for p in less more cat; do
|
|
|
+ if -exe "$p"; then
|
|
|
+ alias git="PAGER=$p git"
|
|
|
+ break
|
|
|
+ fi
|
|
|
+ done
|
|
|
+fi
|
|
|
|