vimscript create list of files i can jump to (CtrlP or NERDTree or Quickfix?)

144 Views Asked by At

with a vimscript-function, i created an array with list of filepathes.

now i want to open that list in a seperate window, for beeing able to open that files in vim.

it could be like CtrlP or NERDTree or via quickfix or location-lists.

Has someone an idea how to start on that?

1

There are 1 best solutions below

0
On

The easiest way to work with this would be the quickfix window. You can use the list of files with the setqflist() function: http://vimdoc.sourceforge.net/htmldoc/eval.html#setqflist().

You might have to make some adjustments to the data you feed to the function, but it shouldn't be difficult if you already happen to have a list of files.

If you'd like to make the NERDTree show your files, that would be a bit stranger, but you could probably pull it off by using the NERDTreeAddPathFilter() function. You can read up on it by invoking :help NERDTreeAddPathFilter(). The basic idea would be to introduce a filter function that would only display (in the tree) the files that are included within this list.