Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

update fuzzyfinder_textmate to display relative paths in the status l…

…ine with %f
  • Loading branch information...
commit b9d541db520268aa6c7e2cb29effe66e05a4d72b 1 parent 0dd4743
@sethbc sethbc authored
Showing with 31 additions and 0 deletions.
  1. +31 −0 fuzzyfinder_textmate.vim
View
31 fuzzyfinder_textmate.vim
@@ -17,6 +17,33 @@ function! s:HighlightError()
syntax clear
syntax match Error /^.*$/
endfunction
+
+function! s:OpenBuffer(nr, mode)
+ execute printf([
+ \ ':%sbuffer',
+ \ ':%ssbuffer',
+ \ ':vertical :%ssbuffer',
+ \ ':tab :%ssbuffer',
+ \ ][a:mode], a:nr)
+endfunction
+
+function! s:OpenFile(path, mode)
+ let nr = bufnr('^' . a:path . '$')
+ if nr > -1
+ call s:OpenBuffer(nr, a:mode)
+ else
+ execute [
+ \ ':edit ',
+ \ ':split ',
+ \ ':vsplit ',
+ \ ':tabedit ',
+ \ ][a:mode] . s:EscapeFilename(a:path)
+ endif
+endfunction
+
+function! s:EscapeFilename(fn)
+ return escape(a:fn, " \t\n*?[{`$%#'\"|!<")
+endfunction
" ------------------------------------------------------------------------------------
" }}}
" ====================================================================================
@@ -132,6 +159,10 @@ RUBY
call g:FuzzyFinderMode.TextMate.launch(a:initial_text, a:partial_matching)
endfunction
+ function! g:FuzzyFinderMode.TextMate.on_open(expr, mode)
+ call s:OpenFile(fnamemodify(a:expr, ':~:.'), a:mode)
+ endfunction
+
let g:FuzzyFinderOptions.TextMate = copy(g:FuzzyFinderOptions.File)
endfunction "}}}
Please sign in to comment.
Something went wrong with that request. Please try again.