Merge pull request #13 from kylewest/simple-automated-install
Simple automated installer. Use: rake install
This commit is contained in:
85
README.md
85
README.md
@@ -8,8 +8,8 @@
|
|||||||
# Yet Another Dotfile Repo v0.8
|
# Yet Another Dotfile Repo v0.8
|
||||||
# Alpha Release Please Report Bugs
|
# Alpha Release Please Report Bugs
|
||||||
|
|
||||||
git clone https://github.com/skwp/dotfiles ~/.dotfiles
|
git clone https://github.com/skwp/dotfiles ~/.yadr
|
||||||
~/.dotfiles/bin/yadr/yadr init-plugins
|
cd ~/.yadr && rake install
|
||||||
|
|
||||||
# Your dotfiles are safe! YADR will not
|
# Your dotfiles are safe! YADR will not
|
||||||
# overwrite anything. Please read on for
|
# overwrite anything. Please read on for
|
||||||
@@ -109,28 +109,29 @@ gem install awesome_print
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
This project uses git submodules for its plugins, but this is handled
|
Installation is automated via `rake` and the `yadr` command. To get
|
||||||
for you by the `yadr` command. Please run:
|
started please run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/skwp/dotfiles ~/.dotfiles
|
git clone https://github.com/skwp/dotfiles ~/.yadr
|
||||||
~/.dotfiles/bin/yadr/yadr init-plugins
|
cd ~/.yadr && rake install
|
||||||
```
|
```
|
||||||
|
|
||||||
NOTE: by default, YADR will not touch any of your files. You have to manually
|
Note: YADR will not destroy any of your files unless you tell it to.
|
||||||
activate each of its components, if you choose, by following the sections below.
|
|
||||||
Eventually these will be automated.
|
|
||||||
|
|
||||||
If you pull new changes, be sure to run this to init all the submodules:
|
|
||||||
|
## Upgrading
|
||||||
|
|
||||||
|
Upgrading is easy.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yadr init-plugins
|
cd ~/.yadr
|
||||||
|
git pull origin master
|
||||||
|
rake install
|
||||||
```
|
```
|
||||||
|
|
||||||
After you install yadr shell aliases, you can use the *yip* alias to do the same.
|
|
||||||
|
|
||||||
|
### ZSH
|
||||||
### Setup for ZSH
|
|
||||||
|
|
||||||
After a lifetime of bash, I am now using ZSH as my default shell because of its awesome globbing
|
After a lifetime of bash, I am now using ZSH as my default shell because of its awesome globbing
|
||||||
and autocomplete features (the spelling fixer autocomplete is worth the money alone).
|
and autocomplete features (the spelling fixer autocomplete is worth the money alone).
|
||||||
@@ -141,53 +142,37 @@ restores the only feature that I felt was 'broken' which is the Ctrl-R reverse h
|
|||||||
While I am not going to support bash out of the box here, YADR _should_ work with bash if
|
While I am not going to support bash out of the box here, YADR _should_ work with bash if
|
||||||
you just source the _aliases_ file. However, you soul will sing if you install zsh. I promise.
|
you just source the _aliases_ file. However, you soul will sing if you install zsh. I promise.
|
||||||
|
|
||||||
**Install zsh pain free, automatically:**
|
|
||||||
|
|
||||||
```bash
|
|
||||||
curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh
|
|
||||||
```
|
|
||||||
|
|
||||||
Place this as the last line in your ~/.zshrc created by oh-my-zsh:
|
|
||||||
|
|
||||||
source ~/.dotfiles/zsh/zshrc
|
|
||||||
|
|
||||||
Or, to make things simpler you can just use the YADR-provided zsh/oh_my_zsh_zshrc
|
|
||||||
Please note that this relies on the skwp fork of oh-my-zsh which contains skwp.theme
|
|
||||||
|
|
||||||
```bash
|
|
||||||
ln -sf ~/.dotfiles/zsh/oh_my_zsh_zshrc ~/.zshrc
|
|
||||||
```
|
|
||||||
|
|
||||||
Lots of things I do every day are done with two or three character
|
Lots of things I do every day are done with two or three character
|
||||||
mnemonic aliases. Please feel free to edit them:
|
mnemonic aliases. Please feel free to edit them:
|
||||||
|
|
||||||
ae # alias edit
|
ae # alias edit
|
||||||
ar # alias reload
|
ar # alias reload
|
||||||
|
|
||||||
**Customized zsh provided by ~/.dotfiles/zshrc:**
|
**ZSH Customizations**
|
||||||
|
|
||||||
* Vim mode
|
* Vim mode
|
||||||
* Bash style ctrl-R for reverse history finder
|
* Bash style ctrl-R for reverse history finder
|
||||||
* Fuzzy matching - if you mistype a directory name, tab completion will fix it
|
* Fuzzy matching - if you mistype a directory name, tab completion will fix it
|
||||||
|
|
||||||
|
|
||||||
### Setup for Pry
|
### Pry
|
||||||
|
|
||||||
Pry (http://pry.github.com/) offers a much better out of the box IRB experience
|
Pry (http://pry.github.com/) offers a much better out of the box IRB experience
|
||||||
with colors, tab completion, and lots of other tricks. You should:
|
with colors, tab completion, and lots of other tricks. You should:
|
||||||
|
|
||||||
|
#### Install the gem
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
gem install pry
|
gem install pry
|
||||||
gem install awesome_print
|
gem install awesome_print
|
||||||
ln -s ~/.dotfiles/irb/pryrc ~/.pryrc
|
|
||||||
ln -s ~/.dotfiles/irb/aprc ~/.aprc
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Use pry**
|
#### Use pry
|
||||||
|
|
||||||
* as irb: `pry`
|
* as irb: `pry`
|
||||||
* as rails console: script/console --irb=pry
|
* as rails console: `script/console --irb=pry`
|
||||||
|
|
||||||
**Pry customizations:**
|
#### Pry Customizations:
|
||||||
|
|
||||||
* `clear` command to clear screen
|
* `clear` command to clear screen
|
||||||
* `sql` command to execute something (within a rails console)
|
* `sql` command to execute something (within a rails console)
|
||||||
@@ -196,17 +181,12 @@ ln -s ~/.dotfiles/irb/aprc ~/.aprc
|
|||||||
* type `help` to see all the commands
|
* type `help` to see all the commands
|
||||||
|
|
||||||
|
|
||||||
### Setup for Git
|
### Git
|
||||||
|
|
||||||
**To use the gitconfig (some of the git bash aliases rely on my git aliases)**
|
#### User Info
|
||||||
|
|
||||||
```bash
|
Since the gitconfig doesn't contain the user info, I recommend using env variables. Put the following in
|
||||||
ln -s ~/.dotfiles/gitconfig ~/.gitconfig
|
your `~/.secrets` file which is automatically referenced by the provided zshrc:
|
||||||
```
|
|
||||||
|
|
||||||
Since the gitconfig doesn't contain the user info, I recommend using env variables.
|
|
||||||
|
|
||||||
**Put the following in your ~/.secrets file which is automatically referenced by the provided zshrc:**
|
|
||||||
|
|
||||||
# Set your git user info
|
# Set your git user info
|
||||||
export GIT_AUTHOR_NAME='Your Name'
|
export GIT_AUTHOR_NAME='Your Name'
|
||||||
@@ -218,7 +198,7 @@ Since the gitconfig doesn't contain the user info, I recommend using env variabl
|
|||||||
export GITHUB_USER='your_user_name'
|
export GITHUB_USER='your_user_name'
|
||||||
export GITHUB_TOKEN='your_github_token'
|
export GITHUB_TOKEN='your_github_token'
|
||||||
|
|
||||||
**Some of the customizations provided include:**
|
#### Git Customizations:
|
||||||
|
|
||||||
* `git l` - a much more usable git log
|
* `git l` - a much more usable git log
|
||||||
* `git b` - a list of branches with summary of last commit
|
* `git b` - a list of branches with summary of last commit
|
||||||
@@ -232,14 +212,7 @@ Since the gitconfig doesn't contain the user info, I recommend using env variabl
|
|||||||
* `git unstage` (remove from index) and `git uncommit` (revert to the time prior to the last commit - dangerous if already pushed) aliases
|
* `git unstage` (remove from index) and `git uncommit` (revert to the time prior to the last commit - dangerous if already pushed) aliases
|
||||||
|
|
||||||
|
|
||||||
### Setup for Vim
|
### Vim
|
||||||
|
|
||||||
To use the vim files:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
ln -s ~/.dotfiles/vimrc ~/.vimrc
|
|
||||||
ln -s ~/.dotfiles/vim ~/.vim
|
|
||||||
```
|
|
||||||
|
|
||||||
The .vimrc is well commented and broken up by settings. I encourage you
|
The .vimrc is well commented and broken up by settings. I encourage you
|
||||||
to take a look and learn some of my handy aliases, or comment them out
|
to take a look and learn some of my handy aliases, or comment them out
|
||||||
|
|||||||
70
Rakefile
Normal file
70
Rakefile
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
require 'rake'
|
||||||
|
|
||||||
|
desc "Hook our dotfiles into system-standard positions."
|
||||||
|
task :install => :submodules do
|
||||||
|
# this has all the linkables from this directory.
|
||||||
|
linkables = []
|
||||||
|
linkables += Dir.glob('git/*') if want_to_install?('git')
|
||||||
|
linkables += Dir.glob('irb/*') if want_to_install?('irb/pry')
|
||||||
|
linkables += Dir.glob('{vim,vimrc}') if want_to_install?('vim')
|
||||||
|
linkables += Dir.glob('zsh/zshrc') if want_to_install?('zsh')
|
||||||
|
|
||||||
|
skip_all = false
|
||||||
|
overwrite_all = false
|
||||||
|
backup_all = false
|
||||||
|
|
||||||
|
linkables.each do |linkable|
|
||||||
|
file = linkable.split('/').last
|
||||||
|
source = "#{ENV["PWD"]}/#{linkable}"
|
||||||
|
target = "#{ENV["HOME"]}/.#{file}"
|
||||||
|
|
||||||
|
puts "--------"
|
||||||
|
puts "file: #{file}"
|
||||||
|
puts "source: #{source}"
|
||||||
|
puts "target: #{target}"
|
||||||
|
|
||||||
|
if File.exists?(target) || File.symlink?(target)
|
||||||
|
unless skip_all || overwrite_all || backup_all
|
||||||
|
puts "File already exists: #{target}, what do you want to do? [s]kip, [S]kip all, [o]verwrite, [O]verwrite all, [b]ackup, [B]ackup all"
|
||||||
|
case STDIN.gets.chomp
|
||||||
|
when 'o' then overwrite = true
|
||||||
|
when 'b' then backup = true
|
||||||
|
when 'O' then overwrite_all = true
|
||||||
|
when 'B' then backup_all = true
|
||||||
|
when 'S' then skip_all = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
FileUtils.rm_rf(target) if overwrite || overwrite_all
|
||||||
|
`mv "$HOME/.#{file}" "$HOME/.#{file}.backup"` if backup || backup_all
|
||||||
|
end
|
||||||
|
`ln -s "#{source}" "#{target}"`
|
||||||
|
end
|
||||||
|
success_msg("installed")
|
||||||
|
end
|
||||||
|
|
||||||
|
desc "Init and update submodules."
|
||||||
|
task :submodules do
|
||||||
|
sh('git submodule update --init')
|
||||||
|
end
|
||||||
|
|
||||||
|
task :default => 'install'
|
||||||
|
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def want_to_install? (section)
|
||||||
|
puts "Would you like to install configuration files for: #{section}? [y]es, [n]o"
|
||||||
|
STDIN.gets.chomp == 'y'
|
||||||
|
end
|
||||||
|
|
||||||
|
def success_msg(action)
|
||||||
|
puts ""
|
||||||
|
puts " _ _ _ "
|
||||||
|
puts " | | | | | | "
|
||||||
|
puts " | |___| |_____ __| | ____ "
|
||||||
|
puts " |_____ (____ |/ _ |/ ___) "
|
||||||
|
puts " _____| / ___ ( (_| | | "
|
||||||
|
puts " (_______\_____|\____|_| "
|
||||||
|
puts ""
|
||||||
|
puts "YADR has been #{action}. Please restart your terminal and vim."
|
||||||
|
end
|
||||||
@@ -1,2 +1,4 @@
|
|||||||
Dir[File.join(File.dirname(__FILE__),"lib/**/lib")].each {|dir| $LOAD_PATH << dir}
|
Dir[File.join(File.dirname(__FILE__),"lib/**/lib")].each {|dir| $LOAD_PATH << dir}
|
||||||
require 'git-style-binary/command'
|
require 'git-style-binary/command'
|
||||||
|
|
||||||
|
$yadr = `find -L ~ -type file -maxdepth 2 -name .yadr | head | sed 's:\.yadr\/::'`.chomp
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
require File.join(File.dirname(__FILE__), 'default_libs')
|
require File.join(File.dirname(__FILE__), 'default_libs')
|
||||||
# GitStyleBinary.primary do
|
# GitStyleBinary.primary do
|
||||||
#
|
#
|
||||||
# end
|
# end
|
||||||
# GitStyleBinary.command do
|
# GitStyleBinary.command do
|
||||||
# version "yadr 1.0"
|
# version "yadr 1.0"
|
||||||
# banner <<-EOS
|
# banner <<-EOS
|
||||||
# Welcome to YADR, Yet Another Dotfile Repo Manager
|
# Welcome to YADR, Yet Another Dotfile Repo Manager
|
||||||
# Usage: yadr #{all_options_string}
|
# Usage: yadr #{all_options_string}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ GitStyleBinary.command do
|
|||||||
short_desc "Initialize all submodules. Run this every time you pull a new yadr version."
|
short_desc "Initialize all submodules. Run this every time you pull a new yadr version."
|
||||||
|
|
||||||
run do |command|
|
run do |command|
|
||||||
system("cd ~/.dotfiles && git submodule init && git submodule update")
|
`cd "#{$yadr}" && git submodule update --init`
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
require File.join(File.dirname(__FILE__), 'default_libs')
|
require File.join(File.dirname(__FILE__), 'default_libs')
|
||||||
|
|
||||||
GitStyleBinary.command do
|
GitStyleBinary.command do
|
||||||
version "yadr-add-vim-plugin 1.0"
|
version "yadr-add-vim-plugin 1.0"
|
||||||
|
|
||||||
short_desc "Add a vim plugin from a github repo"
|
short_desc "Add a vim plugin from a github repo"
|
||||||
opt :url, "Github url (http:// or git://)", :type => String
|
opt :url, "Github url (http:// or git://)", :type => String
|
||||||
@@ -14,7 +14,7 @@ GitStyleBinary.command do
|
|||||||
begin
|
begin
|
||||||
repo=command[:url]
|
repo=command[:url]
|
||||||
bundle_path=repo.gsub("https://github.com/","").gsub(".git","").gsub("/","-").gsub(".vim","")
|
bundle_path=repo.gsub("https://github.com/","").gsub(".git","").gsub("/","-").gsub(".vim","")
|
||||||
system("cd ~/.dotfiles && git submodule add #{repo} vim/bundle/#{bundle_path}")
|
system("cd #{$yadr} && git submodule add #{repo} vim/bundle/#{bundle_path}")
|
||||||
rescue
|
rescue
|
||||||
puts "Sorry, couldn't parse your path: #{$!}"
|
puts "Sorry, couldn't parse your path: #{$!}"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,12 +2,11 @@
|
|||||||
require File.join(File.dirname(__FILE__), 'default_libs')
|
require File.join(File.dirname(__FILE__), 'default_libs')
|
||||||
|
|
||||||
GitStyleBinary.command do
|
GitStyleBinary.command do
|
||||||
version "yadr-vim-update-plugins 1.0"
|
version "yadr-vim-update-plugins 1.0"
|
||||||
|
short_desc "Update all vim plugins to latest versions from github"
|
||||||
short_desc "Update all vim plugins to latest versions from github"
|
|
||||||
|
|
||||||
run do |command|
|
run do |command|
|
||||||
system("cd ~/.dotfiles && git submodule foreach git pull origin master")
|
`cd "#{$yadr}" && git submodule foreach git pull origin master`
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
112
git/gitconfig
Normal file
112
git/gitconfig
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
# set your user tokens as enivornment variables, such as ~/.secrets
|
||||||
|
# See the README for examples.
|
||||||
|
[color]
|
||||||
|
ui = true
|
||||||
|
[color "branch"]
|
||||||
|
current = yellow reverse
|
||||||
|
local = yellow
|
||||||
|
remote = green
|
||||||
|
[color "diff"]
|
||||||
|
meta = yellow bold
|
||||||
|
frag = magenta bold
|
||||||
|
old = red bold
|
||||||
|
new = green bold
|
||||||
|
[alias]
|
||||||
|
# add
|
||||||
|
a = add # add
|
||||||
|
chunkyadd = add --patch # stage commits chunk by chunk
|
||||||
|
|
||||||
|
# branch
|
||||||
|
b = branch -v # branch (verbose)
|
||||||
|
|
||||||
|
# commit
|
||||||
|
c = commit -m # commit with message
|
||||||
|
ca = commit -am # commit all with message
|
||||||
|
ci = commit # commit
|
||||||
|
amend = commit --amend # ammend your last commit
|
||||||
|
ammend = commit --amend # ammend your last commit
|
||||||
|
|
||||||
|
# checkout
|
||||||
|
co = checkout # checkout
|
||||||
|
nb = checkout -b # create and switch to a new branch (mnemonic: "git new branch branchname...")
|
||||||
|
|
||||||
|
# cherry-pick
|
||||||
|
cp = cherry-pick -x # grab a change from a branch
|
||||||
|
|
||||||
|
# diff
|
||||||
|
d = diff # diff unstaged changes
|
||||||
|
dc = diff --cached # diff staged changes
|
||||||
|
last = diff HEAD^ # diff last committed change
|
||||||
|
|
||||||
|
# log
|
||||||
|
log = log --decorate --graph --date=short
|
||||||
|
l = log
|
||||||
|
changes = log --pretty=format:\"%h %cr %cn %Cgreen%s%Creset\" --name-status
|
||||||
|
short = log --pretty=format:\"%h %cr %cn %Cgreen%s%Creset\"
|
||||||
|
changelog = log --pretty=format:\" * %s\"
|
||||||
|
shortnocolor = log --pretty=format:\"%h %cr %cn %s\"
|
||||||
|
|
||||||
|
# pull
|
||||||
|
pl = pull # pull
|
||||||
|
|
||||||
|
# push
|
||||||
|
ps = push # push
|
||||||
|
|
||||||
|
# rebase
|
||||||
|
rc = rebase --continue # continue rebase
|
||||||
|
rs = rebase --skip # skip rebase
|
||||||
|
|
||||||
|
# remote
|
||||||
|
r = remote -v # show remotes (verbose)
|
||||||
|
|
||||||
|
# reset
|
||||||
|
unstage = reset HEAD # remove files from index (tracking)
|
||||||
|
uncommit = reset --soft HEAD^ # go back before last commit, with files in uncommitted state
|
||||||
|
filelog = log -u # show changes to a file
|
||||||
|
mt = mergetool # fire up the merge tool
|
||||||
|
|
||||||
|
# stash
|
||||||
|
ss = stash # stash changes
|
||||||
|
sl = stash list # list stashes
|
||||||
|
sa = stash apply # apply stash (restore changes)
|
||||||
|
sd = stash drop # drop stashes (destory changes)
|
||||||
|
|
||||||
|
# status
|
||||||
|
s = status # status
|
||||||
|
st = status # status
|
||||||
|
stat = status # status
|
||||||
|
|
||||||
|
# tag
|
||||||
|
t = tag -n # show tags with <n> lines of each tag message
|
||||||
|
|
||||||
|
# svn helpers
|
||||||
|
svnr = svn rebase
|
||||||
|
svnd = svn dcommit
|
||||||
|
svnl = svn log --oneline --show-commit
|
||||||
|
[format]
|
||||||
|
pretty = format:%C(blue)%ad%Creset %C(yellow)%h%C(green)%d%Creset %C(blue)%s %C(magenta) [%an]%Creset
|
||||||
|
[merge]
|
||||||
|
summary = true
|
||||||
|
verbosity = 1
|
||||||
|
[apply]
|
||||||
|
whitespace = nowarn
|
||||||
|
[branch]
|
||||||
|
autosetupmerge = true
|
||||||
|
[push]
|
||||||
|
# 'git push' will push the current branch to its tracking branch
|
||||||
|
# the usual default is to push all branches
|
||||||
|
default = tracking
|
||||||
|
[core]
|
||||||
|
autocrlf = false
|
||||||
|
editor = vim
|
||||||
|
excludesfile = ~/.dotfiles/gitignore_global
|
||||||
|
[advice]
|
||||||
|
statusHints = false
|
||||||
|
[diff]
|
||||||
|
# Git diff will use (i)ndex, (w)ork tree, (c)ommit and (o)bject
|
||||||
|
# instead of a/b/c/d as prefixes for patches
|
||||||
|
mnemonicprefix = true
|
||||||
|
[rerere]
|
||||||
|
# Remember my merges
|
||||||
|
# http://gitfu.wordpress.com/2008/04/20/git-rerere-rereremember-what-you-did-last-time/
|
||||||
|
enabled = true
|
||||||
32
git/gitignore
Normal file
32
git/gitignore
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# OSX taken from: https://github.com/github/gitignore/blob/master/Global/OSX.gitignore
|
||||||
|
# ----------------------------------------------------------------------------------------------
|
||||||
|
.DS_Store
|
||||||
|
# Thumbnails
|
||||||
|
._*
|
||||||
|
# Files that might appear on external disk
|
||||||
|
.Spotlight-V100
|
||||||
|
.Trashes
|
||||||
|
|
||||||
|
# Windows taken from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore
|
||||||
|
# ----------------------------------------------------------------------------------------------
|
||||||
|
# Windows image file caches
|
||||||
|
Thumbs.db
|
||||||
|
|
||||||
|
# Folder config file
|
||||||
|
Desktop.ini
|
||||||
|
|
||||||
|
# Tags taken from: https://github.com/github/gitignore/blob/master/Global/Tags.gitignore
|
||||||
|
# ----------------------------------------------------------------------------------------------
|
||||||
|
# Ignore tags created by etags and ctags
|
||||||
|
TAGS
|
||||||
|
tags
|
||||||
|
|
||||||
|
# Vim taken from: https://github.com/github/gitignore/blob/master/Global/vim.gitignore
|
||||||
|
# ----------------------------------------------------------------------------------------------
|
||||||
|
.*.sw[a-z]
|
||||||
|
*.un~
|
||||||
|
Session.vim
|
||||||
|
|
||||||
|
# SASS
|
||||||
|
# ----------------------------------------------------------------------------------------------
|
||||||
|
.sass-cache
|
||||||
112
gitconfig
112
gitconfig
@@ -1,112 +0,0 @@
|
|||||||
# set your user tokens as enivornment variables, such as ~/.secrets
|
|
||||||
# See the README for examples.
|
|
||||||
[color]
|
|
||||||
ui = true
|
|
||||||
[color "branch"]
|
|
||||||
current = yellow reverse
|
|
||||||
local = yellow
|
|
||||||
remote = green
|
|
||||||
[color "diff"]
|
|
||||||
meta = yellow bold
|
|
||||||
frag = magenta bold
|
|
||||||
old = red bold
|
|
||||||
new = green bold
|
|
||||||
[alias]
|
|
||||||
# add
|
|
||||||
a = add # add
|
|
||||||
chunkyadd = add --patch # stage commits chunk by chunk
|
|
||||||
|
|
||||||
# branch
|
|
||||||
b = branch -v # branch (verbose)
|
|
||||||
|
|
||||||
# commit
|
|
||||||
c = commit -m # commit with message
|
|
||||||
ca = commit -am # commit all with message
|
|
||||||
ci = commit # commit
|
|
||||||
amend = commit --amend # ammend your last commit
|
|
||||||
ammend = commit --amend # ammend your last commit
|
|
||||||
|
|
||||||
# checkout
|
|
||||||
co = checkout # checkout
|
|
||||||
nb = checkout -b # create and switch to a new branch (mnemonic: "git new branch branchname...")
|
|
||||||
|
|
||||||
# cherry-pick
|
|
||||||
cp = cherry-pick -x # grab a change from a branch
|
|
||||||
|
|
||||||
# diff
|
|
||||||
d = diff # diff unstaged changes
|
|
||||||
dc = diff --cached # diff staged changes
|
|
||||||
last = diff HEAD^ # diff last committed change
|
|
||||||
|
|
||||||
# log
|
|
||||||
log = log --decorate --graph --date=short
|
|
||||||
l = log
|
|
||||||
changes = log --pretty=format:\"%h %cr %cn %Cgreen%s%Creset\" --name-status
|
|
||||||
short = log --pretty=format:\"%h %cr %cn %Cgreen%s%Creset\"
|
|
||||||
changelog = log --pretty=format:\" * %s\"
|
|
||||||
shortnocolor = log --pretty=format:\"%h %cr %cn %s\"
|
|
||||||
|
|
||||||
# pull
|
|
||||||
pl = pull # pull
|
|
||||||
|
|
||||||
# push
|
|
||||||
ps = push # push
|
|
||||||
|
|
||||||
# rebase
|
|
||||||
rc = rebase --continue # continue rebase
|
|
||||||
rs = rebase --skip # skip rebase
|
|
||||||
|
|
||||||
# remote
|
|
||||||
r = remote -v # show remotes (verbose)
|
|
||||||
|
|
||||||
# reset
|
|
||||||
unstage = reset HEAD # remove files from index (tracking)
|
|
||||||
uncommit = reset --soft HEAD^ # go back before last commit, with files in uncommitted state
|
|
||||||
filelog = log -u # show changes to a file
|
|
||||||
mt = mergetool # fire up the merge tool
|
|
||||||
|
|
||||||
# stash
|
|
||||||
ss = stash # stash changes
|
|
||||||
sl = stash list # list stashes
|
|
||||||
sa = stash apply # apply stash (restore changes)
|
|
||||||
sd = stash drop # drop stashes (destory changes)
|
|
||||||
|
|
||||||
# status
|
|
||||||
s = status # status
|
|
||||||
st = status # status
|
|
||||||
stat = status # status
|
|
||||||
|
|
||||||
# tag
|
|
||||||
t = tag -n # show tags with <n> lines of each tag message
|
|
||||||
|
|
||||||
# svn helpers
|
|
||||||
svnr = svn rebase
|
|
||||||
svnd = svn dcommit
|
|
||||||
svnl = svn log --oneline --show-commit
|
|
||||||
[format]
|
|
||||||
pretty = format:%C(blue)%ad%Creset %C(yellow)%h%C(green)%d%Creset %C(blue)%s %C(magenta) [%an]%Creset
|
|
||||||
[merge]
|
|
||||||
summary = true
|
|
||||||
verbosity = 1
|
|
||||||
[apply]
|
|
||||||
whitespace = nowarn
|
|
||||||
[branch]
|
|
||||||
autosetupmerge = true
|
|
||||||
[push]
|
|
||||||
# 'git push' will push the current branch to its tracking branch
|
|
||||||
# the usual default is to push all branches
|
|
||||||
default = tracking
|
|
||||||
[core]
|
|
||||||
autocrlf = false
|
|
||||||
editor = vim
|
|
||||||
excludesfile = ~/.dotfiles/gitignore_global
|
|
||||||
[advice]
|
|
||||||
statusHints = false
|
|
||||||
[diff]
|
|
||||||
# Git diff will use (i)ndex, (w)ork tree, (c)ommit and (o)bject
|
|
||||||
# instead of a/b/c/d as prefixes for patches
|
|
||||||
mnemonicprefix = true
|
|
||||||
[rerere]
|
|
||||||
# Remember my merges
|
|
||||||
# http://gitfu.wordpress.com/2008/04/20/git-rerere-rereremember-what-you-did-last-time/
|
|
||||||
enabled = true
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
# OSX taken from: https://github.com/github/gitignore/blob/master/Global/OSX.gitignore
|
|
||||||
# ----------------------------------------------------------------------------------------------
|
|
||||||
.DS_Store
|
|
||||||
# Thumbnails
|
|
||||||
._*
|
|
||||||
# Files that might appear on external disk
|
|
||||||
.Spotlight-V100
|
|
||||||
.Trashes
|
|
||||||
|
|
||||||
# Windows taken from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore
|
|
||||||
# ----------------------------------------------------------------------------------------------
|
|
||||||
# Windows image file caches
|
|
||||||
Thumbs.db
|
|
||||||
|
|
||||||
# Folder config file
|
|
||||||
Desktop.ini
|
|
||||||
|
|
||||||
# Tags taken from: https://github.com/github/gitignore/blob/master/Global/Tags.gitignore
|
|
||||||
# ----------------------------------------------------------------------------------------------
|
|
||||||
# Ignore tags created by etags and ctags
|
|
||||||
TAGS
|
|
||||||
tags
|
|
||||||
|
|
||||||
# Vim taken from: https://github.com/github/gitignore/blob/master/Global/vim.gitignore
|
|
||||||
# ----------------------------------------------------------------------------------------------
|
|
||||||
.*.sw[a-z]
|
|
||||||
*.un~
|
|
||||||
Session.vim
|
|
||||||
|
|
||||||
# SASS
|
|
||||||
# ----------------------------------------------------------------------------------------------
|
|
||||||
.sass-cache
|
|
||||||
1
gitignore_global
Symbolic link
1
gitignore_global
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
git/gitignore
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
# Aliases in this file are bash and zsh compatible
|
# Aliases in this file are bash and zsh compatible
|
||||||
|
|
||||||
|
# Don't change. The following determines where YADR is installed.
|
||||||
|
yadr=`find -L ~ -type file -maxdepth 2 -name .yadr | head | sed 's:\.yadr\/::'`
|
||||||
|
|
||||||
# YADR support
|
# YADR support
|
||||||
alias yav='yadr vim-add-plugin'
|
alias yav='yadr vim-add-plugin'
|
||||||
alias yuv='yadr vim-update-plugins'
|
alias yuv='yadr vim-update-plugins'
|
||||||
@@ -23,8 +26,8 @@ alias du='du -h -d 2'
|
|||||||
alias lsg='ll | grep'
|
alias lsg='ll | grep'
|
||||||
|
|
||||||
# Alias Editing
|
# Alias Editing
|
||||||
alias ae='vi ~/.dotfiles/zsh/aliases' #alias edit
|
alias ae='vi $yadr/zsh/aliases' #alias edit
|
||||||
alias ar='source ~/.dotfiles/zsh/aliases' #alias reload
|
alias ar='source $yadr/zsh/aliases' #alias reload
|
||||||
|
|
||||||
# vimrc editing
|
# vimrc editing
|
||||||
alias ve='vi ~/.vimrc'
|
alias ve='vi ~/.vimrc'
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
# Path to your oh-my-zsh configuration.
|
|
||||||
ZSH=$HOME/.oh-my-zsh
|
|
||||||
|
|
||||||
# Set name of the theme to load.
|
|
||||||
# Look in ~/.oh-my-zsh/themes/
|
|
||||||
# skwp theme comes from skwp/oh-my-zsh fork
|
|
||||||
ZSH_THEME="skwp"
|
|
||||||
|
|
||||||
# Comment this out to disable weekly auto-update checks
|
|
||||||
DISABLE_AUTO_UPDATE="true"
|
|
||||||
|
|
||||||
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
|
|
||||||
# Example format: plugins=(rails git textmate ruby lighthouse)
|
|
||||||
plugins=(git rvm ruby rails autojump)
|
|
||||||
|
|
||||||
# Load default oh-my-zsh stuff
|
|
||||||
source $ZSH/oh-my-zsh.sh
|
|
||||||
|
|
||||||
# Customize to your needs...
|
|
||||||
export PATH=/usr/local/git/bin:/op/local/bin:/opt/local/sbin:/usr/bin:/Users/yan/dev/cluster/script:/Users/yan/.bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin:/opt/local/bin:/opt/local/lib/postgresql84/bin:/usr/local/bin:/Users/yan/dev/ec2/ec2-api/bin:/opt/local/lib/mysql5/bin:/Users/yan/.rvm/bin:/Users/yan/.dotfiles/bin:/Users/yan/.dotfiles/bin/willmorgan/bin
|
|
||||||
|
|
||||||
# Load YADR zshrc
|
|
||||||
source ~/.dotfiles/zsh/zshrc
|
|
||||||
1
zsh/oh_my_zsh_zshrc
Symbolic link
1
zsh/oh_my_zsh_zshrc
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
zshrc
|
||||||
31
zsh/zshrc
31
zsh/zshrc
@@ -1,6 +1,25 @@
|
|||||||
|
# Source oh-my-zsh if it is installed.
|
||||||
|
if [[ -d $HOME/.oh-my-zsh ]]; then
|
||||||
|
# Path to your oh-my-zsh configuration.
|
||||||
|
ZSH=$HOME/.oh-my-zsh
|
||||||
|
|
||||||
|
# Set name of the theme to load.
|
||||||
|
ZSH_THEME="skwp"
|
||||||
|
|
||||||
|
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
|
||||||
|
# Example format: plugins=(rails git textmate ruby lighthouse)
|
||||||
|
plugins=(git rvm ruby rails autojump)
|
||||||
|
|
||||||
|
# Load default oh-my-zsh stuff
|
||||||
|
source $ZSH/oh-my-zsh.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Don't change. The following determines where YADR is installed.
|
||||||
|
yadr=`find -L ~ -type file -maxdepth 2 -name .yadr | head | sed 's:\.yadr\/::'`
|
||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
source ~/.dotfiles/zsh/aliases
|
source $yadr/zsh/aliases
|
||||||
source ~/.dotfiles/zsh/zsh_aliases
|
source $yadr/zsh/zsh_aliases
|
||||||
|
|
||||||
# Things I don't want to publish to github
|
# Things I don't want to publish to github
|
||||||
source ~/.secrets
|
source ~/.secrets
|
||||||
@@ -13,8 +32,8 @@ bindkey '^R' history-incremental-search-backward
|
|||||||
|
|
||||||
# Speed up git completion
|
# Speed up git completion
|
||||||
# http://talkings.org/post/5236392664/zsh-and-slow-git-completion
|
# http://talkings.org/post/5236392664/zsh-and-slow-git-completion
|
||||||
__git_files () {
|
__git_files () {
|
||||||
_wanted files expl 'local files' _files
|
_wanted files expl 'local files' _files
|
||||||
}
|
}
|
||||||
|
|
||||||
# Always pushd when changing directory
|
# Always pushd when changing directory
|
||||||
@@ -26,7 +45,7 @@ zstyle ':completion:*:match:*' original only
|
|||||||
zstyle ':completion:*:approximate:*' max-errors 1 numeric
|
zstyle ':completion:*:approximate:*' max-errors 1 numeric
|
||||||
|
|
||||||
# RVM
|
# RVM
|
||||||
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
|
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
|
||||||
|
|
||||||
# Add path to our custom bins
|
# Add path to our custom bins
|
||||||
export PATH=$PATH:~/.dotfiles/bin:~/.dotfiles/bin/yadr
|
export PATH=$PATH:$yadr/bin:$yadr/bin/yadr
|
||||||
|
|||||||
Reference in New Issue
Block a user