This is part of the Zsh Utilities.
This file defines some basic but nevertheless fundamental aliases.
alias cl='clear'
alias h='history'
alias open='xdg-open $@ > /dev/null 2>&1'
alias ll='ls -ltrh'
alias la='ls -rtha'
alias lla='ls -rthal'
alias lsd='ls -l | grep "^d"'
=gcp= is a python script to provide a user friendly frontend to cp
unix
command.
if (( $+commands[gcp] )); then
alias cp='/usr/bin/gcp -f'
compdef _files gcp
fi
alias grep='grep --color=auto'
if pkgtools::has_binary ack-grep; then
alias ack='ack-grep'
elif pkgtools::has_binary /usr/bin/vendor_perl/ack; then
alias ack='/usr/bin/vendor_perl/ack'
fi
function --check-emacs ()
{
local pid=$(ps -edf | grep ${USER} | grep emacs | grep daemon | awk '{print $2}')
if [[ "${pid}" == "" ]]; then
notify -i emacs "Emacs" "New emacs daemon"
emacs --daemon > /dev/null 2>&1
fi
emacsclient "$@"
}
alias emacs='--check-emacs -n -c $@'
alias iemacs='--check-emacs -n $@'
alias ve='--check-emacs -nw $@'
alias relaunch_emacs='killall emacs; sleep 1; emacs'
alias stop_emacs='pkill -SIGUSR2 emacs'
function cask ()
{
if pkgtools::has_binary cask; then
(
cd ~/.emacs.d
$(pkgtools::get_binary_path cask) $@
)
fi
}
In case glances
is installed (see https://github.com/nicolargo/glances), use
it as replacement for top command
if (( $+commands[glances] )); then
alias top='glances --percpu --process-short-name --fs-free-space'
fi
Options for less
program are the following
-M
: shows more detailed prompt, including file position-N
: shows line number-X
: supresses the terminal clearing at exit
export PAGER='less -M -N -X'
if pkgtools::has_binary bat; then
alias more='bat'
else
alias more='less -M -N -X'
fi
if pkgtools::has_binary pygmentize; then
pkgtools::reset_variable LESSOPEN "| pygmentize %s"
else
pkgtools::unset_variable LESSOPEN
fi
alias start_server='python -m http.server 8888'
alias transmission-rpi="transmission-remote-gtk"
alias youtube-dl-audio='youtube-dl --ignore-errors --output "%(title)s.%(ext)s" --extract-audio --audio-format mp3'