.config/nvim/plugin/tig.vim

Sun, 05 Mar 2023 15:14:39 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Sun, 05 Mar 2023 15:14:39 -0500
changeset 1060
c20cb89a2ee9
parent 1025
9dfc1a5a52dc
permissions
-rw-r--r--

Add "comment" parser

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