Files
cshenv/tcshrc.aliases
2016-11-30 18:32:55 -05:00

178 lines
3.7 KiB
Tcsh

# CSHENV Aliases:
alias resource source ${CSHENV_DIR}/startup_hooks/tcshrc
alias relog resource
alias rl relog
#Dir motion
alias pd pushd
alias pu pushd
alias po popd
#Figure out where we get our LS from. TODO: Move this?
#This sets the ls command to the right command to use for that system, to
#enable colour output, if at all possible
if( ( $?CSHENV_DEBUG ) || ( $?CSHENV_VERBOSE_STARTUP ) ) then
echo "Probing ls(1) options..."
endif
if( $?CSHENV_USE_GNU_LS ) then
if( $?CSHENV_DEBUG ) then
echo "Finding gls..."
endif
if( { which gls } ) > /dev/null then
setenv CSHENV_SYSTEM_LS USE_GNU_LS
else if( "$CSHENV_SYSTEM" == "Linux" || "$CSHENV_SYSTEM" == "Cygwin" ) then
setenv CSHENV_SYSTEM_LS Linux
else
setenv CSHENV_SYSTEM_LS $CSHENV_SYSTEM
endif
if( $?CSHENV_DEBUG ) then
echo "Done with gls probe..."
endif
else
if( $?CSHENV_DEBUG ) then
echo "Trying for other ls options..."
endif
if( $?CSHENV_USE_BUILTIN_LS ) then
setenv CSHENV_SYSTEM_LS USE_BUILTIN_LS
else
if( $?CSHENV_DEBUG ) then
echo "Defaulting on ls..."
endif
setenv CSHENV_SYSTEM_LS ${CSHENV_SYSTEM}
endif
endif
switch( $CSHENV_SYSTEM_LS )
#FreeBSD, Darwin, and possibly others have the "G" option
#which uses the LSCOLORS env variable
case Darwin:
#FALLTHROUGH
case FreeBSD:
alias l ls -FG
breaksw
#DEPRECATED
#SunOS has no default ls for color; however, we'll gamble that
#/usr/shareware or such has GNU ls(1) installed...
case SunOS___DEPRECATED:
alias ls gls
#FALLTHROUGH
#This is for systems which have GNU ls(1) installed, as gls(1) (when
#their native system ls(1) is not gnu, but the USE_GNU_LS variable
#is set. Systems with native ls as GNU ls(1) won't be affected.
case USE_GNU_LS:
alias ls gls
#FALLTHROUGH
#Linux and other GNU derived systems (or systems using GNU ls(1)
#need the --color option to make their ls work with color.
#I'll squelch the "--long-names-suck" debate.
case Linux:
alias l ls -F --color
breaksw
#Anybody else (on other systems) will just have to deal with
#boring old ls -F, and hope that's enough distinction to
#differentiate file types. {We'll look into using ls-F(1) builtin,
#but if your system's ls doesn't support colour, we won't hold out
#much hope. Just remove the space after ls, before -F, to try that.}
case USE_BUILTIN_LS:
alias l ls-F
breaksw
default:
alias l ls -F
breaksw
endsw
#Classic UNIXy aliases
#Standard ls aliases that I use:
alias ll l -l
alias la l -a
alias li l -i
#standard long ls aliases that I use
alias llh l -lh
alias lli ll -i
alias llhi llh -i
alias llih llhi
#{I derive lla from ll, not la, because it's a long ls, similarly for llA}
alias lla ll -a
alias lla ll -A
alias llha llh -a
alias llah llha
alias llhia llhi -a
alias llahi llhia
alias lliah llahi
alias lliha llahi
alias llaih llahi
alias llhai llahi
alias lt l -t
alias llt ll -t
#alias mkdir mkdir -p
alias md mkdir
alias rd rmdir
alias . pwd
#Job control aliases TODO: Update these for arguments
alias , jobs
alias = "%&"
alias + "%%"
alias - stop
#More specific aliases
alias show set
alias lh l -sh
# Detect and activate vim, if present
if( -f `which vim` ) then
alias vi vim
setenv EDITOR vim
setenv VISUAL vim
else
setenv EDITOR vi
setenv VISUAL vi
echo "Couldn't find vim. Beware!"
endif
if( -f `which git` ) then
alias g git
else
alias g echo "Git not found!"
endif
if( -f `which pass` ) then
alias p pass
else
alias p echo "Password store not found!"
endif
safe_source ${CSHENV_DIR}/tcshrc.aliases.${CSHENV_SYSTEM}
safe_source ${CSHENV_DIR}/tcshrc.aliases.${CSHENV_HOSTNAME}
safe_source ${CSHENV_DIR}/tcshrc.aliases.user
###########################
# vim:filetype=tcsh
###########################