Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[FEATURE] Multiple Named Terminal Layout Configurations

オープン
#139 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
lua
領域
tooling

調査の方向性

まず、既存のターミナル設定と、open()、focus()、:ClaudeCode コマンドの背後にある Lua API を読みます。ターミナルバッファ、レイアウトオプション、Claude CLI プロセス、WebSocket サーバーがどのように管理されているかを追跡します。名前付き設定、デフォルトおよび無効なレイアウトの動作、レイアウトの切り替え、後方互換性が、追加の Claude インスタンスを作成せずに機能すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Problem / Use Case

Currently, claudecode.nvim only supports a single terminal layout configuration. Users who want to interact with Claude Code in different contexts (e.g., floating window for quick queries, side split for longer sessions) must either:

  1. Reconfigure and reload the plugin to change layouts
  2. Create multiple independent Claude instances (which breaks the single conversation flow)
  3. Manually manipulate windows after opening

This limitation makes it difficult to have flexible workflow patterns while maintaining a single Claude conversation instance.

Proposed Solution

Support multiple named terminal layout configurations accessible via Lua API, allowing layout selection to be completely separate from Claude CLI arguments.

Configuration Example
{
  "coder/claudecode.nvim",
  opts = {
    terminal = {
      -- Define multiple named configurations
      configurations = {
        float = {
          snacks_win_opts = {
            position = "float",
            width = 0.8,
            height = 0.8,
            border = "rounded",
          }
        },
        split = {
          snacks_win_opts = {
            position = "right",
            width = 0.4,
            border = "rounded",
          }
        },
        drawer = {
          snacks_win_opts = {
            position = "bottom",
            height = 0.3,
            border = "single",
          }
        }
      },
      -- Optional: specify default configuration
      default = "float"  -- used when no layout is specified
    },
  },
}
Lua API Usage
-- Open Claude with specific layout and arguments
require("claudecode").open({
  layout = "split",
  args = "--dangerously-skip-permissions --continue"
})

-- Or just layout (uses default args)
require("claudecode").open({ layout = "float" })

-- Or just args (uses default layout)
require("claudecode").open({ args = "--continue" })

-- Focus with layout preference (switch to different layout)
require("claudecode").focus({ layout = "drawer" })
Keymap Examples
-- Floating window for quick access
vim.keymap.set({ "n", "i", "v", "t" }, "<C-M-S-a>", function()
  require("claudecode").open({
    layout = "float",
    args = "--dangerously-skip-permissions --continue"
  })
end, { desc = "Claude (floating)" })

-- Split for focused work
vim.keymap.set({ "n", "i", "v", "t" }, "<C-M-S-s>", function()
  require("claudecode").open({
    layout = "split",
    args = "--dangerously-skip-permissions --continue"
  })
end, { desc = "Claude (split)" })

-- Drawer for context checking
vim.keymap.set("n", "<leader>ad", function()
  require("claudecode").open({
    layout = "drawer",
    args = "--continue"
  })
end, { desc = "Claude (drawer)" })
Command Compatibility

The existing :ClaudeCode command should continue to work unchanged, using the default layout:

" Uses default layout configuration
:ClaudeCode --continue
:ClaudeCode --dangerously-skip-permissions

Benefits

  1. Single Instance: All layouts reference the same Claude conversation and WebSocket server
  2. Declarative: Layout configurations defined once, reused everywhere
  3. No CLI Conflicts: Layout selection completely separate from Claude CLI arguments
  4. Flexible Workflows: Different layouts for different contexts without reconfiguration
  5. Backward Compatible: Existing configurations continue to work
  6. Clean API: Simple, predictable Lua interface
  7. Composable: Easy to build complex keymaps and commands on top

Backward Compatibility

For backward compatibility, both configuration styles should be supported:

-- Old style (still works, becomes the default configuration)
terminal = {
  snacks_win_opts = { position = "float", ... }
}

-- New style (opt-in for multiple configurations)
terminal = {
  configurations = {
    float = { snacks_win_opts = { ... } },
    split = { snacks_win_opts = { ... } }
  },
  default = "float"
}

If configurations is not specified, the plugin behaves exactly as it does today.

Implementation Notes

  • The same Claude CLI process and WebSocket server instance should be reused across all layouts
  • When switching layouts, the terminal buffer could be moved to a new window with the requested layout
  • The layout parameter should be optional; if omitted, use the default configuration
  • Invalid layout names should fall back to the default configuration with a warning

Alternative Considered

Using command-line arguments like :ClaudeCode split --continue was considered but rejected because it would conflict with Claude CLI's native argument parsing and create an antipattern of mixing layout concerns with CLI flags.

主要言語
Lua
スター
3.1k
フォーク
219
PR マージ指標
30日以内にマージされた PR はありません

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

coder/claudecode.nvim のほかの issue

coder/claudecode.nvim の issue をすべて見る

似ている issue

Lua の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。