Added willmorgan git helper scripts in bin/willmorgan

This commit is contained in:
yan 2011-11-22 13:23:59 -06:00
parent da1e417f4a
commit 5d05414b3f
10 changed files with 126 additions and 11 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
.DS_Store
vim/backups
*un~
vim/.netrwhist
.netrwhist

3
.gitmodules vendored
View File

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

View File

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

1
bash_path Normal file
View File

@ -0,0 +1 @@
export PATH=$PATH:~/.dotfiles/bin:~/.dotfiles/bin/willmorgan/bin

View File

@ -9,3 +9,4 @@ fi
# My aliases and options
. ~/.dotfiles/bash_aliases
. ~/.dotfiles/bash_options
. ~/.dotfiles/bash_path

69
bin/mvim Executable file
View File

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

43
bin/run_tags.rb Executable file
View File

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

1
bin/willmorgan Submodule

@ -0,0 +1 @@
Subproject commit a84bba3726a19bc78086852d54bb0219ea1bb6f9

View File

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

1
vimrc
View File

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