On Wed, Mar 14, 2012 at 21:30, Tim Chase <[email protected]> wrote:
> I tested a bit and came up with
>
> :nnoremap Q
> ?\%<c-r>=line('.')<cr>l\({}\\|\[]\\|()\\|""\\|''\\|><lt>\)?s+1<cr>
>
> which seems to do what you intend. Or you can use the line-noise of
>
> nnoremap Q
> ?<bslash>%<c-r>=line('.')<cr>l\({}<bslash><bar><bslash>[]<bslash><bar>()<bslash><bar>""<bslash><bar>''<bslash><bar>><lt><bslash>)?s+1<cr>
>
> as I think there are various escaping issues on the backslashes, pipes and
> square-brackets.
>
> I like the "?s+1" to position the cursor because I could then use i_CTRL-O
> to launch the mapping and end up where I intend:
>
> :imap <f4> <c-o><f4>
>
> And obviously if you want, you can still use "ii" for your mapping instead
> of <f4> (or whatever other single key you might want).
>
> -tim
>
>
>
>
Thanks, I pieced these three together for absolute nirvana:
imap ii <Esc>
imap kk <Esc>A
imap jj
<Esc>?\%<c-r>=line('.')<cr>l\({}\\|\[]\\|><\\|()\\|""\\|''\\|><lt>\)?s+1<cr>i
I haven't found any problems with backslashes in the test cases I
played with, so even if there are some corner-case escaping issues I
am very pleased with the result.
Thank you very much for taking the time to help piece this together,
and especially for teaching me and showing me how to understand. That
is the real value!
I wish to you and to those you love a peaceful evening. Thank you!
--
Dotan Cohen
http://gibberish.co.il
http://what-is-what.com
--
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