extract some keys to the plugin configs
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
function _G.set_terminal_keymaps(term)
|
||||
local opts = { noremap = true }
|
||||
if (term.cmd ~= 'lazygit') then
|
||||
@@ -23,7 +22,7 @@ local lazygit = Terminal:new({
|
||||
hidden = true,
|
||||
direction = 'float',
|
||||
on_open = function(term)
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "<cmd>close<CR>", {noremap = true, silent = true})
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "<cmd>close<CR>", { noremap = true, silent = true })
|
||||
-- vim.api.nvim_buf_set_keymap(term.bufnr, 't', '<esc>', '<esc>', {noremap = true, silent = true})
|
||||
end,
|
||||
})
|
||||
@@ -31,3 +30,13 @@ local lazygit = Terminal:new({
|
||||
function _lazygit_toggle()
|
||||
lazygit:toggle()
|
||||
end
|
||||
|
||||
require('legendary').keymaps(
|
||||
{
|
||||
{
|
||||
'<Space>g',
|
||||
':lua _lazygit_toggle()<CR>',
|
||||
description = 'Open lazygit',
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user