Sunday, May 25, 2014

Re: puzzling mapping behavior

On 2014-05-25 20:33, tom arnall wrote:
> nmap <c-y> 0i``<CR><esc>:%s/\s\*\n\s\*\n\s\*\n/\r\r/g<CR>/^``<CR>
>
> produces what seems to me an incorrect behavior. if the %s doesn't
> find anything, the cursor ends up on the line after the "``" mark.
> until recently it would land on the first "`" mark, i.e., where i
> want it. adding 'k' to the mapping has no effect

I suspect you want to add the "e" flag after your "g" because the
search fails. You may want to read at

:help map_return " particularly the "when an error is encountered..."

:help :s_flags " for info on the "e" flag

The error causes the mapping to stop being processed before you get
to the search returning you to the double back-ticks.

-tim



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