My .zshrc

This is a work-in-progress. Also note that this machine didn’t have zkbd or any of the useful zsh additions I’ve become used to:

echo "Enabling zsh-specific configuration..."

# Useful Aliases
#alias l.='ls -d .* --color=tty'
#alias ll='ls -l --color=tty'
#alias ls='ls --color=tty'
alias lsa='ls -al'
alias lsd='ls -al | grep "^d"'
alias rezsh='. ~/.zshrc'

# Change Prompt
        # Left Hand Prompt
        export PS1="%B%n@%M%#%b "
                # Bold-username-hostname-magicprompt-endbold "
        # Right Hand Prompt
        export RPROMPT="%~"

if [[ $TERM = "xterm" ]] ; then
        echo "  configuring xterm settings..."

        # Fix Backspace
        stty erase "^?"

        # Add some useful keybindings
                # Home Key
                bindkey '^[[1~' beginning-of-line
                # End Key
                bindkey '^[[4~' end-of-line
                # Insert
                bindkey '^[[2~' overwrite-mode
                # Delete Key
                bindkey '^[[3~' delete-char
                # Page Up
                bindkey '^[[5~' beginning-of-history
                # Page Down
                bindkey '^[[6~' end-of-history
                # Ctrl+Left
                bindkey '^[OD' emacs-backward-word
                # Ctrl+Right
                bindkey '^[OC' emacs-forward-word

fi

Also, as an interesting aside, I didn’t have permissions to change my default shell (which was tsch), so I just edited the startup script (.login) of the tsch shell and made it change my shell:

echo "Switching shell to zsh..."
setenv SHELL /bin/zsh
exec /bin/zsh --login

… probably not the most elegant solution, but it works for now.

Posted Tuesday, October 6th, 2009 under linux, tips and tricks.

Tags:

Leave a Reply

Powered by WP Hashcash