Permalink
Browse files

Forcing yadr and presto play nice.

  • Loading branch information...
forest committed Sep 21, 2012
1 parent d087ec1 commit fd8238091eda89a412e74f6f07f4b386dbb962f7
Showing with 436 additions and 25 deletions.
  1. +8 −9 Rakefile
  2. +25 −0 config/schedule.rb
  3. +4 −5 gitconfig
  4. +63 −0 maid/rules.rb
  5. +2 −2 yadr/custom/zsh/after/aliases.zsh
  6. +1 −1 yadr/custom/zsh/after/base.zsh
  7. +20 −8 yadr/custom/zsh/before/base.zsh
  8. +29 −0 zlogin
  9. +14 −0 zlogout
  10. +126 −0 zpreztorc
  11. +7 −0 zprofile
  12. +100 −0 zshenv
  13. +37 −0 zshrc
View
@@ -4,11 +4,11 @@ require 'erb'
desc "install the dot files into user's home directory"
task :install do
# clone oh-my-zsh if it doesn't already exist
unless File.directory?(File.join(ENV['HOME'], '.oh-my-zsh'))
#system %Q{git clone https://github.com/sorin-ionescu/oh-my-zsh.git ~/.oh-my-zsh}
system %Q{git clone git://github.com/robbyrussell/oh-my-zsh.git "$HOME/.oh-my-zsh"}
system %Q{cd ~/.oh-my-zsh && git submodule update --init --recursive && cd ..}
end
# unless File.directory?(File.join(ENV['HOME'], '.oh-my-zsh'))
# #system %Q{git clone https://github.com/sorin-ionescu/oh-my-zsh.git ~/.oh-my-zsh}
# system %Q{git clone git://github.com/robbyrussell/oh-my-zsh.git "$HOME/.oh-my-zsh"}
# system %Q{cd ~/.oh-my-zsh && git submodule update --init --recursive && cd ..}
# end
replace_all = false
Dir['*'].each do |file|
@@ -41,8 +41,7 @@ task :install do
# yadr configs and aliases
# link yadr/custom/* into ~/.yadr/custom/*
Dir['yadr/custom/*'].each do |folder|
puts "linking ~/.#{folder}"
system %Q{echo ln -s "$PWD/#{folder}" "$HOME/.#{folder}"}
link_folder(folder)
end
# run custom setup scripts
@@ -64,11 +63,11 @@ def link_file(file)
end
else
puts "linking ~/.#{file}"
system %Q{ln -s "$PWD/#{file}" "$HOME/.#{file}"}
system %Q{ln -is "$PWD/#{file}" "$HOME/.#{file}"}
end
end
def link_folder(folder)
puts "linking ~/.#{folder}"
system %Q{echo ln -s "$PWD/#{folder}/" "$HOME/.#{folder}"}
system %Q{ln -is "$PWD/#{folder}/" "$HOME/.#{folder}"}
end
View
@@ -0,0 +1,25 @@
# Use this file to easily define all of your cron jobs.
#
# It's helpful, but not entirely necessary to understand cron before proceeding.
# http://en.wikipedia.org/wiki/Cron
# Example:
#
# set :output, "/path/to/my/cron_log.log"
#
# every 2.hours do
# command "/usr/bin/some_great_command"
# runner "MyModel.some_method"
# rake "some:great:rake:task"
# end
#
# every 4.days do
# runner "AnotherModel.prune_old_records"
# end
# Learn more: http://github.com/javan/whenever
every 1.hour do
command '/bin/bash -li -c "maid --silent"'
end
View
@@ -139,13 +139,12 @@
enabled = true
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
path =
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[user]
name = $(GIT_AUTHOR_NAME)
email = $(GIT_AUTHOR_EMAIL)
name = Forest Carlisle
email = forestcarlisle@gmail.com
[github]
user = $(GITHUB_USER)
token = $(GITHUB_TOKEN)
user = forest
View
@@ -0,0 +1,63 @@
# Sample Maid rules file -- a sampling to get you started.
#
# To use, remove ".sample" from the filename. Test using:
#
# maid -n
#
# For more help on Maid:
#
# * Run `maid help`
# * Read the README at http://github.com/benjaminoakes/maid
# * For more DSL helper methods, please see the documentation of Maid::Tools at http://rubydoc.info/gems/maid/0.1.0/Maid/Tools
# * Come up with some cool tools of your own? Fork, make your changes, and send me a pull request on GitHub!
# * Ask me a question over email (hello@benjaminoakes.com) or Twitter (@benjaminoakes)
#
Maid.rules do
# NOTE: Currently, only Mac OS X supports `duration_s`.
rule 'MP3s likely to be music' do
dir('~/Downloads/*.mp3').each do |path|
if duration_s(path) > 30.0
move(path, '~/Music/iTunes/iTunes Media/Automatically Add to iTunes/')
end
end
end
# NOTE: Currently, only Mac OS X supports `downloaded_from`.
rule 'Old files downloaded while developing/testing' do
dir('~/Downloads/*').each do |path|
if downloaded_from(path).any? {|u| u.match 'http://localhost' || u.match('http://beta.lessonplanet.com') } && 1.week.since?(last_accessed(path))
trash(path)
end
end
end
rule 'Linux ISOs, etc' do
dir('~/Downloads/*.iso').each { |p| trash p }
end
rule 'Linux applications in Debian packages' do
dir('~/Downloads/*.deb').each { |p| trash p }
end
rule 'Mac OS X applications in disk images' do
dir('~/Downloads/*.dmg').each { |p| trash p }
end
rule 'Mac OS X applications in zip files' do
dir('~/Downloads/*.zip').select do |path|
candidates = zipfile_contents(path)
candidates.any? { |c| c.match(/\.app$/) }
end.each { |p| trash p }
end
rule 'Misc Screenshots' do
dir('~/Desktop/Screen Shot *').each do |path|
if 1.day.since?(last_accessed(path))
# move(path, '~/Documents/Misc Screenshots/')
trash path
end
end
end
# Add your own rules here.
end
@@ -104,8 +104,8 @@ alias pgstart='pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/serv
alias pgstop='pg_ctl -D /usr/local/var/postgres stop -s -m fast'
# mysql
alias mysstart='mysql.server start'
alias mysstop='mysql.server stop'
alias mystart='mysql.server start'
alias mystop='mysql.server stop'
# foreman
alias fs='foreman start'
@@ -19,7 +19,7 @@ export PATH="$HOME/bin:$HOME/.bin:$HOME/.rvm/bin:/usr/local/homebrew/bin:/usr/lo
export MSGMERGE_PATH="/usr/local/Cellar/gettext/0.18.1.1/bin/msgmerge"
# use .localrc for settings specific to one system
[[ -f ~/.localrc ]] && . ~/.localrc
[[ -f ~/.localrc ]] && source ~/.localrc
# @see http://vim.1045645.n5.nabble.com/MacVim-and-PATH-tt3388705.html#a3392363
# Ensure MacVim has same shell as Terminal
@@ -3,20 +3,32 @@
# plugins=(vi-mode ruby osx rails3 git brew cap gem git github heroku redis-cli rvm bundler fasd history-substring-search)
# plugins=(vi-mode rvm ruby bundler git osx rails terminal completion history utility syntax-highlighting history-substring-search prompt)
# Set the Oh My Zsh modules to load (browse modules).
zstyle ':omz:load' omodule 'environment' 'terminal' 'editor' 'completion' \
'ruby' 'git' 'osx' 'rails' \
'history' 'directory' 'spectrum' 'utility' \
'syntax-highlighting' 'prompt' 'history-substring-search'
# zstyle ':prezto:load' pmodule \
# 'environment' \
# 'terminal' \
# 'editor' \
# 'ruby' \
# 'git' \
# 'rails' \
# 'osx' \
# 'history' \
# 'directory' \
# 'spectrum' \
# 'utility' \
# 'completion' \
# 'syntax-highlighting' \
# 'prompt' \
# 'history-substring-search'
# set your theme.
export ZSH_THEME="steeef"
zstyle ':omz:module:prompt' theme 'steeef'
# export ZSH_THEME="steeef"
# zstyle ':prezto:module:prompt' theme 'steeef'
# kennethreitz
# steeef
# Need to force init of sorin OMZ becasue the plugins hook only works for
# robbyrussel OMZ. LAME yadr!
# Set the path to Oh My Zsh.
export OMZ="$HOME/.oh-my-zsh"
# export OMZ="$HOME/.oh-my-zsh"
# This will make you shout: OH MY ZSHELL!
source "$OMZ/init.zsh"
# source "$OMZ/init.zsh"
View
29 zlogin
@@ -0,0 +1,29 @@
#
# Executes commands at login post-zshrc.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Execute code that does not affect the current session in the background.
{
# Compile the completion dump to increase startup speed.
zcompdump="${ZDOTDIR:-$HOME}/.zcompdump"
if [[ "$zcompdump" -nt "${zcompdump}.zwc" || ! -s "${zcompdump}.zwc" ]]; then
zcompile "$zcompdump"
fi
# Set environment variables for launchd processes.
if [[ "$OSTYPE" == darwin* ]]; then
for env_var in PATH MANPATH; do
launchctl setenv "$env_var" "${(P)env_var}"
done
fi
} &!
# Print a random, hopefully interesting, adage.
if (( $+commands[fortune] )); then
fortune -a
print
fi
View
14 zlogout
@@ -0,0 +1,14 @@
#
# Executes commands at logout.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Print the message.
cat <<-EOF
Thank you. Come again!
-- Dr. Apu Nahasapeemapetilon
EOF
View
126 zpreztorc
@@ -0,0 +1,126 @@
#
# Sets Prezto options.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
#
# General
#
# Set case-sensitivity for completion, history lookup, etc.
zstyle ':prezto:*:*' case-sensitive 'no'
# Color output (auto set to 'no' on dumb terminals).
zstyle ':prezto:*:*' color 'yes'
# Set the Zsh modules to load (man zshmodules).
# zstyle ':prezto:load' zmodule 'attr' 'stat'
# Set the Zsh functions to load (man zshcontrib).
# zstyle ':prezto:load' zfunction 'zargs' 'zmv'
# Set the Prezto modules to load (browse modules).
# The order matters.
zstyle ':prezto:load' pmodule \
'environment' \
'terminal' \
'editor' \
'ruby' \
'git' \
'rails' \
'osx' \
'history' \
'directory' \
'spectrum' \
'utility' \
'completion' \
'syntax-highlighting' \
'prompt' \
'history-substring-search'
#
# Editor
#
# Set the key mapping style to 'emacs' or 'vi'.
zstyle ':prezto:module:editor' keymap 'vi'
# Auto convert .... to ../..
# zstyle ':prezto:module:editor' dot-expansion 'yes'
#
# Git
#
# Ignore submodules when they are 'dirty', 'untracked', 'all', or 'none'.
# zstyle ':prezto:module:git:ignore' submodule 'all'
#
# GNU Utility
#
# Set the command prefix on non-GNU systems.
# zstyle ':prezto:module:gnu-utility' prefix 'g'
#
# Pacman
#
# Set the Pacman frontend.
# zstyle ':prezto:module:pacman' frontend 'yaourt'
#
# Prompt
#
# Set the prompt theme to load.
# Setting it to 'random' loads a random theme.
# Auto set to 'off' on dumb terminals.
zstyle ':prezto:module:prompt' theme 'steeef'
#
# Screen
#
# Auto start a session when Zsh is launched.
# zstyle ':prezto:module:screen' auto-start 'yes'
#
# SSH-Agent
#
# Enable ssh-agent forwarding.
# zstyle ':prezto:module:ssh-agent' forwarding 'yes'
# Set ssh-agent identities to load.
zstyle ':prezto:module:ssh-agent' identities 'id_rsa'
#
# Syntax Highlighting
#
# Set syntax highlighters.
# By default main, brackets, and cursor are enabled.
# zstyle ':prezto:module:syntax-highlighting' highlighters \
# 'main' \
# 'brackets' \
# 'pattern' \
# 'cursor' \
# 'root'
#
# Terminal
#
# Auto set the tab and window titles.
zstyle ':prezto:module:terminal' auto-title 'yes'
#
# Tmux
#
# Auto start a session when Zsh is launched.
# zstyle ':prezto:module:tmux' auto-start 'yes'
View
@@ -0,0 +1,7 @@
#
# Executes commands at login pre-zshrc.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
Oops, something went wrong.

0 comments on commit fd82380

Please sign in to comment.