.config/nvim/plugin/tig.vim

Thu, 09 Mar 2023 12:45:11 -0600

author
Meredith Howard <mhoward@roomag.org>
date
Thu, 09 Mar 2023 12:45:11 -0600
changeset 1073
911aa9d81e71
parent 1025
9dfc1a5a52dc
permissions
-rw-r--r--

Switch to kanagawa until themer's jellybeans is fixed

1025
9dfc1a5a52dc Fix up tig for nvim
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
1 func! tig#Tig(...) abort
9dfc1a5a52dc Fix up tig for nvim
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
2 enew
9dfc1a5a52dc Fix up tig for nvim
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
3 setl nonumber
9dfc1a5a52dc Fix up tig for nvim
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
4 call termopen(["tig"] + a:000, {'on_exit': 'tig#TigExit'})
9dfc1a5a52dc Fix up tig for nvim
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
5 endfunc
9dfc1a5a52dc Fix up tig for nvim
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
6
9dfc1a5a52dc Fix up tig for nvim
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
7 func! tig#TigBlame() abort
9dfc1a5a52dc Fix up tig for nvim
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
8 call tig#Tig('blame', '+' . line('.'), '--', expand('%'))
9dfc1a5a52dc Fix up tig for nvim
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
9 endfunc
9dfc1a5a52dc Fix up tig for nvim
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
10
9dfc1a5a52dc Fix up tig for nvim
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
11 func! tig#TigExit(...) abort
9dfc1a5a52dc Fix up tig for nvim
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
12 buffer #
9dfc1a5a52dc Fix up tig for nvim
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
13 endfunc
9dfc1a5a52dc Fix up tig for nvim
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
14
9dfc1a5a52dc Fix up tig for nvim
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
15 command! -nargs=* -complete=file Tig call tig#Tig(<f-args>)
9dfc1a5a52dc Fix up tig for nvim
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
16 command! TigBlame call tig#TigBlame()
9dfc1a5a52dc Fix up tig for nvim
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
17 command! TigLog call tig#Tig('log', '-p', '--', expand('%'))
9dfc1a5a52dc Fix up tig for nvim
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
18

mercurial