
Journal nizo's Journal: Oh how I love vi 37
I can edit a 2+ gigabyte text file to delete 2,955,867 lines in the middle of it, and it actually works. Damn slow, but it works.
I can edit a 2+ gigabyte text file to delete 2,955,867 lines in the middle of it, and it actually works. Damn slow, but it works.
To save a single life is better than to build a seven story pagoda.
sed/ed works, too. (Score:2)
vi can barf on stuff big time; especially very long lines.
Re: (Score:2)
Re: (Score:1)
Re: (Score:2)
WTF crappy version of vi are you using? Even that traditional Unix vi (as I believe is found on AIX) could handle that with ease.
Re: (Score:1)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
But that little bit of projection into human UI space makes all the difference. Pretty powerful model when you think about it
Obligatory emacs defense (Score:2)
Emacs can do that, too. (I think.) ;)
And, it's a perfectly valid operating system. :D
Re: (Score:2)
Yeah, but in vi I get type stuff like:
If I was using emacs I would still be looking for my key
Re: (Score:1)
Re: (Score:2)
He could have done 4G4984388dd :)
Or, if we are a little sick in the head, 4G4984387Jdd :o
I once had a 800 MB xml file that needed all the & replaced with &. vim did it before the supergeniuses I was working with managed to get it ftp'd from the server to a machine with WordPad.
Re: (Score:1)
?
ed doesn't know what you are talking about, and neither do I.
Re: (Score:2)
4G - navigate to the forth line.
100000J - join the line below to the end of this one, 100,000 times.
dd - delete the current line.
How-to (Score:2)
[Ctrl]+[space]
[Ctrl]+x, l, 984392
[Ctrl]+w
Where I've got [Ctrl]+x, l mapped to M-x goto-line.
Re: (Score:2)
Errr... marks? Set mark A on the first line you want to delete, move the cursor to the last line, then d'a
Much easier than trying to work out (and remember) line numbers. You can, of course, use marks in ex commands, too.
Re: (Score:2)
I never did use marks much; did they even exist in the earliest versions of vi? ^G will tell you which line you are on in vi; the line number is already displayed in vim. Like most unix tools, there are several ways to do anything....
Re: (Score:2)
They've been there as long as I've been using vi (18 years now).
Re: (Score:2)
Re: (Score:2)
Actually, modern OS and hardware specifications may have finally caught up with emacs...
Re: (Score:2)
vi under Windows (Score:2)
The only thing I hold against UltraEdit is that there is no vi emulation. So, for my vi fix I have to use either this [winvi.de] or this [vim.org] when working under Windows.
Real Men Use 'cat' (Score:2)
Re: (Score:1)
Is there anything vi can't do? (Score:2)
I use vim for all my programming. Between vim+grep and other unix tools, who needs an IDE?
Re: (Score:2)
Yes a gui is nice (when it works), but what happens when you want to do something the gui wasn't designed for? Like, say, change something across multiple records? As much as I would like to click through hundreds of records and change one thing (say, area code, which might actually happen here), I would rather dump our ldap database, use vi to make the substitution, and then dump it all back in. Or I could write a perl program
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
you program like a girl.
Re: (Score:2)
Re: (Score:2)
still like java and c.
LOVE vi.
Re: (Score:2)
Ahh, a masochist
Re: (Score:2)
i'll do the bash script though--pretty handy. i'm doing more scripting these days actually. bash scripting for simple things, java or c for more complicated things.
Re: (Score:1)
Internet Access Requirements (Score:2)
OK, I still believe it, but it is too late now.
Then again, some people might say you should be able to edit text files with cat grep sed & awk (or is it just sed?) something something, or ed.
No, vi was the pinnacle of editors.
Every editor should be able to go into a "vi mode."
Re: (Score:2)
I do edit text files with cat, grep, sed and awk. And do some middlin'-creative mangling on the side (awk's associative arrays are really useful for some things, and are usable by people who haven't the time to learn Perl).
I doubt that the writers of DO-178B ever had awk scripts in mind, but I've used awk in the process of writing to the standard (mostly, checking my work).
Re: (Score:2)