This commit is contained in:
Gregory Eremin
2013-05-23 13:17:40 +04:00
parent 29bc4bc769
commit 7829058f8e
27 changed files with 655 additions and 104 deletions
+1
View File
@@ -0,0 +1 @@
complete -x -c c -a "(ls $PROJECTS)"
+1
View File
@@ -0,0 +1 @@
complete -x -c h -a "(ls $HOME)"
+17
View File
@@ -0,0 +1,17 @@
function __cache_or_get_rake_completion -d "Create rake completions"
mkdir -p "/tmp/rake_completion_cache_for_$USER"
set -l hashed_pwd (pwd | md5)
set -l rake_cache_file "/tmp/rake_completion_cache_for_$USER/$hashed_pwd"
if not test -f "$rake_cache_file"
rake -T 2>&1 | sed -e "s/^rake \([a-z:_0-9!\-]*\).*#\(.*\)/\1 \2/" > "$rake_cache_file"
end
cat "$rake_cache_file"
end
function __run_rake_completion
test -f rakefile; or test -f Rakefile; or test -f rakefile.rb; or test -f Rakefile.rb
end
complete -x -c rake -a "(__cache_or_get_rake_completion)" -n __run_rake_completion
+11
View File
@@ -0,0 +1,11 @@
set -U EDITOR vi
set -x FISH $HOME/.config/fish
set -x DF $HOME/.dotfiles
set -x PROJECTS $HOME/Code
set -x fish_greeting ''
. $FISH/includes/alias.fish
. $FISH/includes/ruby.fish
. $FISH/includes/path.fish
+3
View File
@@ -0,0 +1,3 @@
function c
cd $PROJECTS/$argv[1]
end
+20
View File
@@ -0,0 +1,20 @@
function fish_prompt --description 'Write out the prompt'
set_color blue
printf (__fish_basedir)
if test -d .git
set_color magenta
__fish_git_need_commit
end
set_color normal
printf ' '
end
function __fish_basedir
echo (pwd | rev | cut -d/ -f1 | rev)
end
function __fish_git_need_commit
/usr/local/bin/git diff --stat 2>/dev/null | awk -F',' '/files? changed/ { lc += $2 + $3 } END {
if (lc > 100) printf " -- Y U NO COMMIT!? --"
}'
end
@@ -0,0 +1,36 @@
function fish_right_prompt --description 'Write out the right prompt'
if test -d .git
__fish_git_unpushed
__fish_git_dirty
end
end
function __fish_git_branch
echo (/usr/local/bin/git symbolic-ref HEAD 2>/dev/null | rev | cut -d/ -f1 | rev)
end
function __fish_git_is_dirty
echo (/usr/local/bin/git status --porcelain)
end
function __fish_git_dirty
if [ (__fish_git_is_dirty) ]
set_color red
else
set_color green
end
printf "%s" (__fish_git_branch)
set_color normal
end
function __fish_git_is_unpushed
echo (/usr/local/bin/git cherry -v "@{upstream}" 2>/dev/null)
end
function __fish_git_unpushed
if [ (__fish_git_is_unpushed) ]
set_color cyan
printf "✖ "
set_color normal
end
end
+3
View File
@@ -0,0 +1,3 @@
function h
cd $HOME/$argv[1]
end
+49
View File
@@ -0,0 +1,49 @@
alias reload! ". $HOME/.config/fish/config.fish"
alias b "bundle exec"
alias ll "ls -lah"
alias please "sudo"
# Ruby & Rails
alias b "bundle exec"
alias rails "bundle exec rails"
alias rake "bundle exec rake"
alias rspec "bundle exec rspec"
alias cap "bundle exec cap"
alias cucumber "bundle exec cucumber"
alias mkbundle "bundle install --path vendor/gems"
alias ss "git up; bundle --quiet; bundle exec rake db:migrate"
alias rc "rails c"
alias rs "rails s"
alias rs1 "rails s -p3001"
alias rs2 "rails s -p3002"
alias fs "bundle exec foreman start"
# Git
alias git "git-achievements"
alias gl "git log --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative"
alias gc "git ci -m"
alias ga "git add -u; git add .; git st"
alias gs "git st"
alias gd "git diff"
alias gp "git push"
alias gu "gut up"
alias gb "git br"
# OSX
alias hidedesktop "defaults write com.apple.finder CreateDesktop -bool false; killall Finder"
alias showdesktop "defaults write com.apple.finder CreateDesktop -bool true; killall Finder"
# Services start-ups and shut-downs
alias mysql-start="mysql.server start"
alias mysql-stop="mysql.server stop"
alias mysql-restart="mysql.server restart"
alias postgres-start="pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start"
alias postgres-stop="pg_ctl -D /usr/local/var/postgres stop -s -m fast"
alias redis-start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.redis.plist"
alias redis-stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.redis.plist"
alias redis-restart="redis-stop; redis-start"
+10
View File
@@ -0,0 +1,10 @@
set -x PATH /usr/local/sbin $PATH
set -x PATH $HOME/.dotfiles/bin $PATH
set -x PATH $HOME/.rbenv/shims $PATH
set -x PATH /usr/local/share/npm/bin $PATH
set -x PATH /usr/local/share/python $PATH
set -x PATH ~/.dotfiles/bin $PATH
set -x PATH /usr/local/share/npm/bin $PATH
set -x PATH /usr/local/share/python $PATH
set -x PATH ~/.misc/git-achievements $PATH
set -x PATH /Applications/Sublime\ Text\ 3.app/Contents/SharedSupport/bin $PATH
+8
View File
@@ -0,0 +1,8 @@
set -x RUBYOPT "-Ku" # Remove it after migration to 2.0
set -x RUBY_HEAP_MIN_SLOTS 800000
set -x RUBY_HEAP_FREE_MIN 100000
set -x RUBY_FREE_MIN 200000
set -x RUBY_HEAP_SLOTS_INCREMENT 300000
set -x RUBY_HEAP_SLOTS_GROWTH_FACTOR 1
set -x RUBY_GC_MALLOC_LIMIT 79000000