0

I'm trying to make a List variable that contains all the globbed files's filename as it's value.

so far, I'm able to get the file names but I can't seem to make a List out of it. here's my code:

let g:test = {}
let g:test+=glob("~/Projects/js/*")

What seems to be wrong?

2

See :h glob()

If you see a third optional parameter named {list}, then your version of Vim can directly return a List. If you pass 1 here, you'll have a list.

If not, you'll have to :split() glob() result.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.