.vim/autoload/tig.vim

Sun, 19 Feb 2023 11:31:07 -0600

author
Meredith Howard <mhoward@roomag.org>
date
Sun, 19 Feb 2023 11:31:07 -0600
changeset 1028
77e65ab97892
parent 828
81ede7493890
permissions
-rw-r--r--

fsckobjects has also been a nuisance. maybe git just isn't great at integrity!

828
81ede7493890 improve tig
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
1 " Why this wrapper? vim :term sets $TERM to xterm but supports -256color and
81ede7493890 improve tig
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
2 " all the suggestions for fixing that involve changing $TERM for vim itself
81ede7493890 improve tig
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
3 " rather than just the subprocess. Also since this runs in place we can
81ede7493890 improve tig
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
4 " switch back after.
81ede7493890 improve tig
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
5 func! tig#Tig(...) abort
81ede7493890 improve tig
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
6 call term_start(
81ede7493890 improve tig
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
7 \ ['/usr/bin/env', 'TERM=xterm-256color', 'tig'] + a:000,
81ede7493890 improve tig
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
8 \ {'curwin': 1, 'term_name': join(['!tig'] + a:000, ' '), 'exit_cb': 'tig#TigExit'}
81ede7493890 improve tig
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
9 \ )
81ede7493890 improve tig
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
10 endfunc
81ede7493890 improve tig
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
11
81ede7493890 improve tig
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
12 func! tig#TigBlame() abort
81ede7493890 improve tig
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
13 call tig#Tig('blame', '+' . line('.'), '--', expand('%'))
81ede7493890 improve tig
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
14 endfunc
81ede7493890 improve tig
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
15
81ede7493890 improve tig
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
16 func! tig#TigExit(...) abort
81ede7493890 improve tig
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
17 buffer #
81ede7493890 improve tig
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
18 endfunc

mercurial