This is perhaps a beginner question, but I'm unable to (intuitively) figure out how to redirect the output of an ex command to a variable for further processing.
Some background: I'm trying to create a list of file paths that I want to pass to fzf, and so I'm concatenating several sources into a list. In effect, what I want is something like this:
let list1 = split(system($FZF_DEFAULT_COMMAND), "\n")
let list2 = map(range(1, bufnr('$')),'bufname(v:val)')
let list3 = :oldfiles
call fzf#run({'source': list1 + list2,
\ 'sink': 'e',
\ })
My problem is with the :oldfiles list. I can't find the correct syntax to capture the output of that ex command int a local variable list3. I've tried the obvious (let list3 = :oldfiles) and some other options (&oldfiles, call oldfiles(), :oldfiles | list3, :oldfiles > list3, let list3 = :redir <CR> :oldfiles <CR> :redir END <CR>, etc. to no avail.
Thank you.
:help! – Rich Aug 07 '17 at 16:34:help splitshows info on buffer splittinf and nothing about the string splitting function I guessed existed via trial and error. – Mahmoud Al-Qudsi Aug 07 '17 at 17:42i_(/respc_,v_). Search patterns start with/(->:h /\s). Other tags (normal mode mappings, variables, concepts,...) aren't decorated -- I can't remember of any other exceptions. – Luc Hermitte Aug 07 '17 at 20:16