Indenting lines 400..457 help
Geoff Gerrietts
geoff at gerrietts.net
Wed Apr 10 17:15:55 EDT 2002
Quoting Ned Harvey (rahvee at yaahhoo.com):
> For the life of me, I can't find any easy way to indent (or unindent) lines
> numbered 400..457 or whatever. Does anyone have any good suggestions?
>
> I'm usually a vi user, but I'll happily learn a command of some other
> format. I've tried
> :400,457s/(.*)/ \1/g
> and a ton of variations of the same idea, but it seems that the
> search/replace doesn't do what I expect it to.
In vim, the easiest way is to hit V, scroll down a few lines, then hit
the > key to shift everything right one indent level. If the indent
level is too large, :set shiftwidth=4. I also recommend :set
tabstop=8, :set softtabstop=4, :set expandtab.
In oldschool vi, try:
:400
57>>
Another common trick I use is:
:400,457s/^/ /
Best of luck,
--G.
--
Geoff Gerrietts "Overspecialize and you breed in weakness.
<geoff at gerrietts net> It's slow death." -- Maj. Motoko Kusanagi
http://www.gerrietts.net (Ghost in the Shell)
More information about the Python-list
mailing list