Am Donnerstag, 20. November 2014 15:46:38 UTC+1 schrieb Ingo Karkat:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 20-Nov-2014 15:03, Daniel Hahler wrote:
> > Is it possible to source a file (without using `:silent!`), but
> > ignore any of the following errors: - E122: Function Foo already
> > exists, add ! to replace it - E174: Command already exists: add !
> > to replace it - E227: mapping already exists for ...
> > 
> > Using "silent!" also suppresses any output.
> > 
> > I've tried to remove the "silent!" by using a try/catch block, but
> > that aborts the sourcing -
> > https://github.com/Shougo/neobundle.vim/pull/342/files (the
> > revert).
> > 
> > `:source!` (with a bang) has a different meaning already, and it
> > would be nice to use an already existing mechanism.
> 
> 
> I think the answer is already contained in your title: That's what the
> :unsilent command was created for.
> 
>     :silent! unsilent source {file}
> 
> This suppresses the mentioned errors (tested with E122), but keeps any
> :echo output visible.

That works indeed - tested with E174 additionally.
Awesome! 8)


Thanks a lot,
Daniel.

-- 
-- 
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui