Fish configuration from benhoskings

pull/2/head
Bodaniel Jeanes 2009-06-10 13:04:31 +10:00
parent 31984641cb
commit e5efdafeea
32 changed files with 144 additions and 0 deletions

2
.gitignore vendored 100644
View File

@ -0,0 +1,2 @@
fish/fish_history
fish/fishd.*

1
fish/config.fish 100644
View File

@ -0,0 +1 @@
set -x PATH $PATH /usr/local/git/bin /usr/local/mysql/bin

View File

@ -0,0 +1,7 @@
function confirm
echo "OK [y/N]?"
read confirm_result
test 'y' = $confirm_result
end

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,5 @@
function git_parse_branch
sh -c 'git branch --no-color 2> /dev/null' | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
end

View File

@ -0,0 +1,3 @@
function gita
git add $argv;
end

View File

@ -0,0 +1,3 @@
function gitau
git add -u $argv;
end

View File

@ -0,0 +1,3 @@
function gitc
git commit -v $argv;
end

View File

@ -0,0 +1,3 @@
function gitco
git checkout $argv;
end

View File

@ -0,0 +1,3 @@
function gitd.
git diff --color-words='.' $argv;
end

View File

@ -0,0 +1,3 @@
function gitd
git diff $argv;
end

View File

@ -0,0 +1,3 @@
function gitdc.
git diff --cached --color-words='.' $argv;
end

View File

@ -0,0 +1,3 @@
function gitdc
git diff --cached $argv;
end

View File

@ -0,0 +1,4 @@
function gitdcw
git diff --cached $color_ruby_words $argv
end

View File

@ -0,0 +1,5 @@
function gitdw
git diff $color_ruby_words $argv
end

View File

@ -0,0 +1,3 @@
function gitl
git log -p $argv;
end

View File

@ -0,0 +1,3 @@
function gitlc
git log $git_concise_log_format $argv;
end

View File

@ -0,0 +1,3 @@
function gitlcg
gitlc --graph $argv;
end

View File

@ -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

View File

@ -0,0 +1,3 @@
function gitrb
git rebase $argv;
end

View File

@ -0,0 +1,3 @@
function gitrbc
git rebase --continue $argv;
end

View File

@ -0,0 +1,3 @@
function gits
git status $argv;
end

View File

@ -0,0 +1,3 @@
function gitst
git stash $argv;
end

View File

@ -0,0 +1,3 @@
function gitstp
git stash pop $argv;
end

View File

@ -0,0 +1,5 @@
function gl
git log $argv
end

View File

@ -0,0 +1,3 @@
function m
mate . $argv;
end

View File

@ -0,0 +1,4 @@
function parse_git_branch
sh -c 'git branch --no-color 2> /dev/null' | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
end

View File

@ -0,0 +1,3 @@
function tigs
tig status $argv;
end

View File

@ -0,0 +1,3 @@
function vi
mate $argv;
end