summaryrefslogtreecommitdiffstats
path: root/vimrc
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2009-11-23 02:52:03 -0600
committerJesse Luehrs <doy@tozt.net>2009-11-23 02:54:06 -0600
commita071bfe5018f7877f46c71a184ecd55133bd1805 (patch)
treea2c6c6d16cfdc034950fc6a4f80e6c4fc8bfbd6f /vimrc
parent8e08ed43389c6497a7ae09413b48425fdeb143ac (diff)
downloadconf-a071bfe5018f7877f46c71a184ecd55133bd1805.tar.gz
conf-a071bfe5018f7877f46c71a184ecd55133bd1805.zip
allow dc macro to work from subdirectories in a git repository
Diffstat (limited to 'vimrc')
-rw-r--r--vimrc5
1 files changed, 4 insertions, 1 deletions
diff --git a/vimrc b/vimrc
index 0aed79a..8670227 100644
--- a/vimrc
+++ b/vimrc
@@ -386,7 +386,10 @@ function s:vcs_orig(file)
elseif finddir('_darcs', dir . ';') =~ '_darcs'
return system('darcs show contents ' . a:file)
elseif finddir('.git', dir . ';') =~ '.git'
- return system('git show HEAD:' . a:file)
+ let prefix = system('git rev-parse --show-prefix')
+ let prefix = substitute(prefix, '\n', '', 'g')
+ let cmd = 'git show HEAD:'.prefix.a:file
+ return system(cmd)
else
throw 'No VCS directory found'
endif