Skip to content

Instantly share code, notes, and snippets.

@rasmusto
Last active December 16, 2015 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rasmusto/5424432 to your computer and use it in GitHub Desktop.
Save rasmusto/5424432 to your computer and use it in GitHub Desktop.
run clojure code from vim-fugitive buffer
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