fix: tmux navigation inside nvim->lazygit

This commit is contained in:
2026-04-13 17:15:23 +03:00
parent 756ed66091
commit f47047afdf

View File

@@ -1,3 +1,16 @@
vim.api.nvim_create_autocmd('FileType', {
group = vim.api.nvim_create_augroup('tmux-nav-passthrough', { clear = true }),
pattern = 'lazygit',
callback = function(ev)
local directions = { ['<C-h>'] = 'L', ['<C-j>'] = 'D', ['<C-k>'] = 'U', ['<C-l>'] = 'R' }
for key, dir in pairs(directions) do
vim.keymap.set({ 'n', 't' }, key, function()
vim.fn.system('tmux select-pane -' .. dir)
end, { buffer = ev.buf, nowait = true, silent = true })
end
end,
})
return {
"christoomey/vim-tmux-navigator",
cmd = {