Dotfiles

From FarmShare

(Difference between revisions)
Jump to: navigation, search
(Created page with "== dotfiles == This page documents the shell setup files that are put in place for newly created accounts at Stanford. If you are a long time sunetid'er and would like to see t...")
Line 6: Line 6:
== tcsh ==
== tcsh ==
-
<source lang="csh">
+
.cshrc:
 +
 
 +
<source lang="sh">
#------------#
#------------#
# csh/tcsh  #
# csh/tcsh  #
Line 36: Line 38:
# Put any local aliases or settings below this line.
# Put any local aliases or settings below this line.
 +
</source>
 +
 +
.login:
 +
<source lang="sh">
 +
# In this file, put any commands that you want to run on every login
 +
# that might produce output.  Don't put any commands that produce
 +
# output into .cshrc, since that will confuse non-interactive shells.
 +
</source>
 +
 +
 +
== bash ==
 +
 +
.bashrc:
 +
<source lang="sh">
 +
#------------#
 +
#  bash    #
 +
#------------#
 +
 +
umask 077  # file protection no read or write for others
 +
            # umask 022 is no write but read for others
 +
 +
# append to the history file, don't overwrite it
 +
shopt -s histappend
 +
 +
# check the window size after each command and, if necessary,
 +
# update the values of LINES and COLUMNS.
 +
shopt -s checkwinsize
 +
ulimit -c 0
 +
set -o noclobber
 +
alias cp='cp -i'    # prompt before overwriting file
 +
alias mv='mv -i'    # prompt before overwriting file
 +
alias rm='rm -i'    # prompt before removing file
 +
 +
# enable bash completion in interactive shells
 +
if [ -f /etc/bash_completion ] ; then
 +
  . /etc/bash_completion
 +
fi
 +
 +
# fancy prompt
 +
case "$TERM" in
 +
  xterm*)
 +
    PSSUF='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
 +
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PSSUF"
 +
    ;;
 +
  *)
 +
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
 +
    ;;
 +
esac
 +
 +
# Put any local aliases or settings below this line.
 +
</source>
 +
 +
.bash_profile:
 +
<source lang="sh">
 +
# give ^R some data to work with
 +
export HISTSIZE=5000
 +
 +
# Some programs honor VISUAL, so set this if EDITOR is set.
 +
if [ ! -z "$EDITOR" ] ; then
 +
  export VISUAL=$EDITOR
 +
fi
 +
 +
if [ -f $HOME/.bashrc ] ; then
 +
  . $HOME/.bashrc
 +
fi
 +
</source>
 +
 +
 +
== zsh ==
 +
 +
.zshrc:
 +
<source lang="sh">
 +
umask 077  # file protection no read or write for others
 +
            # umask 022 is no write but read for others
 +
 +
ulimit -c 0
 +
unsetopt CLOBBER    # don't overwrite existing file w/ redirect
 +
alias cp='cp -i'    # prompt before overwriting file
 +
alias mv='mv -i'    # prompt before overwriting file
 +
alias rm='rm -i'    # prompt before removing file
 +
 +
setopt INC_APPEND_HISTORY    # set history options
 +
setopt SHARE_HISTORY
 +
setopt HIST_EXPIRE_DUPS_FIRST
 +
setopt HIST_IGNORE_DUPS
 +
setopt HIST_IGNORE_ALL_DUPS
 +
setopt HIST_FIND_NO_DUPS
 +
setopt HIST_SAVE_NO_DUPS
 +
 +
HISTFILE=$HOME/.zhistory    # set history file
 +
HISTSIZE=5000                # number of history commands to save
 +
SAVEHIST=$HISTSIZE
 +
 +
# Some programs honor VISUAL, so set this if EDITOR is set.
 +
if [ ! -z "$EDITOR" ] ; then
 +
  export VISUAL=$EDITOR
 +
fi
 +
 +
autoload -Uz promptinit    # use prompt themes
 +
promptinit
 +
 +
# basic prompt
 +
prompt oliver
 +
# you can run prompt -p to preview alternatives
 +
 +
# Put any local aliases or settings below this line.
</source>
</source>

Revision as of 18:31, 15 January 2014

Contents

dotfiles

This page documents the shell setup files that are put in place for newly created accounts at Stanford. If you are a long time sunetid'er and would like to see the current "skeleton" files then keep reading. If you see some error when you login to farmshare and would like to compare to "pristine" .cshrc/.bashrc/.bash_profile/etc then keep reading.


tcsh

.cshrc:

#------------#
# csh/tcsh   #
#------------#

umask 077   # file protection no read or write for others
            # umask 022 is no write but read for others

# Exit if non-interactive to avoid exposing aliases to scripts and
# to avoid problems caused by any local changes that produce output.
if (! $?prompt) exit

# Everything below this point only applies to interactive shells.
limit coredumpsize 0    # don't write core dumps
set noclobber           # don't overwrite existing file w/ redirect
set rmstar              # prompt before executing rm *
alias cp 'cp -i'        # prompt before overwriting file
alias mv 'mv -i'        # prompt before overwriting file
alias rm 'rm -i'        # prompt before removing file
set history=5000        # number of history commands to save

# Some programs honor VISUAL, so set this if EDITOR is set.
if ( $?EDITOR ) then
   setenv VISUAL "$EDITOR"
endif

set prompt="%m:%~%# "    # set prompt

# Put any local aliases or settings below this line.

.login:

# In this file, put any commands that you want to run on every login
# that might produce output.  Don't put any commands that produce
# output into .cshrc, since that will confuse non-interactive shells.


bash

.bashrc:

#------------#
#   bash     #
#------------#

umask 077   # file protection no read or write for others
            # umask 022 is no write but read for others

# append to the history file, don't overwrite it
shopt -s histappend

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
ulimit -c 0
set -o noclobber
alias cp='cp -i'    # prompt before overwriting file
alias mv='mv -i'    # prompt before overwriting file
alias rm='rm -i'    # prompt before removing file

# enable bash completion in interactive shells
if [ -f /etc/bash_completion ] ; then
   . /etc/bash_completion
fi

# fancy prompt
case "$TERM" in
   xterm*)
     PSSUF='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
     PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PSSUF"
    ;;
   *)
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
    ;;
esac

# Put any local aliases or settings below this line.

.bash_profile:

# give ^R some data to work with
export HISTSIZE=5000

# Some programs honor VISUAL, so set this if EDITOR is set.
if [ ! -z "$EDITOR" ] ; then
   export VISUAL=$EDITOR
fi

if [ -f $HOME/.bashrc ] ; then
  . $HOME/.bashrc
fi


zsh

.zshrc:

umask 077   # file protection no read or write for others
            # umask 022 is no write but read for others

ulimit -c 0
unsetopt CLOBBER    # don't overwrite existing file w/ redirect
alias cp='cp -i'    # prompt before overwriting file
alias mv='mv -i'    # prompt before overwriting file
alias rm='rm -i'    # prompt before removing file

setopt INC_APPEND_HISTORY    # set history options
setopt SHARE_HISTORY
setopt HIST_EXPIRE_DUPS_FIRST
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_FIND_NO_DUPS
setopt HIST_SAVE_NO_DUPS

HISTFILE=$HOME/.zhistory     # set history file
HISTSIZE=5000                # number of history commands to save
SAVEHIST=$HISTSIZE

# Some programs honor VISUAL, so set this if EDITOR is set.
if [ ! -z "$EDITOR" ] ; then
   export VISUAL=$EDITOR
fi

autoload -Uz promptinit    # use prompt themes
promptinit

# basic prompt
prompt oliver
# you can run prompt -p to preview alternatives

# Put any local aliases or settings below this line.
Personal tools
Toolbox
LANGUAGES