From 61230c448619d6686a62eb98e4f5b8be130beaf3 Mon Sep 17 00:00:00 2001 From: Bodaniel Jeanes Date: Fri, 12 Jun 2009 22:19:53 +1000 Subject: [PATCH] More fish config --- fish/config.fish | 3 ++- fish/functions/eprof.fish | 4 ++++ fish/functions/fish_prompt.fish | 3 ++- fish/functions/gca.fish | 4 ++++ fish/functions/git_dirty.fish | 1 + fish/functions/gl.fish | 4 ++++ fish/functions/gps.fish | 4 ++++ fish/functions/log.fish | 4 ++++ fish/functions/m.fish | 6 +++++- fish/functions/migrate.fish | 4 ++++ fish/functions/migration.fish | 4 ++++ fish/functions/new_function.fish | 4 ++++ fish/functions/save.fish | 4 +--- 13 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 fish/functions/eprof.fish create mode 100644 fish/functions/gca.fish create mode 100644 fish/functions/gl.fish create mode 100644 fish/functions/gps.fish create mode 100644 fish/functions/log.fish create mode 100644 fish/functions/migrate.fish create mode 100644 fish/functions/migration.fish create mode 100644 fish/functions/new_function.fish diff --git a/fish/config.fish b/fish/config.fish index 30e1873..3a8cafc 100644 --- a/fish/config.fish +++ b/fish/config.fish @@ -1,7 +1,8 @@ +cd $HOME ^/dev/null # for some reason $PWD is empty in new consoles + mkdir -p ~/.l set fish_greeting '' -set -x PWD "~" # some reason this is empty in new consoles set -x PATH $PATH /usr/local/git/bin /usr/local/mysql/bin /usr/local/jruby/bin set -x CDPATH . ~ ~/Sites ~/Code /Volumes ~/.l diff --git a/fish/functions/eprof.fish b/fish/functions/eprof.fish new file mode 100644 index 0000000..cc414b2 --- /dev/null +++ b/fish/functions/eprof.fish @@ -0,0 +1,4 @@ +function eprof + mate ~/.config + +end diff --git a/fish/functions/fish_prompt.fish b/fish/functions/fish_prompt.fish index 24e9259..f49851d 100755 --- a/fish/functions/fish_prompt.fish +++ b/fish/functions/fish_prompt.fish @@ -18,7 +18,8 @@ function fish_prompt --description 'Write out the prompt' end printf '%s%s ' (set_color $fish_color_git_branch) (git_parse_branch) - + + if git_dirty printf '%s☠ ' (set_color red) end diff --git a/fish/functions/gca.fish b/fish/functions/gca.fish new file mode 100644 index 0000000..e881df8 --- /dev/null +++ b/fish/functions/gca.fish @@ -0,0 +1,4 @@ +function gca + gc -a + +end diff --git a/fish/functions/git_dirty.fish b/fish/functions/git_dirty.fish index 29a6afc..dd361eb 100644 --- a/fish/functions/git_dirty.fish +++ b/fish/functions/git_dirty.fish @@ -1,4 +1,5 @@ function git_dirty + not git diff HEAD --quiet ^/dev/null end diff --git a/fish/functions/gl.fish b/fish/functions/gl.fish new file mode 100644 index 0000000..29942ea --- /dev/null +++ b/fish/functions/gl.fish @@ -0,0 +1,4 @@ +function gl + git pull $argv + +end diff --git a/fish/functions/gps.fish b/fish/functions/gps.fish new file mode 100644 index 0000000..98cc28d --- /dev/null +++ b/fish/functions/gps.fish @@ -0,0 +1,4 @@ +function gps + git push $argv + +end diff --git a/fish/functions/log.fish b/fish/functions/log.fish new file mode 100644 index 0000000..ea76c8e --- /dev/null +++ b/fish/functions/log.fish @@ -0,0 +1,4 @@ +function log + tail -f n0 log/*.log + +end diff --git a/fish/functions/m.fish b/fish/functions/m.fish index 9e58549..63674db 100755 --- a/fish/functions/m.fish +++ b/fish/functions/m.fish @@ -1,3 +1,7 @@ function m - mate . $argv; + if not test $argv + set argv . + end + mate $argv + end diff --git a/fish/functions/migrate.fish b/fish/functions/migrate.fish new file mode 100644 index 0000000..42e5acd --- /dev/null +++ b/fish/functions/migrate.fish @@ -0,0 +1,4 @@ +function migrate + rake db:migrate $argv + +end diff --git a/fish/functions/migration.fish b/fish/functions/migration.fish new file mode 100644 index 0000000..61560a0 --- /dev/null +++ b/fish/functions/migration.fish @@ -0,0 +1,4 @@ +function migration + script/generate migration $argv + +end diff --git a/fish/functions/new_function.fish b/fish/functions/new_function.fish new file mode 100644 index 0000000..c80a809 --- /dev/null +++ b/fish/functions/new_function.fish @@ -0,0 +1,4 @@ +function new_function --description 'my cool siretn' + echo "cool" + +end diff --git a/fish/functions/save.fish b/fish/functions/save.fish index fbbd9a6..caf8dcd 100644 --- a/fish/functions/save.fish +++ b/fish/functions/save.fish @@ -1,5 +1,3 @@ function save --description 'Save current directory with name for quick access' - echo "ln -s \"$PWD\" \"~/.l/$argv\" ./" - ln -s "$PWD" "~/.l/$argv" - + ln -s "$PWD" "$HOME/.l/$argv" end