extract some keys to the plugin configs

This commit is contained in:
Oliver Hartmann
2022-12-05 15:12:09 +01:00
parent bce0373dfb
commit 11b954ff33
6 changed files with 54 additions and 60 deletions

View File

@@ -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',
}
}
)