I flip between ex commands and macros for semi-automated file
conversion and most of what I'd say has been covered, but I'll toss in
a personal quirk from my .vimrc.
By default, both ` and ' do approximately the same thing in that they
jump to a mark (' is a linewise `, it positions the cursor at
> Ok. So a possible shortcut to type this could be:
>*:%s///&_/gc
> Then: yn to accept/reject substitutions.
Definitely, if that's good with your workflow. I find
it disturbing to jump to another location (triggered by
the initial "*") so I tend not to use it, but your way
is certainly parsi
"Tim Chase" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
: > While editing a file, I decide to rename "someIdentifier" to
: > "someIdentifier_" - I will need to append the underscore to
: > several (but usually not all) instances of the word.
:
: The typical way to do this would be
Tim Chase wrote:
[...]
You can read about ":s"ubstitute commands and the various
flags at
:help :s
:help :s_flags
This is a jet-fuel-powered version of search-and-replace
that one finds in most editors. The {pattern} portion has
an incredible degree of complexity for finding precisely the
Ivan Vecerina wrote:
[...]
While editing a file, I decide to rename "someIdentifier" to
"someIdentifier_" - I will need to append the underscore to
several (but usually not all) instances of the word.
[...]
Here's how I would do that:
Let's assume your current directory (as shown by ":pwd") is
> Thank you (and Jürgen too), @@ is an easy first step for
> me.
Glad to have some easy first steps to help you out.
>> Alternatively, problems can often be rephrased in terms
>> of an Ex command that uses the ":%s" or ":g"/":v" to
>> perform changes across the entire file.
>
> [...]
>
>> By cha
[ again, trying to workaround messy newline conversions ]
Thank you (and Jürgen too), @@ is an easy first step for me.
Next:
"Tim Chase" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
: Alternatively, problems can often be rephrased in terms of an
: Ex command that uses the ":%s" or "
Thank you (and Jürgen too), @@ is an easy first step for me.
Next:
"Tim Chase" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
: Alternatively, problems can often be rephrased in terms of an Ex
:
command that uses the ":%s" or ":g"/":v" to perform changes
: across the
entire fil
> I sometimes want to repeat a sequence of operations
> like I would repeat a single command.
[cut]
> The obvious choice to repeat multiple operations is to record
> a macro (for example: qq02r/q ), and replay it with @q.
> Unfortunately, '.' after @q only replays the last action
> within the macr
Hi,
Ivan Vecerina wrote:
>
> I sometimes want to repeat a sequence of operations
> like I would repeat a single command.
> For example, I can repeat with '.' something like:
> gI//{is a single operation '.' repeats all}
> But I cannot as easily repeat:
> 02r/{ '.' will repeat the 2r/ ,
Hi,
I sometimes want to repeat a sequence of operations
like I would repeat a single command.
For example, I can repeat with '.' something like:
gI//{is a single operation '.' repeats all}
But I cannot as easily repeat:
02r/{ '.' will repeat the 2r/ , but not the move to 0 }
[ Let's not
11 matches
Mail list logo