Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Bind to show a whole file at a revision for added context #91

kaihendry opened this Issue · 2 comments

3 participants


Hi @kaihendry,

An option might be to make tig set the file variable in the diff view like this:

diff --git a/tig.c b/tig.c
index d735391..5ce2437 100644
--- a/tig.c
+++ b/tig.c
@@ -4548,6 +4548,7 @@ diff_select(struct view *view, struct line *line)
        } else {
                s = diff_get_pathname(view, line);
                if (s) {
+                       string_ncopy(opt_file, s, strlen(s));
                        string_format(view->ref, "Changes to '%s'", s);
                } else {
                        string_ncopy(view->ref, view->id, strlen(view->id));

which allows you to add a binding such as:

bind diff v !git show %(commit):%(file)

This works, but I'm not sure if it doesn't break something, or if it's the best solution here.


@kaihendry I've added code for opening a blob view based on the file path and the currently viewed file. Great idea with the video! :-)

@jonas jonas closed this
@afb afb referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.