Hi,

Dani Church wrote:
> On Tue, Aug 3, 2010 at 21:32, John Beckett <[email protected]> wrote:
>> The tip had the mapping you suggest above (`[v`]), and I have
>> added an expression mapping using visualmode() to do choose the
>> last selection mode.
> 
> Excellent idea, thanks!  The only caveat is that if you cut your text
> with (e.g.) 3dd, it won't put you into visual line with gp, and if you
> haven't used any visual modes in the document before, it won't put you
> into visual at all.  Thankfully, though, it's easy to switch visual
> modes on the fly, so it's not much of a hassle to fix when it gets it
> wrong. :)  Thanks again!

  nnoremap <expr> gp '`[' . strpart(getregtype(), 0, 1) . '`]'

might work better. getregtype() gets the mode of the last used register.
strpart() is used to get rid of the count that get appended if a block
was pasted.

Regards,
Jürgen

-- 
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us.     (Calvin)

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

Reply via email to