From ed5e9069066d1226a2ff227eb1a84a4ce830fdcc Mon Sep 17 00:00:00 2001 From: Kyle West Date: Tue, 24 Jan 2012 13:42:00 -0500 Subject: [PATCH] ctags is more compatible with OSX and homebrew. --- bin/run_tags.rb | 14 +++++++++----- vim/plugin/settings/Tlist.vim | 9 ++++----- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/bin/run_tags.rb b/bin/run_tags.rb index 87ef0b9..5c9a651 100755 --- a/bin/run_tags.rb +++ b/bin/run_tags.rb @@ -3,8 +3,12 @@ # 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. +# More info here: http://vimeo.com/3989493 +# +# This fork will work with homebrew installed ctags on OS X ("brew install ctags") +# Source: https://gist.github.com/1564787 -CTAGS = '/opt/local/bin/ctags' +CTAGS = '/usr/local/bin/ctags' HOOKS = %w{ post-merge post-commit post-checkout } HOOKS_DIR = '.git/hooks' @@ -13,13 +17,13 @@ def install $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} + %x{find #{dir} -name \\*.rb | #{CTAGS} -f #{dir}/TAGS -L - 2>>/dev/null} else $stderr.print "FAILED to write TAGS file to #{dir}\n" end @@ -30,7 +34,7 @@ def install_hook(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 @@ -40,4 +44,4 @@ if ARGV.first == '-i' 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 +end diff --git a/vim/plugin/settings/Tlist.vim b/vim/plugin/settings/Tlist.vim index 3ffecdd..d7e066e 100644 --- a/vim/plugin/settings/Tlist.vim +++ b/vim/plugin/settings/Tlist.vim @@ -1,12 +1,12 @@ " set up automatic ctags -let Tlist_Ctags_Cmd='/opt/local/bin/ctags' +let Tlist_Ctags_Cmd='ctags' -" taglist defaults +" taglist defaults let Tlist_Auto_Highlight_Tag=0 let Tlist_Auto_Open=0 let Tlist_Compact_Format = 1 -let Tlist_Exist_OnlyWindow = 1 -let Tlist_WinWidth = 40 +let Tlist_Exist_OnlyWindow = 1 +let Tlist_WinWidth = 40 let Tlist_GainFocus_On_ToggleOpen = 1 let Tlist_Show_Menu = 1 let Tlist_Use_Right_Window = 1 @@ -16,4 +16,3 @@ let Tlist_Show_One_File = 1 let Tlist_Enable_Fold_Column = 0 let Tlist_Display_Prototype = 0 let Tlist_Use_SingleClick = 1 -