From 99343b27a7635b4354ca04bb7276c4af100b078d Mon Sep 17 00:00:00 2001 From: Nick Nisi Date: Tue, 5 Feb 2013 20:45:45 -0600 Subject: [PATCH] new commands, updated gitconfig + e opens $EDITOR (thanks @holman) + h is same as 'c' but in home directory (thanks @holman) + updated gitconfig --- bin/e | 7 +++++++ bin/subl | 1 + git/git.zsh | 2 +- git/gitconfig.symlink | 31 +++++++++++-------------------- git/gitignore_global.symlink | 4 +++- zsh/functions/_h | 2 ++ zsh/functions/h | 1 + 7 files changed, 26 insertions(+), 22 deletions(-) create mode 100755 bin/e create mode 120000 bin/subl create mode 100644 zsh/functions/_h create mode 100644 zsh/functions/h diff --git a/bin/e b/bin/e new file mode 100755 index 0000000..a7c3177 --- /dev/null +++ b/bin/e @@ -0,0 +1,7 @@ +#!/bin/sh + +if [ "$1" == "" ]; then + exec $EDITOR . +else + exec $EDITOR $1 +fi diff --git a/bin/subl b/bin/subl new file mode 120000 index 0000000..452a989 --- /dev/null +++ b/bin/subl @@ -0,0 +1 @@ +/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl \ No newline at end of file diff --git a/git/git.zsh b/git/git.zsh index 1a86fd8..0283b6f 100644 --- a/git/git.zsh +++ b/git/git.zsh @@ -14,7 +14,7 @@ alias grm='git rm' alias grn='git-rename' 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 git-amend='git commit --amend -C HEAD' +# alias git-amend='git commit --amend -C HEAD' alias git-undo='git reset --soft HEAD~1' alias git-count='git shortlog -sn' alias git-undopush="git push -f origin HEAD^:master" diff --git a/git/gitconfig.symlink b/git/gitconfig.symlink index 7d34c6f..0ad4756 100644 --- a/git/gitconfig.symlink +++ b/git/gitconfig.symlink @@ -38,7 +38,7 @@ count = shortlog -sn undo = reset --soft HEAD~1 - amend = git commit --amend -C HEAD + amend = commit --amend -C HEAD # grep commands @@ -58,26 +58,10 @@ diff = auto status = auto branch = auto - interactive = auto - ui = auto -[color "branch"] - current = green bold - local = green - remote = red bold -[color "diff"] - meta = yellow bold - frag = magenta bold - old = red bold - new = green bold -[color "status"] - added = green bold - changed = yellow bold - untracked = red -[color "sh"] - branch = yellow + ui = true [push] - # push will only do the current branch, not all branches - default = current + # push to the upstream branch but only if it is the same name + default = simple [branch] # set up 'git pull' to rebase instead of merge autosetuprebase = always @@ -87,5 +71,12 @@ [core] excludesfile = ~/.gitignore_global pager = less -FXRS -x2 + editor = vim +[apply] + # turn off trailing whitespace warning + whitespace = nowarn +[mergetool] + # remove backup files after a successful merge + keepBackup = false [rerere] enabled = false diff --git a/git/gitignore_global.symlink b/git/gitignore_global.symlink index fdb5825..a50407d 100644 --- a/git/gitignore_global.symlink +++ b/git/gitignore_global.symlink @@ -1,3 +1,5 @@ .DS_Store Thumbs.db -.vimrc.local +.svn +*~ +*.swp diff --git a/zsh/functions/_h b/zsh/functions/_h new file mode 100644 index 0000000..725dc0a --- /dev/null +++ b/zsh/functions/_h @@ -0,0 +1,2 @@ +#compdef h +_files -W ~ -/ diff --git a/zsh/functions/h b/zsh/functions/h new file mode 100644 index 0000000..6281d04 --- /dev/null +++ b/zsh/functions/h @@ -0,0 +1 @@ +cd ~/$1