-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfugitive.lua
More file actions
37 lines (36 loc) · 1.02 KB
/
Copy pathfugitive.lua
File metadata and controls
37 lines (36 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
return {
{
"tpope/vim-fugitive",
dependencies = {
"tpope/vim-git",
"tpope/vim-rhubarb",
},
keys = {
{ mode = "n", "<leader>gg", ":Git<cr>", silent = true, desc = "Open fugitive" },
{ mode = "n", "<leader>gd", ":Git diff %<cr>", silent = true, desc = "View buffer's diff" },
},
lazy = false, -- otherwise starting directly into fugitive buffers would be empty.
init = function()
vim.g.fugitive_legacy_commands = 0
vim.api.nvim_create_autocmd("FileType", {
once = true,
pattern = "fugitive",
desc = "Fix fugitive startup empty buffer",
callback = function()
vim.schedule(function()
vim.cmd("silent! e")
end)
end,
})
end,
enabled = require("config.util").is_enabled("tpope/vim-fugitive"),
},
{
"tpope/vim-git",
enabled = require("config.util").is_enabled("tpope/vim-git"),
},
{
"tpope/vim-rhubarb",
enabled = require("config.util").is_enabled("tpope/vim-rhubarb"),
},
}