From 068dd8fe25a0a318dca533e5642f2d2cfd94a9df Mon Sep 17 00:00:00 2001 From: Brad Anderson Date: Mon, 10 Aug 2026 14:11:06 -0700 Subject: [PATCH] Open Claude Code in its own tab on dejima auto-start The auto-start left the Claude terminal only as a narrow right split. Follow it with a tab split so the same terminal buffer also gets a full-screen tab, while the original tab keeps the side-by-side layout with the editor. --- config/nvim/lua/config/autocmds.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config/nvim/lua/config/autocmds.lua b/config/nvim/lua/config/autocmds.lua index 77663ce..d5b596f 100644 --- a/config/nvim/lua/config/autocmds.lua +++ b/config/nvim/lua/config/autocmds.lua @@ -47,6 +47,16 @@ if vim.env.DEJIMA then vim.schedule(function() require("lazy").load({ plugins = { "claudecode.nvim" } }) vim.cmd("ClaudeCode") + -- :ClaudeCode leaves the terminal window focused, so `tab split` gives + -- the same terminal buffer a full-screen window in its own tab while + -- the original tab keeps the narrow split next to the editor - one tab + -- to work in Claude, one to work side-by-side. Window-local options are + -- inherited by the split, and snacks' auto_insert (buffer-local) puts + -- the new window back into terminal mode on entry. + local claude_buf = require("claudecode.terminal").get_active_terminal_bufnr() + if claude_buf and vim.api.nvim_get_current_buf() == claude_buf then + vim.cmd("tab split") + end end) end, })