[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [vile] question about editing multiple files
From: |
Thomas Dickey |
Subject: |
Re: [vile] question about editing multiple files |
Date: |
Wed, 07 Mar 2012 17:59:10 -0500 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On Wed, Mar 07, 2012 at 10:05:43AM -0500, Paul Fox wrote:
> hymie! wrote:
> >
> > Greetings. I've been a vile user for years, and a question has come up.
> > I hope I can explain this correctly.
> >
> > I have a directory with 20 files. I have to edit all 20 files, and
> > I start off with a simple
> > vi *
> >
> > This loads the files in alphabetical order. But I'm not going to actually
> > edit the files in alphabetical order. I will edit them in a random order
> > which I don't know until I'm actually editing them. (The files refer to
> > each other, you see, and ^X-e is wonderful for this purpose).
> >
> > So I edit file 1, and it refers me (say) to file 3, and then to file 6.
> > I'm done with that chain, so I use :n to edit file 2. I edit file 2, and
> > it refers me (say) to file 9. I'm done with that chain, so I use :n
> > to edit file 3. But I've already edited file 3, and I'm ready to go to
> > file 4.
> >
> > I know that all I have to do is hit :n again. But I'm wondering if there
> > is some way that :n can be "taught" to skip the files that I've edited,
> > and only jump to the next unedited file.
>
> hi -- not that i know of. i think you're looking for a :next-unseen-file
> command, or something like that. it's possible it can be done with a
> stored procedure, but i don't know that the ability to check whether a
> specific file is unseen or not exists.
It could be done with a stored procedure, but there's no state variable
that would be useful. If you look at the [Buffer List], you'll be able
to see a 'u' in the first column for buffers that have not been loaded.
That corresponds to the $bflags state variable - which applies to the
current buffer (which is nice but not helpful here, since you want a
buffer that is not yet loaded).
So... the procedure would have to make sure that [Buffer List] is open
(visible, since it's a scratch buffer that goes away when hidden), and
walk down the lines looking for a leading 'u'. The buffer name is in
a fixed column.
--
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net
signature.asc
Description: Digital signature