Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " Goal: Create a line with: foobar1 foobar2 ... foobar19
- " Note: the_isz solves this example without Nexus, using the much simpler:
- " join(map(range(1,19), '"foobar" . v:val'), " ")
- " First approach is using normal mode commands and a substitute:
- call s1.reset()
- $
- normal 19ix
- s/x/\="foobar".s1.next()/g
- normal o
- " Second approach uses vimscript:
- call s1.reset()
- call setline('$', join(map(range(1,19), "printf('foobar%d', s1.next())"), ' '))
- " alternatively, if you don't need printf power, use the simpler case below:
- call setline('$', join(map(range(1,19), '"foobar".s1.next()'), ' '))
Advertisement
Add Comment
Please, Sign In to add comment