Hi Benjamin!

On Di, 23 Nov 2010, Benjamin R. Haskell wrote:

> I'm finally setting out to create some useful mappings for the way I  
> like to use vimdiff.  As part of this, I noticed that 'u' for undo  
> doesn't revert a :diffput command.  It makes sense, since the change  
> technically occurs in a different buffer, but I was wondering whether  
> anyone had a clever mapping or workaround for that.

Hm, something like this may be:
nmap <expr> u histget('cmd',-2)=~'diffput'?'<C-W>pu<C-W>p':'u'

This probably won't get all corner cases, only when the last entered 
command was :diffput. 

> Really the main thing I'm adding is to map both '>' and '<' to  
> ':.diffput', so that < and > feel like pushing lines from one buffer  
> into another.  So, I guess I'd also be open to generally-useful vimdiff  
> mappings.

Oh, sounds interesting. Please share.

regards,
Christian
-- 
Das Schöne ist eine Manifestation geheimer Naturgesetze, die 
uns ohne dessen Erscheinung ewig wären verborgen geblieben.
                -- Goethe, Maximen und Reflektionen, Nr. 1166

-- 
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
  • Undo in vimdiff Benjamin R. Haskell
    • Re: Undo in vimdiff Christian Brabandt

Reply via email to