diff --git a/.gitignore b/.gitignore index 148c97f..72afb19 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .DS_Store vim/backups *un~ +vim/.netrwhist .netrwhist diff --git a/.gitmodules b/.gitmodules index 61e3e08..45b2476 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "vim/bundle/vim-colors-solarized"] path = vim/bundle/vim-colors-solarized url = https://github.com/altercation/vim-colors-solarized +[submodule "bin/willmorgan"] + path = bin/willmorgan + url = git://gitorious.org/willgit/mainline.git/ bin/willmorgan diff --git a/bash_aliases b/bash_aliases index b92f806..70dbf1b 100644 --- a/bash_aliases +++ b/bash_aliases @@ -23,7 +23,6 @@ alias ar='. ~/dev/config/bash_aliases' #alias reload alias boe='vi ~/dev/config/bash_options' alias bor='. ~/dev/config/bash_options' - # .bash_profile editing alias bp='vi ~/.bash_profile' alias br='. ~/.bash_profile' @@ -48,7 +47,8 @@ alias gcim='git ci -m' alias gci='git ci' alias gco='git co' alias ga='git add -A' -alias gu='git unstage' +alias guns='git unstage' +alias gunc='git uncommit' alias gm='git merge' alias gms='git merge --squash' alias gam='git amend' @@ -81,6 +81,7 @@ alias l='less' alias lh='ls -alt | head' # see the last modified files alias fn="find . -name" alias screen='TERM=screen screen' +alias cl='clear' # Zippin alias gz='tar -zcvf' @@ -90,8 +91,9 @@ alias irb='pry' alias c='script/console --irb=pry' alias ms='mongrel_rails start' -# Vim/ctags "mctags = make ctags" -alias mctags='/opt/local/bin/ctags -Rf ./tags *' +# Vim/ctags "mctags = make ctags", using the ruby specific version +# to save some time +alias mctags=~/.bin/run_tags.rb #'/opt/local/bin/ctags -Rf ./tags *' alias ka9='killall -9' alias k9='kill -9' diff --git a/bash_path b/bash_path new file mode 100644 index 0000000..8d71050 --- /dev/null +++ b/bash_path @@ -0,0 +1 @@ +export PATH=$PATH:~/.dotfiles/bin:~/.dotfiles/bin/willmorgan/bin diff --git a/bash_profile b/bash_profile index 5080852..47a727e 100755 --- a/bash_profile +++ b/bash_profile @@ -9,3 +9,4 @@ fi # My aliases and options . ~/.dotfiles/bash_aliases . ~/.dotfiles/bash_options +. ~/.dotfiles/bash_path diff --git a/bin/mvim b/bin/mvim new file mode 100755 index 0000000..ecd801b --- /dev/null +++ b/bin/mvim @@ -0,0 +1,69 @@ +#!/bin/sh +# +# This shell script passes all its arguments to the binary inside the +# MacVim.app application bundle. If you make links to this script as view, +# gvim, etc., then it will peek at the name used to call it and set options +# appropriately. +# +# Based on a script by Wout Mertens and suggestions from Laurent Bihanic. This +# version is the fault of Benji Fisher, 16 May 2005 (with modifications by Nico +# Weber and Bjorn Winckler, Aug 13 2007). +# First, check "All the Usual Suspects" for the location of the Vim.app bundle. +# You can short-circuit this by setting the VIM_APP_DIR environment variable +# or by un-commenting and editing the following line: +# VIM_APP_DIR=/Applications + +if [ -z "$VIM_APP_DIR" ] +then + myDir="`dirname "$0"`" + myAppDir="$myDir/../Applications" + for i in ~/Applications ~/Applications/vim $myDir $myDir/vim $myAppDir $myAppDir/vim /Applications /Applications/vim /Applications/Utilities /Applications/Utilities/vim; do + if [ -x "$i/MacVim.app" ]; then + VIM_APP_DIR="$i" + break + fi + done +fi +if [ -z "$VIM_APP_DIR" ] +then + echo "Sorry, cannot find MacVim.app. Try setting the VIM_APP_DIR environment variable to the directory containing MacVim.app." + exit 1 +fi +binary="$VIM_APP_DIR/MacVim.app/Contents/MacOS/Vim" + +# Next, peek at the name used to invoke this script, and set options +# accordingly. + +name="`basename "$0"`" +gui= +opts= + +# GUI mode, implies forking +case "$name" in m*|g*|rg*) gui=true ;; esac + +# Restricted mode +case "$name" in r*) opts="$opts -Z";; esac + +# vimdiff and view +case "$name" in + *vimdiff) + opts="$opts -dO" + ;; + *view) + opts="$opts -R" + ;; +esac + +# Last step: fire up vim. +# The program should fork by default when started in GUI mode, but it does +# not; we work around this when this script is invoked as "gvim" or "rgview" +# etc., but not when it is invoked as "vim -g". +if [ "$gui" ]; then + # Note: this isn't perfect, because any error output goes to the + # terminal instead of the console log. + # But if you use open instead, you will need to fully qualify the + # path names for any filenames you specify, which is hard. + exec "$binary" -g $opts ${1:+"$@"} +else + exec "$binary" $opts ${1:+"$@"} +fi diff --git a/bin/run_tags.rb b/bin/run_tags.rb new file mode 100755 index 0000000..87ef0b9 --- /dev/null +++ b/bin/run_tags.rb @@ -0,0 +1,43 @@ +#!/usr/bin/ruby +#-*-ruby-*- +# A script to run ctags on all .rb files in a project. Can be run on +# the current dir, called from a git callback, or install itself as a +# git post-merge and post-commit callback. + +CTAGS = '/opt/local/bin/ctags' +HOOKS = %w{ post-merge post-commit post-checkout } +HOOKS_DIR = '.git/hooks' + +def install + if !File.writable?(HOOKS_DIR) + $stderr.print "The install option [-i] can only be used within a git repo; exiting.\n" + exit 1 + end + + HOOKS.each { |hook| install_hook("#{HOOKS_DIR}/#{hook}") } +end + +def run_tags(dir) + if File.executable?(CTAGS) and File.writable?(dir) + %x{find #{dir} -name \\*.rb | #{CTAGS} -e -f #{dir}/TAGS -L - 2>>/dev/null} + else + $stderr.print "FAILED to write TAGS file to #{dir}\n" + end +end + +def install_hook(hook) + if File.exists?(hook) + $stderr.print "A file already exists at #{hook}, and will NOT be replaced.\n" + return + end + + print "Linking #{__FILE__} to #{hook}\n" + %x{ln -s #{__FILE__} #{hook}} +end + +if ARGV.first == '-i' + install +else + # if GIT_DIR is set, we are being called from git + run_tags( ENV['GIT_DIR'] ? "#{ENV['GIT_DIR']}/.." : Dir.pwd ) +end \ No newline at end of file diff --git a/bin/willmorgan b/bin/willmorgan new file mode 160000 index 0000000..a84bba3 --- /dev/null +++ b/bin/willmorgan @@ -0,0 +1 @@ +Subproject commit a84bba3726a19bc78086852d54bb0219ea1bb6f9 diff --git a/vim/.netrwhist b/vim/.netrwhist deleted file mode 100644 index 939ebe9..0000000 --- a/vim/.netrwhist +++ /dev/null @@ -1,7 +0,0 @@ -let g:netrw_dirhistmax =10 -let g:netrw_dirhist_cnt =5 -let g:netrw_dirhist_1='/Users/yan/dev/cft/builder-tools/get-base-iso' -let g:netrw_dirhist_2='/Users/yan/dev/piglatin' -let g:netrw_dirhist_3='/Users/yan/dev/config/vim/autoload/conque_term' -let g:netrw_dirhist_4='/Users/yan/Documents/Vuze' -let g:netrw_dirhist_5='/Users/yan/dev/config' diff --git a/vimrc b/vimrc index 8a5be6c..04d9f28 100644 --- a/vimrc +++ b/vimrc @@ -218,6 +218,7 @@ let Tlist_Close_On_Select = 1 let Tlist_Show_One_File = 1 let Tlist_Enable_Fold_Column = 0 let Tlist_Display_Prototype = 0 +let Tlist_Use_SingleClick = 1 " automaticaly reload files changed outside of vim set autoread