Last active
December 16, 2015 10:59
-
-
Save rasmusto/5424432 to your computer and use it in GitHub Desktop.
run clojure code from vim-fugitive buffer
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
function! s:repl.includes_file(file) dict abort | |
let is_zipfile = matchstr(a:file, '\C^zipfile:.*::') | |
let is_fugitive = matchstr(a:file, '\C^fugitive:\/\/.*') | |
if !empty(is_zipfile) | |
let file = substitute(a:file, '\C^zipfile:\(.*\)::', '\1/', '') | |
elseif !empty(is_fugitive) | |
let file = substitute(a:file, '\C^fugitive:\/\/\(.*\)', '\1', '') | |
let file = substitute(file, '\/\.git\/\/[^\/]\+', '', '') | |
else | |
let file = a:file | |
endif | |
for path in self.path() | |
if file[0 : len(path)-1] ==? path | |
return 1 | |
endif | |
endfor | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment