Created
April 28, 2015 10:33
-
-
Save jbgutierrez/a208c2700459967d0194 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/autoload/gitgutter/utility.vim b/autoload/gitgutter/utility.vim | |
index cecc887..62512d4 100644 | |
--- a/autoload/gitgutter/utility.vim | |
+++ b/autoload/gitgutter/utility.vim | |
@@ -124,7 +124,15 @@ function! gitgutter#utility#file_relative_to_repo_root() | |
endfunction | |
function! gitgutter#utility#command_in_directory_of_file(cmd) | |
- return 'cd ' . gitgutter#utility#shellescape(gitgutter#utility#directory_of_file()) . ' && ' . a:cmd | |
+ let cmd = 'cd ' . gitgutter#utility#shellescape(expand('%:p:h')) . ' && ' . a:cmd | |
+ | |
+ let file = resolve(expand('%:p')) | |
+ let mktFile = substitute(file, '/Volumes/nas/static/', '/Users/javierbgut/www/repos/static.git/', '') | |
+ if file != mktFile && filewritable(mktFile) | |
+ let contents = getline(1,'$') | |
+ call writefile(contents, mktFile) | |
+ endif | |
+ return substitute(cmd, '/Volumes/nas/static/', '/Users/javierbgut/www/repos/static.git/', '') | |
endfunction | |
function! gitgutter#utility#highlight_name_for_change(text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment