Sunday, February 14, 2016

Re: problem with a map

On Feb 14, Cesar Romani wrote:
>I'm using vim 7.4.1317 on Windows 7.
>
>I often use the following command:
>:g/^\d\+\.$/normal O jVjjJ
>
>and I'd like to use it in a map. How can do it?
>
>I tried with:
>map ,p :g/^\d\+\.$/normal O jVjjJ
>
>but it doesn't work.
>
>I also noted that
>exe "g/^\\d\\+\\.$/normal O\<Esc>jVjjJ"
>works, but not when it is inside a map, as in:
>map ,p exe "g/^\\d\\+\\.$/normal O\<Esc>jVjjJ"

I only see a couple things wrong with your mapping.

1. I'm assuming you want an escape ( ) after the O.
2. You need to put <cr> at the end of your mapping unless you want to press
enter every time you fire the mapping.

That should get it working.

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment