f



[vim] macros and escape

Hi everyone,

I'm having serious issues with macros, nearly every time I record one I get
something upsidedown and I'm left with a bunch of scrambled text, left in insert
mode, frustrated since the job is not done and angry because there must have
been something I haven't quite understood in the macro recording.

Whenever my macro does not contain any insert mode, so all changes are performed
while in normal mode, everything looks fine. But whenever my macro enters insert
mode and then need to go back to normal mode it seems there's something not
working correctly.

Any hint/ideas/RTFM suggestions?

Al

-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
0
al
12/8/2016 9:42:34 PM
comp.editors 4871 articles. 0 followers. Post Follow

1 Replies
164 Views

Similar Articles

[PageSpeed] 56

In comp.editors, alb <al.basili@gmail.com> wrote:
> Hi everyone,
> 
> I'm having serious issues with macros, nearly every time I record one I get
> something upsidedown and I'm left with a bunch of scrambled text, left in insert
> mode, frustrated since the job is not done and angry because there must have
> been something I haven't quite understood in the macro recording.

Do you record with q? Something else?

I have never had an issue recording with q, but care must be taken to
make sure that the macro either starts or ends by setting up a known
good state. I usually use "ends" for recursive macros, and "starts" for
other ones.

For "known good state", I do things like make sure the cursor is at the
start or end of a word or line with movements like 0, ^, $, B, E
sometimes combined with character searches like fx, Fx, tx, Tx (for
character x). 

Eg: Make sure the state is cursor after first comma on a line:

	0f,l

Elijah
------
also composes macros by hand
0
Eli
12/8/2016 10:40:10 PM
Reply: