In the current buffer I have a list of file paths (one per line). I want set “args” to that file list.
How can I do this?
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Explanation:
getline(1, line('$'))will return a list of lines in the current buffer (from the first (1) to the last (line('$')) line,map(getline(1, line('$')), 'fnameescape(v:val)')will escape all filenames in case they contain spaces or other special characters,join(...)will join the resulting list by inserting space between every two list items, then it will passed to anargscommand byexecute.