Permalink
Browse files

Lots of cleanup and merge in some oh-my-zsh features

  • Loading branch information...
1 parent d436a98 commit a2c4713dd3d8affea7432abdba635e9002512320 @tclem committed Sep 26, 2011
View
@@ -1 +0,0 @@
-vim/vim.symlink/.netrwhist
View
@@ -1,6 +1,6 @@
The MIT License
-Copyright (c) Zach Holman, http://zachholman.com
+Copyright (c) Tim Clem, http://timclem.wordpress.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
View
@@ -1,84 +1,23 @@
-# holman does dotfiles
+# tclem and his dotfiles
-## dotfiles
+These are my dotfiles.
-Your dotfiles are how you personalize your system. These are mine. The very
-prejudiced mix: OS X, zsh, Ruby, Rails, git, homebrew, rvm, vim. If you
-match up along most of those lines, you may dig my dotfiles.
+## Install
-I was a little tired of having long alias files and everything strewn about
-(which is extremely common on other dotfiles projects, too). That led to this
-project being much more topic-centric. I realized I could split a lot of things
-up into the main areas I used (Ruby, git, system libraries, and so on), so I
-structured the project accordingly.
+``` sh
+git clone git://github.com/tclem/dotfiles ~/.dotfiles
+cd ~/.dotfiles
+rake install
+```
-If you're interested in the philosophy behind why projects like these are
-awesome, you might want to [read my post on the
-subject](http://zachholman.com/2010/08/dotfiles-are-meant-to-be-forked/).
+A .zshrc is setup for you, but it will look for and source a .localrc
+which is where you should put stuff you don't want checked into a public
+repo.
-## install
+## Credit where credit is due
-- `git clone git://github.com/holman/dotfiles ~/.dotfiles`
-- `cd ~/.dotfiles`
-- `rake install`
-
-The install rake task will symlink the appropriate files in `.dotfiles` to your
-home directory. Everything is configured and tweaked within `~/.dotfiles`,
-though.
-
-The main file you'll want to change right off the bat is `zsh/zshrc.symlink`,
-which sets up a few paths that'll be different on your particular machine.
-
-## topical
-
-Everything's built around topic areas. If you're adding a new area to your
-forked dotfiles — say, "Java" — you can simply add a `java` directory and put
-files in there. Anything with an extension of `.zsh` will get automatically
-included into your shell. Anything with an extension of `.symlink` will get
-symlinked without extension into `$HOME` when you run `rake install`.
-
-## what's inside
-
-A lot of what's inside is just aliases: `gs` for `git status`, `gl` for `git
-pull --rebase --prune`, for example. You can browse the `aliases.zsh` files in
-each topic directory. There's also a collection of scripts in `bin` you can
-browse. A few notable ones:
-
-###rails
-- `s` pings your system for any running Rails apps, and `deathss` will then
- kill all of them indiscriminately. `ss` starts up a new Rails server on the
- next available port- if 3000 is taken, it'll spin up your server on 3001.
-
-###system
-- `c` is an autocomplete shortcut to your projects directory. For example, `c
- git` and then hitting tab will autocomplete to `github`, and then it simply
- changes to my `github` directory.
-- `check [filename]` is a quick script that tells you whether a domain is
- available to register.
-- `smartextract [filename]` will extract about a billion different
- compressed/uncompressed/whatever files and you'll never have to remember the
- syntax.
-- `backup` is a quick hook into `rsync` to backup a selection of files. Check
- out the comments for more details.
-
-###fun
-- `cloudapp` uploads any file to [CloudApp](http://getcloudapp.com).
-- `gifme` is a command-line animated GIF generator. It's also amazing.
-
-##moar custom
-There are a few things I use to make my life awesome. They're not a required
-dependency, but if you make it happen, THEY'LL MAKE **YOU** HAPPEN.
-
-- If you want some more colors for things like `ls`, install grc: `brew install
- grc`.
-- If you install the excellent [rvm](http://rvm.beginrescueend.com) to manage
- multiple rubies, your current branch will show up in the prompt. Bonus.
-
-## thanks
-
-I forked [Ryan Bates](http://github.com/ryanb)' excellent
-[dotfiles](http://github.com/ryanb/dotfiles) for a couple years before the
-weight of my changes and tweaks inspired me to finally roll my own. But Ryan's
-dotfiles were an easy way to get into bash customization, and then to jump ship
-to zsh a bit later. A decent amount of the code in these dotfiles stem or are
-inspired from Ryan's original project.
+The original version of these came from [Zach
+Holman](https://github.com/holman/dotfiles), but I have ripped and torn
+them beyond recognition. Many of my zsh tricks come from
+[oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) which is well
+worth checking out in it's own right.
View
@@ -2,7 +2,8 @@ require 'rake'
desc "Hook our dotfiles into system-standard positions."
task :install do
- linkables = Dir.glob('*/**{.symlink}')
+ linkables = Dir.glob('*/**/**{.symlink}')
+ puts linkables
skip_all = false
overwrite_all = false
View
@@ -1,5 +0,0 @@
-#!/bin/sh
-#
-# Stage all unstaged.
-
-git add -A
View
@@ -1,5 +0,0 @@
-#!/bin/sh
-#
-# Use the last commit message and amend your stuffs.
-
-git commit --amend -C HEAD
View
@@ -0,0 +1,25 @@
+#!/bin/sh
+#/ Usage: issue-to-pull <user/repo> <issue_id>
+#/ Converts an issue into a pull request
+
+# show usage
+[ $# -eq 0 -o "$1" = "--help" ] && {
+ grep '^#/'< "$0" |
+ cut -c4-
+ exit 2
+}
+
+# grab the current branch
+branch=$(git symbolic-ref HEAD | sed 's/^refs\/heads\///')
+[ -z "$branch" ] && {
+ echo "could not determine current branch" 1>&2
+ false
+}
+
+echo "This will turn issue $2 on $1 into a pull request for branch '$branch'"
+read -s -p "GitHub Password: " pwd
+
+curl -u "tclem:$pwd" https://api.github.com/repos/$1/pulls \
+ -d '{"issue":'$2', "head":"'$branch'", "base":"master"}'
+
+echo
View
@@ -1,3 +1,13 @@
#!/bin/sh
+#/ Usage: lock
+#/ Lock your screen. This utility only works on OS X.
+
+# show usage
+[ "$1" = "--help" ] && {
+ grep '^#/'< "$0" |
+ cut -c4-
+ exit 2
+}
+
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession \
-suspend
View
@@ -1,3 +0,0 @@
-cas_url='http://localhost:8080/cas-server-webapp-3.3.5/login'
-alias casup="$PROJECTS/cas/tomcat/bin/startup.sh & open $cas_url"
-alias casdown="$PROJECTS/cas/tomcat/bin/shutdown.sh"
View
@@ -1 +0,0 @@
-alias instances="ec2-describe-instances"
View
@@ -1,21 +0,0 @@
-# Use `hub` as our git wrapper:
-# http://defunkt.github.com/hub/
-git(){hub "$@"}
-ga() {
- git add .
- git add -u
-}
-alias g='git'
-alias gp='git pull --rebase --prune'
-alias gpush='git push origin HEAD'
-# alias glog="git log --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative"
-# alias gp='git push origin HEAD'
-alias gd='git diff'
-alias gc='git commit'
-alias gitc='git commit -m'
-# alias gca='git commit -a'
-alias gco='git checkout'
-alias gb='git branch'
-alias gss='git status -sb' # upgrade your git if -sb breaks for you. it's fun.
-alias gs='git status'
-# alias grm="git status | grep deleted | awk '{print \$3}' | xargs git rm"
View
@@ -1,23 +0,0 @@
-# Sample gitconfig
-#
-# I've pulled this out of version control because 1) I don't want my email
-# and GitHub token on my public repo, and 2) I tried using the system-wide
-# etc/gitconfig and it seems other clients don't always respect it (not to
-# mention dealing with it in homebrew sucks). Don't let that stop you; you
-# can symlink ~/.gitconfig to this file and go rock out with your git out!
-
-[user]
- name = Tim Clem
- email = timothy.clem@gmail.com
-[github]
- user = tclem
- token = 30105e012899452fc53ec28c637d988f
-[color]
- ui = true
-[rerere]
- enabled = true
-[alias]
- lol = log --oneline --graph --decorate
-[core]
- autocrlf = input
-
View
@@ -1 +0,0 @@
-[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm
View
@@ -1,10 +0,0 @@
-# grc overides for ls
-# Made possible through contributions from generous benefactors like
-# `brew install coreutils`
-if $(gls &>/dev/null)
-then
- alias ls="gls -F --color"
- alias l="gls -lAh --color"
- alias ll="gls -l --color"
- alias la='gls -A --color'
-fi
View
@@ -1 +0,0 @@
-#export EDITOR='mvim'
View
@@ -1,5 +0,0 @@
-# GRC colorizes nifty unix tools all over the place
-if $(gls &>/dev/null)
-then
- source `brew --prefix`/etc/grc.bashrc
-fi
View
@@ -1,6 +0,0 @@
-# Remove the hosts that I don't want to keep around- in this case, only
-# keep the first host. Like a boss.
-alias hosts="head -2 ~/.ssh/known_hosts | tail -1 > ~/.ssh/known_hosts"
-
-# Pipe my public key to my clipboard. Fuck you, pay me.
-alias pubkey="more ~/.ssh/id_dsa.public | pbcopy | echo '=> Public key copied to pasteboard.'"
View
@@ -1 +0,0 @@
-alias vs="vagrant status"
View
@@ -4,3 +4,14 @@ alias be='bundle exec'
alias reload!='. ~/.zshrc'
alias v=mvim
+
+alias pu='pushd'
+alias po='popd'
+alias ...='cd ../..'
+alias -- -='cd -'
+alias history='fc -l 1'
+
+alias lsa='ls -lah'
+alias l='ls -la'
+alias ll='ls -l'
+
View
@@ -0,0 +1,24 @@
+# ls colors
+autoload colors; colors;
+export LSCOLORS="Gxfxcxdxbxegedabagacad"
+#export LS_COLORS
+
+# Enable ls colors
+if [ "$DISABLE_LS_COLORS" != "true" ]
+then
+ # Find the option for using colors in ls, depending on the version: Linux or BSD
+ ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
+fi
+
+#setopt no_beep
+setopt auto_cd
+setopt multios
+setopt cdablevarS
+
+if [[ x$WINDOW != x ]]
+then
+ SCREEN_NO="%B$WINDOW%b "
+else
+ SCREEN_NO=""
+fi
+
View
@@ -1,11 +1,83 @@
+# Old settings
# matches case insensitive for lowercase
-zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
+# zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
# pasting with tabs doesn't perform completion
-zstyle ':completion:*' insert-tab pending
+# zstyle ':completion:*' insert-tab pending
# tab completion colors
+# zstyle ':completion:*' list-colors ''
+
+
+# New for oh-my-zsh
+# fixme - the load process here seems a bit bizarre
+
+unsetopt menu_complete # do not autoselect the first completion entry
+unsetopt flowcontrol
+setopt auto_menu # show completion menu on succesive tab press
+setopt complete_in_word
+setopt always_to_end
+
+WORDCHARS=''
+
+zmodload -i zsh/complist
+
+## case-insensitive (all),partial-word and then substring completion
+if [ "x$CASE_SENSITIVE" = "xtrue" ]; then
+ zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
+ unset CASE_SENSITIVE
+else
+ zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
+fi
+
zstyle ':completion:*' list-colors ''
-# zstyle ':completion:*' list-colors ${(s.:.)LSCOLORS}
-# zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
-# zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
+
+# should this be in keybindings?
+bindkey -M menuselect '^o' accept-and-infer-next-history
+
+zstyle ':completion:*:*:*:*:*' menu select
+zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
+zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w"
+
+# disable named-directories autocompletion
+zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
+cdpath=(.)
+
+# use /etc/hosts and known_hosts for hostname completion
+[ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
+[ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
+hosts=(
+ "$_ssh_hosts[@]"
+ "$_etc_hosts[@]"
+ `hostname`
+ localhost
+)
+zstyle ':completion:*:hosts' hosts $hosts
+
+# Use caching so that commands like apt and dpkg complete are useable
+zstyle ':completion::complete:*' use-cache 1
+zstyle ':completion::complete:*' cache-path ~/.oh-my-zsh/cache/
+
+# Don't complete uninteresting users
+zstyle ':completion:*:*:*:users' ignored-patterns \
+ adm amanda apache avahi beaglidx bin cacti canna clamav daemon \
+ dbus distcache dovecot fax ftp games gdm gkrellmd gopher \
+ hacluster haldaemon halt hsqldb ident junkbust ldap lp mail \
+ mailman mailnull mldonkey mysql nagios \
+ named netdump news nfsnobody nobody nscd ntp nut nx openvpn \
+ operator pcap postfix postgres privoxy pulse pvm quagga radvd \
+ rpc rpcuser rpm shutdown squid sshd sync uucp vcsa xfs
+
+# ... unless we really want to.
+zstyle '*' single-ignored show
+
+if [ "x$COMPLETION_WAITING_DOTS" = "xtrue" ]; then
+ expand-or-complete-with-dots() {
+ echo -n "\e[31m......\e[0m"
+ zle expand-or-complete
+ zle redisplay
+ }
+ zle -N expand-or-complete-with-dots
+ bindkey "^I" expand-or-complete-with-dots
+fi
+
Oops, something went wrong.

0 comments on commit a2c4713

Please sign in to comment.