Niels Grundtvig Nielsen | 16 Aug 2012 11:41
Picon

paste works once, register then garbled

ViM 7.3.46 on Windows XP
big version with GUI

1. copy block of text to register a with "ay6

2. record macro sequence
    /\t21
    "ap;
   
3. result first time: cursor moves to first line containing [tab]21, content of register a pasted below line

4. result next time: gibberish string pasted in - see screenshot if the line below doesn't show solid blocks

█K8\t█KE█KD█kb^M"ap^[^[

What's going on? why are the keystrokes being pasted in instead of interpreted?

Thanks in advance for helping me sort this out – life's too short to do hundreds of copy/paste manœuvres by hand :-}

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Simon Ruderich | 16 Aug 2012 14:27

Re: paste works once, register then garbled

On Thu, Aug 16, 2012 at 11:41:24AM +0200, Niels Grundtvig Nielsen wrote:
> 1. copy block of text to register *a* with "ay6
>
> 2. record macro sequence

Which register did you use to record the macro sequence? If you
used qa, then the macro is stored in register a - therefore
destroying the original content you yanked.

> [snip]

Regards,
Simon
--

-- 
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9
John Little | 17 Aug 2012 03:06
Picon

Re: paste works once, register then garbled

On Thursday, August 16, 2012 9:41:24 PM UTC+12, eNG1Ne wrote:

> 1. copy block of text to register a with "ay6

In normal mode that's an incomplete command, unless you're in visual mode, in which case it has an extra 6.  In
command mode, that is
:"ay6 
it's a comment, so a no-op, so it doesn't put anything in register a.

The incomplete command will swallow another keystroke, confusing things, and possibly triggering an
error and so not putting anything in register a.

Also, in
"ap;

the ; looks spurious, maybe you wanted n.

It looks like your gibberish is a previously recorded macro into register a, one
where you pressed arrow keys, I think, and then tried to abandon by typing escape twice.  If you had recorded
into register a it would look like 
/\t21^M"ap;

HTH, regards, John Little

--

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

eNG1Ne | 20 Aug 2012 09:43
Picon

Re: paste works once, register then garbled

Thanks! seems to be simply the "re-use of registers" question; I hadn't realised that 'paste to a' and
'record keystrokes to a' would use the same a. (not as dumb as it might sound <g> I spend most of my working day
in an environment where, for example, "apply character style" and "apply paragraph style" maintain
separate registers)

Anyway, I'll know for next time! and save myself a lot of time and typing.

--

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


Gmane