vile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vile] substitute-all-til or 'g' flag anchor behavior


From: Wayne Cuddy
Subject: [vile] substitute-all-til or 'g' flag anchor behavior
Date: Mon, 29 Dec 2014 14:03:09 -0500
User-agent: Mutt/1.4.2.3i

Given the following lines:

## comment line 1
## comment line 2
## comment line 3
## comment line 4

If I move to line 1 and then do ^X-sG using ^# as the subst pattern
and specify an empty replacement pattern than I end up with.

# comment line 1
# comment line 2
# comment line 3
# comment line 4

But instead I end up with

 comment line 1
 comment line 2
 comment line 3
 comment line 4

The same thing happens for :1,$s,^#,,g I know there are various was to
do this but this behavior is different than all other vi variants I've
worked with as I'd expect the ^ anchor to only remove the # at the
beginning of the line.

It works as I'd expect if the characters and anchor are switched to
the end of the line. For instance:

comment line ##
comment line ##
comment line ##
comment line ##
comment line ##

If the subst pattern is specified as #$ with an empty replacement then
I end up with:

comment line #
comment line #
comment line #
comment line #
comment line #

Wayne



reply via email to

[Prev in Thread] Current Thread [Next in Thread]