1

So, I found this useful answer about iterating buffers; but due to the tabpage-specific duality of windows in Vim, I failed at adapting it to my needs.

Thus: how can I construct a boolean expression, determining whether or not any (not just the current) window in the tabpage is in &diff-mode?

4

You can sum up the values of &diff for each window, and see if the total is > 0:

let any_diff = 0
windo let any_diff += &diff
echo any_diff . ' windows in diff mode'
if any_diff > 0 | do stuff | endif

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.