Thursday, October 25, 2012

Re: Help using vim script capabilities

Use the right tool for this job which means:

:n **/*.ext
:bufdo %s/ /\\space/g
:wa

or use command line utils only:

find -p0 ... | xargs -0 sed -i -e 's/ /\\space/'
or such.

If you have more time continue with your attempt. Some ideas /notes

command! -nargs=* E exec 'e '.fnameescape(join([<f-args>], ' '))

Within vim you can do

filter(split(glob('**.txt'),"\n"),"v:val =~ '.txt$')

to get a file list, fnameescape may be your friend.

Marc Weber

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: