Re: vim: suggestion: multiple __CONTIGUOUS__ files
>>Neil Zanella wrote:I have a unix script called 'vg', or 'vgroup' which does almost exactly
>>>This time I have something which I believe is something really innovative
>>>that has not been done before, or perhaps it has. Suppose there are N
>>>files to be opened at once with vim. Instead of displaying all of
>>>them on the same window, they could be displayed in the same
>>>way that they would appear when concatenating them with the
>>>cat utility and piping them through less. The exception
>>>is that each file is separated by one of those reverse
>>>video lines in vim displaying the title of the file.
>>>Only the bottom of each file is concatenated to
>>>the top of the very next one using this scheme.
>>>Perhaps this is not so innovative, but has it
>>>been done? One could still use the tab key
>>>to go from one window to another.
>>>Can this be done using vim???
what you ask.
vg file1 file2 .... fileN
combines files into single file with unique separator line between them,
then opens single file with editor, then (after editor quits) script
unpacks files back.
The script works for me (in Unix) and I use it from time to time.
It's convenient for global search and replace.
The script can be improved, but it's good enough for me.
I wonder whether it's correct to post such vim wrapper' script
to 'scripts' collection at vim.org. But on the other hand, such
thing can be done as vim plugin, also.
It's easy to add syntax highlighting for separator lines for
such thing but it's not done yet.
The script is smart enough to choose correct unique separator
to ensure that separator is such that is does not occur inside given files.
The script also correctly handles files with missing newlines
at end of file. This somehow complicates the script.