custom modifications for qnamefile
This commit is contained in:
parent
588ddbe054
commit
fbcf6fd739
@ -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", "\<M-v>", "\<M-s>", "\<M-t>"],
|
||||
\ "acceptors": ["v", "s", "t", "\<M-v>", "\<M-s>", "\<M-t>", "\<C-v>", "\<C-s>", "\<C-t>"],
|
||||
\ "cancelors": ["g", "\<C-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 == "\<M-s>"
|
||||
if a:key == "s" || a:key == "\<M-s>" || a:key == "\<C-s>"
|
||||
let cmd = "sp"
|
||||
elseif a:key == "v" || a:key == "\<M-v>"
|
||||
elseif a:key == "v" || a:key == "\<M-v>" || a:key == "\<C-v>"
|
||||
let cmd = "vert sp"
|
||||
elseif a:key == "t" || a:key == "\<M-t>"
|
||||
elseif a:key == "t" || a:key == "\<M-t>" || a:key == "\<C-t>"
|
||||
let cmd = "tabe"
|
||||
else
|
||||
let cmd = "e"
|
||||
|
Loading…
x
Reference in New Issue
Block a user