✨ feat(nvim): toggle lazygit when hitting q
This commit is contained in:
parent
212789c05e
commit
1b3ed7466e
1 changed files with 12 additions and 0 deletions
|
@ -113,3 +113,15 @@ ac("BufWritePre", {
|
||||||
vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p")
|
vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p")
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Toggle lazygit instead of closing
|
||||||
|
vim.api.nvim_create_autocmd("TermOpen", {
|
||||||
|
pattern = "*",
|
||||||
|
callback = function()
|
||||||
|
local term_title = vim.b.term_title
|
||||||
|
if term_title and term_title:match("lazygit") then
|
||||||
|
-- Create lazygit specific mappings
|
||||||
|
vim.keymap.set("t", "q", "<cmd>close<cr>", { buffer = true })
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
Loading…
Add table
Reference in a new issue