Sunday, December 11, 2011

Re: :make Success

On Saturday, 26 November, 2011 at 23:22:16 GMT, Paul wrote:
> I want to do this, but only have the ls bit executed if make is successful:
>
> :make | !ls

I expanded on this by doing a make automatically when a buffer is saved:

autocmd BufWritePost *.pl make

Now, I can do this:

:w | if getqflist() == [] | [whatever] | endif

ie, if there's nothing in the quickfix list, do whatever.

So, I thought instead of wrapping my whatever in an 'if', I could define a function that would test the quickfix list and break out of the command if necessary:

:w | thefunction() | [whatever]

That would be a lot less typing, but I couldn't find a command that would do that. I could return 0, but I would have to test for that, taking me back to square one.

--

.

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