Commit ccc60e20 authored by Robert Spencer's avatar Robert Spencer
Browse files

General tweaking and a few bug fixes

Bugs fixed:

  * $PATH could land up with duplicates in it
  * HIST_STAMPS was in the wrong format
parent ffef92f2
# Override first bin dir # Override first bin directory
export PATH=~/bin:$PATH
# Depending on your distro, your ~/.profile may already be providing
# this information
if [ -d "$HOME/bin" ]
then
if [[ "$PATH" =~ "$HOME/bin" ]]
then
# Do nothing
:
else
export PATH="$HOME/bin:$PATH"
fi
fi
if [ -d "$HOME/.local/bin" ]
then
if [[ "$PATH" =~ "$HOME/.local/bin" ]]
then
# Do nothing
:
else
export PATH="$HOME/.local/bin:$PATH"
fi
fi
# Remove duplicates in $PATH, if they exist
typeset -U path
# The following line changes the command execution time stamp shown in
HIST_STAMPS="yyyy/mm/dd" # the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
HIST_STAMPS='%Y/%m/%d'
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
setopt EXTENDED_HISTORY setopt EXTENDED_HISTORY
# Now ignore duplicates in the history # Now ignore duplicates in the history
setopt HIST_IGNORE_ALL_DUPS setopt HIST_IGNORE_ALL_DUPS
# Ignore gaps too # Prevent recording a history entry if preceded with at least one space
setopt HIST_IGNORE_SPACE setopt HIST_IGNORE_SPACE
# Don't store invocations of 'history' in the history # Don't store invocations of 'history' in the history
setopt HIST_NO_STORE setopt HIST_NO_STORE
...@@ -20,7 +20,3 @@ HISTFILE=~/.zsh_history ...@@ -20,7 +20,3 @@ HISTFILE=~/.zsh_history
HISTSIZE=2000 HISTSIZE=2000
# Save 1000 commands # Save 1000 commands
SAVEHIST=1000 SAVEHIST=1000
# Remove / from the default WORDCHARS
WORDCHARS=$(echo $WORDCHARS | tr -d '/')
# If a command takes a combined time of > 10 seconds, zsh will report it... # If a command takes a combined time of > 10 seconds, zsh will report it...
REPORTTIME=10 REPORTTIME=10
# Use a bunch of colors # Use a bunch of colors in screen
if [ "$TERM" = "screen" ] if [ "$TERM" = "screen" ]
then then
export TERM="screen-256color-s" export TERM="screen-256color-s"
else else
export TERM="xterm-256color" export TERM="xterm-256color"
fi fi
# Add directory colors # Add directory colors
if [ -x /usr/bin/dircolors ]; then if [ -x /usr/bin/dircolors ]; then
eval "$(dircolors -b)" eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias dir='dir --color=auto' alias dir='dir --color=auto'
alias ls='ls --color=auto'
alias vdir='vdir --color=auto' alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto' alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
fi fi
...@@ -3,22 +3,20 @@ autoload -Uz compinit ...@@ -3,22 +3,20 @@ autoload -Uz compinit
compinit compinit
# A handy-dandy function for reloading completions we might hack on # A handy-dandy function for reloading completions we might hack on
compreload () function compreload() {
{
ARG="$1" ARG="$1"
unfunction _$ARG unfunction _$ARG
autoload _$ARG autoload _$ARG
} }
# Bash-style null glob result -> no error
#setopt null_glob
zstyle ':completion:*' auto-description 'specify: %d' zstyle ':completion:*' auto-description 'specify: %d'
zstyle ':completion:*' completer _expand _complete _correct _approximate zstyle ':completion:*' completer _expand _complete _correct _approximate
zstyle ':completion:*' format 'Completing %d' zstyle ':completion:*' format 'Completing %d'
#zstyle ':completion:*' group-name '' #zstyle ':completion:*' group-name ''
# For autocompletion with an arrow-key driven interface. ?
# To activate the menu, press Tab twice.
#zstyle ':completion:*' menu select=2 #zstyle ':completion:*' menu select=2
#eval "$(dircolors -b)"
#zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} #zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
#zstyle ':completion:*' list-colors '' #zstyle ':completion:*' list-colors ''
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
...@@ -33,4 +31,3 @@ zstyle ':completion:*' verbose true ...@@ -33,4 +31,3 @@ zstyle ':completion:*' verbose true
# Add custom completion scripts # Add custom completion scripts
fpath=(~/.zsh/completion $fpath) fpath=(~/.zsh/completion $fpath)
# Which plugins would you like to load?
# Oh My ZSH plugins to load # Standard plugins can be found in ~/.zsh/oh-my-zsh/plugins/*
plugins=(colored-man-pages colorize command-not-found gitfast screen zsh-syntax-highlighting) # Custom plugins may be added to ~/.zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
colored-man-pages
colorize
command-not-found
gitfast
screen
zsh-syntax-highlighting
)
# Treat the ‘#’, ‘~’ and ‘^’ characters as part of patterns
# for filename generation, etc. (An initial unquoted ‘~’ always
# produces named directory expansion.)
setopt EXTENDED_GLOB setopt EXTENDED_GLOB
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
test "x$HOSTNAME" = "x" && export HOSTNAME=$(hostname) test "x$HOSTNAME" = "x" && export HOSTNAME=$(hostname)
export VISUAL=/usr/bin/vim
export EDITOR=/usr/bin/vim export EDITOR=/usr/bin/vim
export GIT_EDITOR=/usr/bin/vim export GIT_EDITOR=/usr/bin/vim
export VISUAL=/usr/bin/vim
export SHELL=/bin/zsh export SHELL=/bin/zsh
...@@ -7,6 +7,5 @@ ZSH_CUSTOM=$HOME/.zsh/custom ...@@ -7,6 +7,5 @@ ZSH_CUSTOM=$HOME/.zsh/custom
# Set cache directory # Set cache directory
ZSH_CACHE=$HOME/.zsh/cache ZSH_CACHE=$HOME/.zsh/cache
# User configuration # oh-my-zsh configuration
source $ZSH/oh-my-zsh.sh source $ZSH/oh-my-zsh.sh
# Useful functions # Useful functions
mcd () { mkdir -p "$1"; cd "$1"; } # Initiate git project with the specified license and commit
function make-project() { mcd "$1"; git init; cp /usr/share/common-licenses/$2 COPYING; git add COPYING; git commit -m "This project is under the $2 licence at this time"; }
odx () { od -t x4 -A x "$@" ; } # mkdir and cd into it
function mcd() { mkdir -p "$1"; cd "$1"; }
odx1 () { od -t x1 -A x "$@" ; } # Dump files in hexadecimal, 4 bytes per integer
function odx() { od -t x4 -A x "$@"; }
# Git related handy-handy stuff
make-project () { mcd "$1"; git init; cp /usr/share/common-licenses/$2 COPYING; git add COPYING; git commit -m "This project is under the $2 licence at this time"; }
# Dump files in hexadecimal, 1 byte per integer
function odx1() { od -t x1 -A x "$@"; }
# Alias definitions. # Source bash alias definitions, if they exist
if [ -f ~/.bash_aliases ]; then if [ -f ~/.bash_aliases ]
. ~/.bash_aliases then
source ~/.bash_aliases
fi fi
...@@ -2,4 +2,3 @@ ...@@ -2,4 +2,3 @@
# We do this because: # We do this because:
# - The system has SendEnv set to send locale environment variables to the server, LANG and LC_ALL # - The system has SendEnv set to send locale environment variables to the server, LANG and LC_ALL
alias ssh="/usr/bin/ssh -F ~/.ssh/config" alias ssh="/usr/bin/ssh -F ~/.ssh/config"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment