From da3032a92355a6c7c5f0d5251e5b4e333c60855c Mon Sep 17 00:00:00 2001 From: Jannik Zander Date: Tue, 24 May 2016 21:12:51 +0200 Subject: [PATCH] New aliases --- .config/bash/rc/aliases | 86 +++++++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 38 deletions(-) diff --git a/.config/bash/rc/aliases b/.config/bash/rc/aliases index 75eaa0c..b44bdc4 100644 --- a/.config/bash/rc/aliases +++ b/.config/bash/rc/aliases @@ -1,3 +1,41 @@ +alias sl=ls +alias ls='ls -G' +alias la='ls -AF' +alias ll='ls -al' +alias l1='ls -1' +alias l.='ls -d .*' + +if [ $OSTYPE != *darwin* ] +then + #alias ls="ls --color=auto" + alias ls="command ls $LS_COMMON" +fi + +LS_COMMON="-hF" +#LS_COMMON="$LS_COMMON -I NTUSER.\* -I ntuser.\*" + +# Detect which `ls` flavor is in use +if whence dircolors > /dev/null 2>&1; then # GNU `ls` + eval $(dircolors -b $HOME/.dir_colors) + colorflag="--color" +else # OS X `ls` + #eval $(gdircolors $HOME/.dircolors) + export CLICOLOR=1 + colorflag="-G" +fi + +# Shortcuts +alias g='git' +alias h='history' +alias j='jobs' +alias v='vim' +alias q='exit' +alias c='clear' +alias cls='clear' + +alias edit="$EDITOR" +alias pager="$PAGER" + # Easier navigation: .., ..., ...., ....., ~ and - alias ..="cd .." alias ...="cd ../.." @@ -23,6 +61,14 @@ alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' +alias md='mkdir -p' +alias rd='rmdir' + +if [ ! -x "$(which tree 2>/dev/null)" ] +then + alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" +fi + alias info='info --vi-keys' #alias less='less -rX' # raw control characters, don't clear the screen after quitting alias whence='type -a' # where, of a sort @@ -30,45 +76,9 @@ alias grep='grep --color' # show differences in color alias egrep='egrep --color=auto' # show differences in color alias fgrep='fgrep --color=auto' # show differences in color -# Shortcuts -alias g="git" -alias h="history" -alias j="jobs" - -LS_COMMON="-hF" -#LS_COMMON="$LS_COMMON -I NTUSER.\* -I ntuser.\*" - -# Detect which `ls` flavor is in use -if whence dircolors > /dev/null 2>&1; then # GNU `ls` - eval $(dircolors -b $HOME/.dir_colors) - colorflag="--color" -else # OS X `ls` - #eval $(gdircolors $HOME/.dircolors) - export CLICOLOR=1 - colorflag="-G" -fi - -# Always list colorized -LS_COMMON="$LS_COMMON $colorflag" -alias ls="command ls $LS_COMMON" - -# List all files excl. dotfiles -alias l="ls" - -# List all files in long format excl. dotfiles -alias ll="ls -l" - -# List all files in long format, incl. dotfiles -alias la="ls -la" - -# List only directories -alias lsd="ls -l | grep --color=never '^d'" - -# List only dotfiles -alias l.="ls -d .*" - # Enable aliases to be sudo'ed alias sudo='sudo ' +alias _="sudo" # Get week number alias week='date +%V' @@ -82,7 +92,7 @@ alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date alias map="xargs -n1" for method in GET HEAD POST PUT DELETE TRACE OPTIONS; do - alias "$method"="lwp-request -m '$method'" + alias "$method"="lwp-request -m '$method'" done # Reload the shell (i.e. invoke as a login shell) -- 2.43.0