From a4c14bc74ae686df549080989e5021da38e368ad Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Fri, 22 Feb 2013 16:32:41 +0400 Subject: [PATCH] Mostly git and ruby stuff --- git/gitconfig | 1 + git/gitignore | 2 ++ ruby/{.aprc => aprc} | 3 ++- ruby/{.gemrc => gemrc} | 0 ruby/irbrc | 9 +++++++++ setup.sh | 7 ++++--- sublime/config-dark | 6 +++--- sublime/config-light | 6 +++--- vim/.netrwhist | 4 ++++ vim/vim | 1 + zsh/aliases.zsh | 9 +++++++++ zsh/prompt.zsh | 19 +++++++++---------- zsh/{.zshrc => zshrc} | 0 13 files changed, 47 insertions(+), 20 deletions(-) rename ruby/{.aprc => aprc} (60%) rename ruby/{.gemrc => gemrc} (100%) create mode 100644 ruby/irbrc create mode 100644 vim/.netrwhist create mode 120000 vim/vim rename zsh/{.zshrc => zshrc} (100%) diff --git a/git/gitconfig b/git/gitconfig index 613d95a..57354bc 100644 --- a/git/gitconfig +++ b/git/gitconfig @@ -11,6 +11,7 @@ st = status -sb ci = commit -m ca = commit -am + up = !sh -c 'git pull --rebase --prune && git log --pretty=format:\"%Cred%ae %Creset- %C(yellow)%s %Creset(%ar)\" HEAD@{1}..' [color] diff = auto status = auto diff --git a/git/gitignore b/git/gitignore index e6e4615..62b1439 100644 --- a/git/gitignore +++ b/git/gitignore @@ -1,3 +1,5 @@ .DS_Store .bundle .rake_tasks +*.sublime-project +*.sublime-workspace diff --git a/ruby/.aprc b/ruby/aprc similarity index 60% rename from ruby/.aprc rename to ruby/aprc index cd52d4e..0c1e171 100644 --- a/ruby/.aprc +++ b/ruby/aprc @@ -1,4 +1,5 @@ AwesomePrint.defaults = { indent: -2, - index: false + index: false, + raw: true } diff --git a/ruby/.gemrc b/ruby/gemrc similarity index 100% rename from ruby/.gemrc rename to ruby/gemrc diff --git a/ruby/irbrc b/ruby/irbrc new file mode 100644 index 0000000..e4f41d3 --- /dev/null +++ b/ruby/irbrc @@ -0,0 +1,9 @@ +require 'irb' +require 'irb/completion' +require 'irb/ext/save-history' +require 'rubygems' +require 'ap' + +IRB.conf[:SAVE_HISTORY] = 100 +IRB.conf[:AUTO_INDENT] = true +AwesomePrint.irb! diff --git a/setup.sh b/setup.sh index 3f47cf9..e46441f 100755 --- a/setup.sh +++ b/setup.sh @@ -5,11 +5,12 @@ ln -s ~/.dotfiles/git/gitconfig ~/.gitconfig ln -s ~/.dotfiles/git/gitignore ~/.gitignore # ZSH -ln -s ~/.dotfiles/zsh/.zshrc +ln -s ~/.dotfiles/zsh/zshrc ~/.zshrc # Ruby -ln -s ~/.dotfiles/ruby/.gemrc -ln -s ~/.dotfiles/ruby/.aprc +ln -s ~/.dotfiles/ruby/gemrc ~/.gemrc +ln -s ~/.dotfiles/ruby/irbrc ~/.irbrc +ln -s ~/.dotfiles/ruby/aprc ~/.aprc # THE VIM ln -s ~/.dotfiles/vim ~/.vim diff --git a/sublime/config-dark b/sublime/config-dark index 4b02328..fe26a46 100644 --- a/sublime/config-dark +++ b/sublime/config-dark @@ -4,8 +4,8 @@ "drag_text": false, "ensure_newline_at_eof_on_save": true, "fallback_encoding": "Cyrillic (Windows 1251)", - "font_face": "Inconsolata", - "font_size": 16.0, + "font_face": "Source Code Pro", + "font_size": 14.0, "highlight_line": true, "ignored_packages": ["Vintage"], "line_padding_bottom": 1, @@ -16,6 +16,6 @@ "translate_tabs_to_spaces": true, "tree_animation_enabled": false, "trim_trailing_white_space_on_save": true, - "folder_exclude_patterns": [".git", ".bundle"], + "folder_exclude_patterns": [".git", ".bundle", ".sass-cache"], "file_exclude_patterns": [".DS_Store"] } diff --git a/sublime/config-light b/sublime/config-light index fd6ca6e..7702c6c 100644 --- a/sublime/config-light +++ b/sublime/config-light @@ -4,8 +4,8 @@ "drag_text": false, "ensure_newline_at_eof_on_save": true, "fallback_encoding": "Cyrillic (Windows 1251)", - "font_face": "Inconsolata", - "font_size": 16.0, + "font_face": "Source Code Pro", + "font_size": 14.0, "highlight_line": true, "ignored_packages": ["Vintage"], "line_padding_bottom": 1, @@ -16,6 +16,6 @@ "translate_tabs_to_spaces": true, "tree_animation_enabled": false, "trim_trailing_white_space_on_save": true, - "folder_exclude_patterns": [".git", ".bundle"], + "folder_exclude_patterns": [".git", ".bundle", ".sass-cache"], "file_exclude_patterns": [".DS_Store"] } diff --git a/vim/.netrwhist b/vim/.netrwhist new file mode 100644 index 0000000..929277b --- /dev/null +++ b/vim/.netrwhist @@ -0,0 +1,4 @@ +let g:netrw_dirhistmax =10 +let g:netrw_dirhist_cnt =2 +let g:netrw_dirhist_1='/Users/chez/Code/commentatr/config/locales/activerecord/admin_user' +let g:netrw_dirhist_2='/Users/chez/Code/commentatr/config/locales/activerecord/blog' diff --git a/vim/vim b/vim/vim new file mode 120000 index 0000000..f16f978 --- /dev/null +++ b/vim/vim @@ -0,0 +1 @@ +/Users/chez/.dotfiles/vim \ No newline at end of file diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index af235b4..140078c 100644 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -3,12 +3,21 @@ alias b='bundle exec' alias please='sudo' alias mkbundle='bundle install --path .bundle' +# Git +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 gc="git commit -m" +alias ga="git add -u && git add . && git st" +alias gs="git st" + # 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" diff --git a/zsh/prompt.zsh b/zsh/prompt.zsh index 2435a49..a544626 100644 --- a/zsh/prompt.zsh +++ b/zsh/prompt.zsh @@ -1,18 +1,19 @@ autoload colors && colors -# cheers, @ehrenmurdick -# http://github.com/ehrenmurdick/config/blob/master/zsh/prompt.zsh + +# Using git from Homebrew instead of default one +git=/usr/local/bin/git git_branch() { - echo $(/usr/bin/git symbolic-ref HEAD 2>/dev/null | awk -F/ {'print $NF'}) + echo $($git symbolic-ref HEAD 2>/dev/null | awk -F/ {'print $NF'}) } git_dirty() { - st=$(/usr/bin/git status 2>/dev/null | tail -n 1) + st=$($git status 2>/dev/null | tail -n 1) if [[ $st == "" ]] then echo "" else - if [[ $st == "nothing to commit (working directory clean)" ]] + if [[ "$st" =~ ^nothing ]] then echo " %F{002}($(git_prompt_info))%f" else @@ -22,14 +23,12 @@ git_dirty() { } git_prompt_info () { - ref=$(/usr/bin/git symbolic-ref HEAD 2>/dev/null) || return - echo "${ref#refs/heads/}" + ref=$($git symbolic-ref HEAD 2>/dev/null) || return + echo "${ref#refs/heads/}" } unpushed () { - if [[ -a .git ]]; then - git diff origin/master..HEAD - fi + $git cherry -v @{upstream} 2>/dev/null } need_push () { diff --git a/zsh/.zshrc b/zsh/zshrc similarity index 100% rename from zsh/.zshrc rename to zsh/zshrc