.config/nvim/lua/local/tig.lua

changeset 1085
c2d11f022cf0
parent 1076
15007f695dfb
equal deleted inserted replaced
1084:76588dcdb04a 1085:c2d11f022cf0
18 vim.cmd.buffer("#") 18 vim.cmd.buffer("#")
19 end, 19 end,
20 }) 20 })
21 end 21 end
22 22
23 local function setup(config) 23 api.nvim_create_user_command("Tig", tig, { nargs = "*", complete = "file" })
24 api.nvim_create_user_command("Tig", tig, { nargs = "*", complete = "file" })
25 24
26 api.nvim_create_user_command("TigBlame", function() 25 api.nvim_create_user_command("TigBlame", function()
27 tig({ fargs = { "blame", "+" .. fn.line("."), "--", fn.expand("%") } }) 26 tig({ fargs = { "blame", "+" .. fn.line("."), "--", fn.expand("%") } })
28 end, {}) 27 end, {})
29 28
30 api.nvim_create_user_command("TigLog", function() 29 api.nvim_create_user_command("TigLog", function()
31 tig({ fargs = { "log", "-p", "--", fn.expand("%") } }) 30 tig({ fargs = { "log", "-p", "--", fn.expand("%") } })
32 end, {}) 31 end, {})
33 end
34
35 return {
36 setup = setup,
37 }

mercurial