Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 5394f595de
Fetching contributors…

Cannot retrieve contributors at this time

28 lines (22 sloc) 0.968 kb
fun! FindSource()
let word = expand("<cword>")
if has("mac") || has("macunix")
let cmd = 'egrep -Rlw "(class|function) ' . word . '" * | grep -v "cache" | grep -v "log" | grep -v ".svn"'
elseif has("unix")
" temp: mac/macunix not catching correctly.
let cmd = 'egrep -Rlw "(class|function) ' . word . '" * | grep -v "cache" | grep -v "log" | grep -v ".svn"'
"let cmd = 'egrep -Rlw --exclude-dirs=".svn cache" --exclude-dir="cache" "(class|function) ' . word . '" *'
elseif has("win32") || has("win64")
echomsg "Please upgrade to a real OS."
endif
let cmd_output = system(cmd)
if cmd_output == ''
echomsg "Declaration for " . word . " not found!"
else
" @todo if cmd_output not already open in buffer...
" open file in new tab
execute "tabnew " . cmd_output
" better search for [word] via function [word] OR class [word]
execute "/class " . word . "\\|function " . word
endif
endfun
Jump to Line
Something went wrong with that request. Please try again.