begin  quoting Carl Lowenstein as of Sat, Mar 29, 2008 at 02:40:48PM -0700:
[snip]
> There is definitely more than one way to do it.  :-)
> 
> My favorite recipe, which lets the computer count the lines so I don't
> have to, is:
> 
> Navigate to the starting line, place a Mark there (e.g. a)
> ma
> Navigate to the ending line, perform action between Mark and Dot
> (current position)
> :'a,.s/that/this/

I do not use marks (or registers) enough.

Mostly, I use marks as safety mechanisms so I can get back to where
I was before I do some potentially-position-changing command, like
a %s substitution.

For example, I reformat or paste some code, and notice that I have trailing
whitespace all over; to fix, I type :%s/  *$// -- but I may end up in a
very different part of the file. So the command becomes ma:%s/  *$//'a
and all is well.

Vim has spoiled me for using marks to determine selections, so that
use doesn't spring to mind.

> Mark and Dot sound very much like TECO constructs, come to think of it.

TECO gets everywhere.

-- 

Stewart Stremler


-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to