Closed arctic-penguin closed 1 year ago
Use case: the user has written any text file over some time. He has overwritten some past changes. He would like to check if the specific changes are contained in any of the snapshots of the file.
Check out bowie which already does something similar as a script.
But this is definitely possible! It may require another exec mode but its definitely doable. And I think the questions are only: Is it worth adding if one has bowie
already? Do you make it automatic for text? If so how does one easily detect text or binary files? Are there good crates which can diff the output or do we just use diff
, perhaps make the preview selectable via an env var and at the command line, like SELECT_PREVIEW_CMD="diff --color (snap} {live} | bat", etc.
Please let me know your thoughts!
Thanks! Appreciate you taking a look at the project.
Completed with: https://github.com/kimono-koans/httm/pull/56
Like this: https://nickjanetakis.com/blog/using-fzf-to-preview-text-files-on-the-command-line-and-within-vim
Use case: the user has written any text file over some time. He has overwritten some past changes. He would like to check if the specific changes are contained in any of the snapshots of the file.
So something like:
$ httm -r my_file.txt
Preview could use
bat
if it is installed to provide syntax highlighting, otherwise lessThis could be extended to generate diffs between versions from different snapshots, but that is another story.