Saturday, November 26, 2011

:make Success

I want to do this, but only have the ls bit executed if make is successful:

:make | !ls

The help says that "when the command before the '|' generates an error, the following commands will not be executed". I see that ':make' is more or less like doing ':!make 2>&1 /tmp/something', which would always return successful because stderr is redirected to stdout. My aim is to have '!ls' (actually, any arbitrary shell command) only happen when make returned no errors in my file.

Is it not possible, or perhaps I have to do something like

:make | if empty(errorlist) | norm "!ls" | endif

In which case, what would be the most efficient way of typing that?

--

.

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

No comments: