1

I really like the vimdiff / vim -d , it's awesome.

But I need to see the vimdiff result without enter in the interactive mode.

Show the result colored , scrolling all differences and exit. Behave like a diff -y, side-by-side, but with the benefits of the colored and diff configuration from vim.

4
  • What are you actually trying to accomplish that Vim's interactive mode is blocking?
    – 8bittree
    Jul 3, 2019 at 19:02
  • @8bittree , not sure what you mean with blocking,the idea is just scroll the diff result and back to the prompt, just like diffcommand but with vim output format.
    – ceinmart
    Jul 3, 2019 at 23:45
  • I mean why are you trying to avoid entering interactive mode? Usually the reason to avoid interactive mode is to do something with a pipeline, but you also want color which has a tendency to make pipeline processing very difficult.
    – 8bittree
    Jul 5, 2019 at 17:20
  • If you just want coloring, there are several syntax highlighting pagers
    – D. Ben Knoble
    Nov 30, 2019 at 21:55

2 Answers 2

1

Before saving a file, I frequently verify changes before saving using:

:w !diff - % (diff <memory copy> <original file>

Quickly see changes in a simple diff style without changing the file.

1
  • Welcome to Vi and Vim! This doesn't appear to help answer the question of non-interactive vimdiff
    – D. Ben Knoble
    Mar 30, 2020 at 14:13
0

If you don't mind having the differences above each other as opposed to side-by-side, you can try this:

git diff --no-index FILE1 FILE2
1
  • Thank you @Kostas, but the great advantage of the vimdiff is the side-by-side + colored diffs. Is exactly what I want to keep.
    – ceinmart
    Jul 3, 2019 at 18:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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