From 480cfff6570009b5525741bbba93e101d2727f27 Mon Sep 17 00:00:00 2001 From: newbieQQ Date: Thu, 11 Jun 2026 16:38:27 +0800 Subject: [PATCH] feat: add Reasonix keymap with adaptive split direction --- lua/keymap.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lua/keymap.lua b/lua/keymap.lua index 72e9dfb..aa0d4ba 100644 --- a/lua/keymap.lua +++ b/lua/keymap.lua @@ -36,4 +36,15 @@ G.map({ { 'n', '', ':res +5' }, { 'n', '', ':vertical resize -5' }, { 'n', '', ':vertical resize +5' }, + + -- Reasonix AI agent:根据窗口宽高自适应方向(宽→上下分屏,高→左右分屏) + { 'n', '', function() + local ui = vim.api.nvim_list_uis()[1] + local wide = ui.width > ui.height + local term = require('toggleterm.terminal').Terminal:new({ + direction = wide and 'horizontal' or 'vertical', + cmd = 'reasonix', + }) + term:toggle() + end, { noremap = true } }, })