Save vimdiff output?

前端 未结 5 1905
一生所求
一生所求 2021-01-30 21:14

I google\'d this multiple times in the past but I\'ve never found an answer. Is there a way to save vimdiff\'s output (preferably while maintaining colors, highlights, etc.)? I\

相关标签:
5条回答
  • 2021-01-30 21:24

    There are at least two options for saving vim colouring: it is :TOhtml distributed with vim itself and more advanced my format.vim plugin. Advantages of my plugin over :TOhtml are described on the plugin page. Command to format vimdiff to html:

    :Format diffformat
    
    0 讨论(0)
  • 2021-01-30 21:27
    diff -u file1 file2 > outputfile
    
    0 讨论(0)
  • 2021-01-30 21:30

    To compare two files and write out the result to a third file "HTML based". Open a terminal and run this command:

    vimdiff  file1.txt file2.txt -c TOhtml -c 'w! diff.html' -c 'qa!'
    
    0 讨论(0)
  • 2021-01-30 21:38

    Vim can export to HTML, see:

    :help :TOhtml
    
    0 讨论(0)
  • 2021-01-30 21:43

    You'll get similar output with the next command:

    sdiff file1 file2 | colordiff
    
    0 讨论(0)
提交回复
热议问题