Permalink
Browse files

Make paths relative to scripts.

This allows the plugin to live in a directory other than ~/.vim.  This
useful when used with something like pathogen, where the plugin lives
in ~/.vim/bundle/cocoa or similar subpath.
  • Loading branch information...
1 parent 0f164ee commit a5eaf14edc3810246105594d15e581bfd826db62 @threeve threeve committed Jan 26, 2010
Showing with 4 additions and 3 deletions.
  1. +1 −1 autoload/objc/cocoacomplete.vim
  2. +3 −2 lib/get_methods.sh
@@ -3,7 +3,7 @@
" Last Updated: June 30, 2009
" Description: An omni-completion plugin for Cocoa/Objective-C.
-let s:lib_dir = fnameescape($HOME.'/.vim/lib/')
+let s:lib_dir = fnameescape(expand('<sfile>:p:h:h:h').'/lib/')
let s:cocoa_indexes = s:lib_dir.'cocoa_indexes/'
if !isdirectory(s:cocoa_indexes)
View
@@ -1,3 +1,4 @@
-classes=`grep -m 1 ^$1 ~/.vim/lib/cocoa_indexes/classes.txt`
+dir=`dirname $0`
+classes=`grep -m 1 ^$1 ${dir}/cocoa_indexes/classes.txt`
if [ -z "$classes" ]; then exit; fi
-zgrep "^\($classes\)" ~/.vim/lib/cocoa_indexes/methods.txt.gz | sed 's/^[^ ]* //'
+zgrep "^\($classes\)" ${dir}/cocoa_indexes/methods.txt.gz | sed 's/^[^ ]* //'

0 comments on commit a5eaf14

Please sign in to comment.