From fbcf6fd739f30902e3a815f889d844b60e1cb750 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Fri, 8 Nov 2013 10:01:11 -0500 Subject: [PATCH] custom modifications for qnamefile --- plugin/qnamefile.vim | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/plugin/qnamefile.vim b/plugin/qnamefile.vim index 658f9dc..be5535f 100644 --- a/plugin/qnamefile.vim +++ b/plugin/qnamefile.vim @@ -32,7 +32,14 @@ let g:qnamefile_regexp = 0 " a:extensions A space separated list of extensions to filter on (e.g. "java cpp h") function! QNameFileInit(path, extensions, include_hidden) let path = a:path - if !path + if path != "" + let path = "" + for path_part in split(a:path, " ") + if isdirectory(path_part) + let path = path . path_part . " " + end + endfor + else let path = '.' endif let ext = '' @@ -44,11 +51,12 @@ function! QNameFileInit(path, extensions, include_hidden) if !a:include_hidden let hidden = '-not -regex ".*/\..*"' endif - let ofnames = sort(split(system('find ' . a:path . ' -type f ' . hidden . ' ' . ext . ' -print'), "\n")) + "let ofnames = sort(split(system('find ' . a:path . ' -type f ' . hidden . ' ' . ext . ' -print'), "\n")) + let ofnames = sort(split(system('find ' . path . ' -name .git -prune -o -name .svn -prune -o -not -type f -o -print'), "\n")) let g:cmd_arr = map(ofnames, "fnamemodify(v:val, ':.')") call QNamePickerStart(g:cmd_arr, { \ "complete_func": function("QNameFileCompletion"), - \ "acceptors": ["v", "s", "t", "\", "\", "\"], + \ "acceptors": ["v", "s", "t", "\", "\", "\", "\", "\", "\"], \ "cancelors": ["g", "\", s:qnamefile_hotkey], \ "regexp": g:qnamefile_regexp, \ "use_leader": g:qnamefile_leader, @@ -57,11 +65,11 @@ function! QNameFileInit(path, extensions, include_hidden) endfunction function! QNameFileCompletion(index, key) - if a:key == "s" || a:key == "\" + if a:key == "s" || a:key == "\" || a:key == "\" let cmd = "sp" - elseif a:key == "v" || a:key == "\" + elseif a:key == "v" || a:key == "\" || a:key == "\" let cmd = "vert sp" - elseif a:key == "t" || a:key == "\" + elseif a:key == "t" || a:key == "\" || a:key == "\" let cmd = "tabe" else let cmd = "e"