diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | .ssh/authorized_keys | 2 | ||||
-rw-r--r-- | .tmux.conf | 43 | ||||
-rw-r--r-- | .vimrc | 56 | ||||
-rw-r--r-- | .zlogin | 12 | ||||
-rw-r--r-- | .zshenv | 43 | ||||
-rw-r--r-- | .zshrc | 195 |
7 files changed, 352 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..72e8ffc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +* diff --git a/.ssh/authorized_keys b/.ssh/authorized_keys new file mode 100644 index 0000000..1baab50 --- /dev/null +++ b/.ssh/authorized_keys @@ -0,0 +1,2 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9z+r/ioyis5Iv4Z64PSD0dXaQQmPlT2bpRlSA6lS6lFHW1ccmUtIv32lIZUVNwamvftM20ozt+/sFKsVo2maoDdk4sLaf+erBIf2gtgYSZbhiUxQbfiel4V4dYU0hmY82REwTXFNGs0/pk37zsrfG9ePXoAQpE7e0i8kIk+VGYJ5DgYQ4jBEBMxNZ4pR0z6EdsuhV/vRIpV5Lf2vB+yx850LWg7+Nu4JjFW+1Jngui/NHJEX7aKBbI3aVAismMepNpMFhX2a5hVuh1b5WVFivcyD/TGAEO/4kBgmgrO/YPKjRnoysdAGcG20m3bjmRpYEdj/3ZO4nQb/3gicFd05J mjb@delta +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDG3eb4ZGH5P6KjUv6xMDqO1Fza0aONgG7qnfdluzV4l0GibWkUKbsWfdwkGEPe+lmc15f3Du0uz+8VFGOytX5/EZyFfBDuqynWFuFeb2YLqZImT33R9NqiYgOvRnByHc2SkMreP8LbL/E43w73nU9d7iH2XEVhMNr8v1e68+ZSb6BuwwhiUJFttugYg7Fj0RNiHNHtghvtN/lv1fpGAHooCnLtJeKnOxRJiJo0rT8HbepL+SwWKLYjXdZlm6kAC0EpAU8fD6kHvIE38dFEpxTpm2ip0+0ZEu77UqpwNSiqDB85+ILUd+U752aXm0+VlZfCuIaWAWknmdk2OsNv4oKd cardno:000604550873 diff --git a/.tmux.conf b/.tmux.conf new file mode 100644 index 0000000..d7618a2 --- /dev/null +++ b/.tmux.conf @@ -0,0 +1,43 @@ +set -g default-terminal "tmux-256color" + +set -g prefix2 C-x +bind-key -T prefix C-x send-prefix -2 + +set -g mouse on + +set -g set-titles on +set -g set-titles-string "[ #H.#S.#I ] [ #W ] [ #T ] #{session_alerts}" + +set -g status on +set -g status-interval 1 +set -g status-justify centre +set -g status-position bottom +set -g status-style fg=white + +set -g status-left "#[fg=green][ #[fg=white]#H #[fg=green]][" +set -g status-left-length 30 + +set -g status-right "#[fg=green]][ #[fg=cyan]%Y-%m-%d #[fg=white]%I:%M #[fg=green]]" +set -g status-right-length 40 + + +setw -g pane-border-format " #P: #T " +setw -g pane-border-status bottom + +setw -g window-status-current-format "#[fg=red](#[fg=white]#I.#P#F$ #W#[fg=red])" +setw -g window-status-current-style fg=white,bright + +setw -g window-status-format " #[fg=colour240]#I.#P#F$ #W#[fg=default] " +setw -g window-status-style fg=white,dim + +unbind-key -T prefix C-Up +unbind-key -T prefix C-Down +unbind-key -T prefix C-Left +unbind-key -T prefix C-Right + +bind-key -r -T prefix S-Up resize-pane -U +bind-key -r -T prefix S-Down resize-pane -D +bind-key -r -T prefix S-Left resize-pane -L +bind-key -r -T prefix S-Right resize-pane -R + + @@ -0,0 +1,56 @@ +" All system-wide defaults are set in $VIMRUNTIME/debian.vim (usually just +" /usr/share/vim/vimcurrent/debian.vim) and sourced by the call to :runtime +" you can find below. If you wish to change any of those settings, you should +" do it in this file (/etc/vim/vimrc), since debian.vim will be overwritten +" everytime an upgrade of the vim packages is performed. It is recommended to +" make changes after sourcing debian.vim since it alters the value of the +" 'compatible' option. + +" This line should not be removed as it ensures that various options are +" properly set to work with the Vim-related packages available in Debian. +runtime! debian.vim + +" Uncomment the next line to make Vim more Vi-compatible +" NOTE: debian.vim sets 'nocompatible'. Setting 'compatible' changes numerous +" options, so any other options should be set AFTER setting 'compatible'. +"set compatible + +" Vim5 and later versions support syntax highlighting. Uncommenting the +" following enables syntax highlighting by default. +if has("syntax") + syntax on + colorscheme elflord +endif + +" If using a dark background within the editing area and syntax highlighting +" turn on this option as well +"set background=dark + +" Uncomment the following to have Vim jump to the last position when +" reopening a file +"if has("autocmd") +" au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif +"endif + +" Uncomment the following to have Vim load indentation rules and plugins +" according to the detected filetype. +"if has("autocmd") +" filetype plugin indent on +"endif + +" The following are commented out as they cause vim to behave a lot +" differently from regular Vi. They are highly recommended though. +"set showcmd " Show (partial) command in status line. +"set showmatch " Show matching brackets. +"set ignorecase " Do case insensitive matching +"set smartcase " Do smart case matching +"set incsearch " Incremental search +"set autowrite " Automatically save before commands like :next and :make +"set hidden " Hide buffers when they are abandoned +"set mouse=a " Enable mouse usage (all modes) + +" Source a global configuration file if available +if filereadable("/etc/vim/vimrc.local") + source /etc/vim/vimrc.local +endif + @@ -0,0 +1,12 @@ +# execute host-specific stuff +if [ -f $HOME/.zlogin.$(hostname) ]; then + source $HOME/.zlogin.$(hostname) +fi + +# set terminal to clear after logout. +trap clear EXIT + +mesg y + +# evil hack for /home being a symlink +cd @@ -0,0 +1,43 @@ +# Yes, I have my own zsh setup; ignore system one. +IGNORE_SYSTEM_ZSH=1 + +export EDITOR=vi +export VISUAL=$EDITOR + +# Even if my editor is vi or vim, I do not want +# that at the command line. +bindkey -e + +# Set up less. +export LESS="-RSMgi" +export PAGER='less' +if [ -x /usr/bin/lesspipe ]; then + eval $(lesspipe) +fi + +# Set COLORTERM for s-lang programs if this is a color terminal +if [ "$TERM" = "xterm" -o "$TERM" = "linux" -o "$TERM" = "rxvt" ]; then + export COLORTERM=y +fi + +# Random environment settings. + +# LANG Stuff +#export LC_CTYPE=en_NZ.ISO-8859-1 + +# Don't allow dups in path. Then throw in what I consider is a complete +# path. This results in any other path setting going to the end. +typeset -U path +path=(~/bin /usr/lib/ccache /usr/local/bin /usr/bin /bin /usr/local/sbin /usr/sbin /sbin /usr/games .) + +# Shut up ps +export I_WANT_A_BROKEN_PS=1 + +export EMAIL=mike@ethernal.org +export DEBEMAIL=mjb@debian.org +export DEBFULLNAME='Mike Beattie' + +#Set up a history file. +HISTFILE=~/.history +SAVEHIST=1000 +HISTSIZE=1000 @@ -0,0 +1,195 @@ +########################################################## +# Prompt + +setprompt () { + + setopt prompt_subst + + ### + # See if we can use colors. + autoload colors zsh/terminfo + if [[ "$terminfo[colors]" -ge 8 ]]; then + colors + fi + for color in red green yellow blue magenta cyan white; do + eval local ${color}='%{$fg[${(L)color}]%}' + eval local ${color}_bold='%{$terminfo[bold]$fg[${(L)color}]%}' + done + local nocolor="%{$terminfo[sgr0]%}" + + # Base prompt. + pr_baseprompt="%(!.${red}%U%n%u.${green}%n)" # Username.. red underlining if uid 0 (root) + pr_baseprompt+="${magenta}@${green}%m" # "@<host>" + pr_baseprompt+="${yellow}:${green}%30<...<%~%<<%" # truncated path + pr_baseprompt+="(?.. ${red}%?)" # Exit code of previous command + pr_baseprompt+="${yellow}>${nocolor} " # Finally, add a yellow "> " + + # Info for title bar/screen title + pr_titleinfo='%(!.[ROOT] | .)%l) %n@%m:%30<...<%~%<<' + pr_windowtitle='' + pr_wt_in='' + pr_wt_out='' + case ${TERM} in + xterm*|rxvt) + pr_wt_in=$'\e]0;' + pr_wt_out=$'\a' + ;; + tmux*) + pr_wt_in=$'\e]2;' + pr_wt_out=$'\e\\' + ;; + screen) + # We also set the screen hardstatus format here.. it's a oncer. + print -n "\e_screen \005S :\005 - \005t\e\\" + pr_wt_in=$'\ek' + pr_wt_out=$'\e\\' + ;; + esac + + if [[ -n "${pr_wt_in}" ]];then + pr_windowtitle="${pr_wt_in}${pr_titleinfo}${pr_wt_out}" + fi + + # Finally, set prompts + PROMPT="%{${pr_windowtitle}%}${pr_baseprompt}" + RPROMPT="${green}< ${red}%!${nocolor}" + PS2="${yellow}%_ ${green}>${nocolor} " + + # Create the prexec hook function to set the title to the current command + preexec () { + [[ -n "${pr_wt_in}" ]] && print -nPR "${pr_wt_in}%l) %n@%m: %40>...>${(V)1//\%/%%}%<<${pr_wt_out}"; + } + +} + +setprompt + +########################################################## +# Misc + +#cdpath=(.. ~) # make cd search other directories +limit core 0 # no core dumps +umask 022 # for user group system +setopt nopromptcr # No cr before prompt. +#setopt extendedglob # Lots of cool extra wildcards +#setopt mailwarning # New mail? +setopt correct # Correct commands +#setopt nobanghist # No bang-history, thanks +# Note that the following comment makes me cringe now, but is left in for +# historical amusement value. (joeyh is funny) +setopt autolist automenu # Filename completion: the best of csh and 4dos! +setopt nobeep nolistbeep +setopt autocd # Exec directory to cd there +setopt noclobber noflowcontrol +setopt autoresume +#setopt print_exit_value +setopt list_packed +unsetopt bgnice + +# History setup. +setopt share_history +setopt hist_ignore_dups +setopt hist_allow_clobber +setopt hist_reduce_blanks + + +# Make alt key function as meta key. +#[[ $TERM = "xterm" ]] && stty pass8 && bindkey -me + +# ctrl-s will no longer freeze the terminal. +stty -ixon kill ^K +stty erase "^?" + +eval `dircolors 2>/dev/null` # set up color-ls variables +watch=(notme) # watch for everybody but me +LOGCHECK=120 # check every 2 min for login/logout activity + +# Turn on full-featured completion +autoload -U compinit +compinit +if [ -e ~/.ssh/known_hosts ]; then + # Use .ssh/known_hosts for hostnames. + hosts=(${${(f)"$(<~/.ssh/known_hosts)"//,/ }%%\ *}) + zstyle ':completion:*:hosts' hosts $hosts +fi + +########################################################## +# Aliases + +alias whois='whois -h geektools.com' +alias df='df -h' +alias cls=clear +alias cscs='clear;printf "\033[3J"' +# Do we have GNU ls of a new enough version for color? +(ls --help 2>/dev/null |grep -- --color=) >/dev/null && \ + alias ls='ls -b -CF --color=auto' +alias l=ls +alias dir='ls -lhga' +alias du='du -h' +alias f=finger +alias ftp=ncftp +alias md=mkdir +alias rd=rmdir +alias k=killall +alias mtr='mtr --curses' +#alias su='su -' +#if [ -e `which reportbug 2>/dev/null` ]; then +# alias bug='reportbug -b' +#fi +alias stardate='date "+%y%m.%d/%H%M"' +# I don't like the zsh builtin time command. +if [ -e /usr/bin/time ] ; then alias time=/usr/bin/time ; fi + +# Use GPG2 in preference over GPG1 +if [ -e /usr/bin/gpg2 ] ; then alias gpg=/usr/bin/gpg2 ; fi + +# Xterm/rxvt resizing-fu +alias default='echo -ne "\033]50;fixed\007"' +alias hide='echo -ne "\033]50;nil2\007"' +alias tiny='echo -ne "\033]50;5x7\007"' +alias small='echo -ne "\033]50;6x10\007"' +alias medium='echo -ne "\033]50;7x13\007"' +alias large='echo -ne "\033]50;9x15\007"' +alias huge='echo -ne "\033]50;10x20\007"' + +########################################################## +# Key bindings + +autoload -U up-line-or-beginning-search +autoload -U down-line-or-beginning-search +zle -N up-line-or-beginning-search +zle -N down-line-or-beginning-search + +bindkey "\eOA" up-line-or-beginning-search +bindkey "\eOB" down-line-or-beginning-search +bindkey "\e[A" history-search-backward +bindkey "\e[B" history-search-forward +bindkey '^K' kill-whole-line +bindkey -s '^L' "|less\n" # ctrl-L pipes to less +bindkey -s '^B' " &\n" # ctrl-B runs it in the background +bindkey "\e[1~" beginning-of-line # Home +bindkey "\e[H" beginning-of-line # Home (xterm) +[[ $TERM = "rxvt" ]] && bindkey "\e[7~" beginning-of-line +bindkey "\e[4~" end-of-line # End +bindkey "\e[F" end-of-line # End (xterm) +[[ $TERM = "rxvt" ]] && bindkey "\e[8~" end-of-line +bindkey "\e[2~" overwrite-mode # Ins +bindkey "\e[3~" delete-char # Delete + +########################################################## +# Functions + +# Return the size of a directory. +dirsize() { + pushd >/dev/null; + chdir $1; + du |tail --lines 1; + popd >/dev/null; +} + +# Calculator +calc () { echo $* |bc -l } + +# This fingers @host. +@ () { finger @$1 } + |