sponsor Vim development Vim logo Vim Book Ad

rargs.vim : read the contents of many files at one time.

 script karma  Rating 2/2, Downloaded by 1021  Comments, bugs, improvements  Vim wiki

created by
omi taku
 
script type
utility
 
description
':RArgs' command that this plugin defined can read
selected files contents at one time.
( like :read command, but for multiple files. )


------------------------------------------------------------------------------
[command format]

" read {filename1}, {filename2}, and {filename3},
" contents are inserted into N.
:[N]RArgs [++opt] {filename1} [{filename2} {filename3}...]

[N]
    contents read are inserted into the specified line,
    or not specify line, contents are inserted into cursor position.

[++opt]
    file reading option.
    see ':help ++opt', for more information.

{filename1} [{filename2} {filename3}...]
    filepath list.


------------------------------------------------------------------------------
[filepath parameters]

" read sample1.txt, sample2.txt, and sample3.txt
:RArgs sample1.txt sample2.txt sample3.txt

" wildcards are allowed
:RArgs sample*

" Vim special keywords are allowed
:RArgs #2 #4 #6<.bak

" reading the file at multiple times are allowed
:RArgs sample1.txt sample1.txt sample1.txt

" file encoding, file format
:RArgs ++enc=utf-8 ++ff=unix sample1.txt sample2.txt sample3.txt


------------------------------------------------------------------------------
[inserting file position]

If you do not specify line number,
the contents of selected files are inserted into cursor line.

" contents are inserted into cursor line.
:RArgs sample1.txt sample2.txt sample3.txt

" contents are inserted into specified line.
:200RArgs sample1.txt sample2.txt sample3.txt

" contents are inserted into first line of buffer.
:0RArgs sample1.txt sample2.txt sample3.txt


------------------------------------------------------------------------------
[Configuration]

'g:rargs_exit_when_error'

If you set 1 to 'g:rargs_exit_when_error',
exit when error is found. Default aciion is error is ignored.

let g:rargs_exit_when_error = '1'

 
install details
copy rargs.vim into your plugin directory.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
rargs.vim 0.2 2009-09-17 7.0 omi taku add exception handling logic.
++opt parameter is supported.
option 'g:rargs_exit_when_error' is supported.

rargs.vim 0.1 2009-09-16 7.2 omi taku Initial upload
ip used for rating: 18.191.228.88

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github