diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7695a32 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +fish/fish_history +fish/fishd.* \ No newline at end of file diff --git a/fish/config.fish b/fish/config.fish new file mode 100644 index 0000000..9625a47 --- /dev/null +++ b/fish/config.fish @@ -0,0 +1 @@ +set -x PATH $PATH /usr/local/git/bin /usr/local/mysql/bin diff --git a/fish/functions/confirm.fish b/fish/functions/confirm.fish new file mode 100755 index 0000000..71dce8a --- /dev/null +++ b/fish/functions/confirm.fish @@ -0,0 +1,7 @@ +function confirm + echo "OK [y/N]?" + read confirm_result + test 'y' = $confirm_result + + +end diff --git a/fish/functions/deplol.fish b/fish/functions/deplol.fish new file mode 100755 index 0000000..b9a3df2 --- /dev/null +++ b/fish/functions/deplol.fish @@ -0,0 +1,16 @@ +function deplol + gitst + and gitco deploy + and git merge work + and gitlcg -25 + and gitco work + and gitstp + and gitlc origin/deploy..deploy + and echo "Hit enter if that looks OK." + and read + and echo "Pushing..." + and git push + and cap deploy:all + + +end diff --git a/fish/functions/fish_prompt.fish b/fish/functions/fish_prompt.fish new file mode 100755 index 0000000..e2acddb --- /dev/null +++ b/fish/functions/fish_prompt.fish @@ -0,0 +1,10 @@ +function fish_prompt --description 'Write out the prompt' + set pr_timestamp (date '+%a %H:%M:%S') + set pr_user (whoami) + set pr_host (hostname | cut -d . -f 1) + set pr_cwd (prompt_pwd) + set pr_git_info (git_cwd_info) + echo -e "\033[90m$pr_timestamp\033[0m $pr_user\033[90m@\033[0m$pr_host \033[90m$pr_cwd$pr_git_info\033[0m \033[32m>\033[0m " + + +end diff --git a/fish/functions/git_cwd_info.fish b/fish/functions/git_cwd_info.fish new file mode 100755 index 0000000..7b9e459 --- /dev/null +++ b/fish/functions/git_cwd_info.fish @@ -0,0 +1,13 @@ +function git_cwd_info + if test -d .git + printf -- " - %s, " (git_parse_branch) + if test (git ls-files -m | wc -l) -eq 0 + echo 'clean' + else + printf "%s" (git_dirty_files_count) + end + end + + + +end diff --git a/fish/functions/git_dirty_files_count.fish b/fish/functions/git_dirty_files_count.fish new file mode 100755 index 0000000..78ca4ec --- /dev/null +++ b/fish/functions/git_dirty_files_count.fish @@ -0,0 +1,7 @@ +function git_dirty_files_count + if test -d .git + git diff --stat | tail -n1 | sed -E 's/^ *//' | sed -E 's/ [a-z ]+\((.)(\),)?/\1/g' | sed -E 's/[a-z ]+, / (/' | sed -E "s/([0-9]+)\+/$pr_green\1$pr_grey+/g" | sed -E "s/([0-9]+)\-/$pr_red\1$pr_grey-/g" + end + + +end diff --git a/fish/functions/git_parse_branch.fish b/fish/functions/git_parse_branch.fish new file mode 100755 index 0000000..b8cb2e9 --- /dev/null +++ b/fish/functions/git_parse_branch.fish @@ -0,0 +1,5 @@ +function git_parse_branch + sh -c 'git branch --no-color 2> /dev/null' | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' + + +end diff --git a/fish/functions/gita.fish b/fish/functions/gita.fish new file mode 100755 index 0000000..df0ad9e --- /dev/null +++ b/fish/functions/gita.fish @@ -0,0 +1,3 @@ +function gita + git add $argv; +end diff --git a/fish/functions/gitau.fish b/fish/functions/gitau.fish new file mode 100755 index 0000000..7ad0132 --- /dev/null +++ b/fish/functions/gitau.fish @@ -0,0 +1,3 @@ +function gitau + git add -u $argv; +end diff --git a/fish/functions/gitc.fish b/fish/functions/gitc.fish new file mode 100755 index 0000000..74d33a8 --- /dev/null +++ b/fish/functions/gitc.fish @@ -0,0 +1,3 @@ +function gitc + git commit -v $argv; +end diff --git a/fish/functions/gitco.fish b/fish/functions/gitco.fish new file mode 100755 index 0000000..6dbccd6 --- /dev/null +++ b/fish/functions/gitco.fish @@ -0,0 +1,3 @@ +function gitco + git checkout $argv; +end diff --git a/fish/functions/gitd..fish b/fish/functions/gitd..fish new file mode 100755 index 0000000..96a114f --- /dev/null +++ b/fish/functions/gitd..fish @@ -0,0 +1,3 @@ +function gitd. + git diff --color-words='.' $argv; +end diff --git a/fish/functions/gitd.fish b/fish/functions/gitd.fish new file mode 100755 index 0000000..e0fc015 --- /dev/null +++ b/fish/functions/gitd.fish @@ -0,0 +1,3 @@ +function gitd + git diff $argv; +end diff --git a/fish/functions/gitdc..fish b/fish/functions/gitdc..fish new file mode 100755 index 0000000..f05d63c --- /dev/null +++ b/fish/functions/gitdc..fish @@ -0,0 +1,3 @@ +function gitdc. + git diff --cached --color-words='.' $argv; +end diff --git a/fish/functions/gitdc.fish b/fish/functions/gitdc.fish new file mode 100755 index 0000000..996edf8 --- /dev/null +++ b/fish/functions/gitdc.fish @@ -0,0 +1,3 @@ +function gitdc + git diff --cached $argv; +end diff --git a/fish/functions/gitdcw.fish b/fish/functions/gitdcw.fish new file mode 100755 index 0000000..b8af808 --- /dev/null +++ b/fish/functions/gitdcw.fish @@ -0,0 +1,4 @@ +function gitdcw + git diff --cached $color_ruby_words $argv + +end diff --git a/fish/functions/gitdw.fish b/fish/functions/gitdw.fish new file mode 100755 index 0000000..3c2c86a --- /dev/null +++ b/fish/functions/gitdw.fish @@ -0,0 +1,5 @@ +function gitdw + git diff $color_ruby_words $argv + + +end diff --git a/fish/functions/gitl.fish b/fish/functions/gitl.fish new file mode 100755 index 0000000..584b458 --- /dev/null +++ b/fish/functions/gitl.fish @@ -0,0 +1,3 @@ +function gitl + git log -p $argv; +end diff --git a/fish/functions/gitlc.fish b/fish/functions/gitlc.fish new file mode 100755 index 0000000..32ee275 --- /dev/null +++ b/fish/functions/gitlc.fish @@ -0,0 +1,3 @@ +function gitlc + git log $git_concise_log_format $argv; +end diff --git a/fish/functions/gitlcg.fish b/fish/functions/gitlcg.fish new file mode 100755 index 0000000..11d308c --- /dev/null +++ b/fish/functions/gitlcg.fish @@ -0,0 +1,3 @@ +function gitlcg + gitlc --graph $argv; +end diff --git a/fish/functions/gitlpend.fish b/fish/functions/gitlpend.fish new file mode 100755 index 0000000..c6e362e --- /dev/null +++ b/fish/functions/gitlpend.fish @@ -0,0 +1,8 @@ +function gitlpend + printf "commits from %s%s/%s%s to %sHEAD%s" (set_color red) (git config branch.(git_parse_branch).remote) (git_parse_branch) (set_color normal) (set_color red) (set_color normal) + echo + git --no-pager log --graph (git config branch.(git_parse_branch).remote)/(git_parse_branch)..HEAD $git_concise_log_format + echo + + +end diff --git a/fish/functions/gitrb.fish b/fish/functions/gitrb.fish new file mode 100755 index 0000000..fd635b3 --- /dev/null +++ b/fish/functions/gitrb.fish @@ -0,0 +1,3 @@ +function gitrb + git rebase $argv; +end diff --git a/fish/functions/gitrbc.fish b/fish/functions/gitrbc.fish new file mode 100755 index 0000000..a43f6e6 --- /dev/null +++ b/fish/functions/gitrbc.fish @@ -0,0 +1,3 @@ +function gitrbc + git rebase --continue $argv; +end diff --git a/fish/functions/gits.fish b/fish/functions/gits.fish new file mode 100755 index 0000000..5766b8b --- /dev/null +++ b/fish/functions/gits.fish @@ -0,0 +1,3 @@ +function gits + git status $argv; +end diff --git a/fish/functions/gitst.fish b/fish/functions/gitst.fish new file mode 100755 index 0000000..bc74751 --- /dev/null +++ b/fish/functions/gitst.fish @@ -0,0 +1,3 @@ +function gitst + git stash $argv; +end diff --git a/fish/functions/gitstp.fish b/fish/functions/gitstp.fish new file mode 100755 index 0000000..7f56fd5 --- /dev/null +++ b/fish/functions/gitstp.fish @@ -0,0 +1,3 @@ +function gitstp + git stash pop $argv; +end diff --git a/fish/functions/gl.fish b/fish/functions/gl.fish new file mode 100755 index 0000000..135f3bc --- /dev/null +++ b/fish/functions/gl.fish @@ -0,0 +1,5 @@ +function gl + git log $argv + + +end diff --git a/fish/functions/m.fish b/fish/functions/m.fish new file mode 100755 index 0000000..9e58549 --- /dev/null +++ b/fish/functions/m.fish @@ -0,0 +1,3 @@ +function m + mate . $argv; +end diff --git a/fish/functions/parse_git_branch.fish b/fish/functions/parse_git_branch.fish new file mode 100755 index 0000000..37ffaab --- /dev/null +++ b/fish/functions/parse_git_branch.fish @@ -0,0 +1,4 @@ +function parse_git_branch + sh -c 'git branch --no-color 2> /dev/null' | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' + +end diff --git a/fish/functions/tigs.fish b/fish/functions/tigs.fish new file mode 100755 index 0000000..e6bfec1 --- /dev/null +++ b/fish/functions/tigs.fish @@ -0,0 +1,3 @@ +function tigs + tig status $argv; +end diff --git a/fish/functions/vi.fish b/fish/functions/vi.fish new file mode 100755 index 0000000..2b20f76 --- /dev/null +++ b/fish/functions/vi.fish @@ -0,0 +1,3 @@ +function vi + mate $argv; +end