You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+58-5Lines changed: 58 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -12,16 +12,19 @@ A Neovim plugin that integrates with Claude Code CLI to provide a seamless AI co
12
12
- 🔍 Selection tracking to provide context to Claude
13
13
- 🛠️ Integration with Neovim's buffer and window management
14
14
- 📝 Support for file operations and diagnostics
15
-
- 🖥️ Terminal integration for launching Claude with proper environment
15
+
- 🖥️ Interactive vertical split terminal for Claude sessions (via `folke/snacks.nvim`)
16
16
- 🔒 Automatic cleanup on exit - server shutdown and lockfile removal
17
17
18
18
## Requirements
19
19
20
20
- Neovim >= 0.8.0
21
21
- Claude Code CLI installed and in your PATH
22
22
- Lua >= 5.1
23
+
-**Required for terminal integration:**[folke/snacks.nvim](https://github.com/folke/snacks.nvim) - Terminal management plugin
23
24
- Optional: plenary.nvim for additional utilities
24
25
26
+
Note: The terminal feature requires Snacks.nvim to be installed and available. If not available, the terminal commands will display an error message, but the core Claude Code integration will still function.
27
+
25
28
## Installation
26
29
27
30
### Using [lazy.nvim](https://github.com/folke/lazy.nvim)
@@ -31,8 +34,11 @@ A Neovim plugin that integrates with Claude Code CLI to provide a seamless AI co
31
34
"ThomasK33/claudecode.nvim",
32
35
dependencies= {
33
36
"nvim-lua/plenary.nvim",
37
+
"folke/snacks.nvim", -- Added dependency
34
38
},
35
39
config=function()
40
+
-- Ensure snacks is loaded if you want to use the terminal immediately
41
+
-- require("snacks") -- Or handle this in your init.lua
36
42
require("claudecode").setup({
37
43
-- Optional configuration
38
44
})
@@ -45,7 +51,10 @@ A Neovim plugin that integrates with Claude Code CLI to provide a seamless AI co
45
51
```lua
46
52
use {
47
53
"ThomasK33/claudecode.nvim",
48
-
requires= { "nvim-lua/plenary.nvim" },
54
+
requires= {
55
+
"nvim-lua/plenary.nvim",
56
+
"folke/snacks.nvim", -- Added dependency
57
+
},
49
58
config=function()
50
59
require("claudecode").setup({
51
60
-- Optional configuration
@@ -64,13 +73,28 @@ return {
64
73
"ThomasK33/claudecode.nvim",
65
74
dependencies= {
66
75
"nvim-lua/plenary.nvim",
76
+
"folke/snacks.nvim", -- Added dependency
67
77
},
68
78
opts= {
69
-
-- Optional configuration
79
+
-- Optional configuration for claudecode main
80
+
-- Example:
81
+
-- terminal_cmd = "claude --magic-flag",
82
+
83
+
-- Configuration for the interactive terminal can also be nested here:
84
+
terminal= {
85
+
split_side="left", -- "left" or "right"
86
+
split_width_percentage=0.4, -- 0.0 to 1.0
87
+
},
70
88
},
89
+
-- The main require("claudecode").setup(opts) will handle passing
90
+
-- opts.terminal to the terminal module's setup.
91
+
config=true, -- or function(_, opts) require("claudecode").setup(opts) end
71
92
keys= {
72
93
{ "<leader>cc", "<cmd>ClaudeCodeStart<cr>", desc="Start Claude Code" },
73
94
{ "<leader>cs", "<cmd>ClaudeCodeSend<cr>", desc="Send to Claude Code" },
95
+
{ "<leader>ct", "<cmd>ClaudeCode<cr>", desc="Toggle Claude Terminal" },
96
+
{ "<leader>co", "<cmd>ClaudeCodeOpen<cr>", desc="Open Claude Terminal" },
97
+
{ "<leader>cx", "<cmd>ClaudeCodeClose<cr>", desc="Close Claude Terminal" },
74
98
},
75
99
},
76
100
}
@@ -87,16 +111,27 @@ return {
87
111
name="claudecode.nvim",
88
112
dependencies= {
89
113
"nvim-lua/plenary.nvim",
114
+
"folke/snacks.nvim", -- Added dependency
90
115
},
91
116
dev=true,
92
117
opts= {
93
-
-- Development configuration
118
+
-- Development configuration for claudecode main
94
119
log_level="debug",
95
120
auto_start=true, -- Optional: auto-start the server
121
+
122
+
-- Example terminal configuration for dev:
123
+
terminal= {
124
+
split_side="right",
125
+
split_width_percentage=0.25,
126
+
},
96
127
},
128
+
config=true,
97
129
keys= {
98
130
{ "<leader>cc", "<cmd>ClaudeCodeStart<cr>", desc="Start Claude Code" },
99
131
{ "<leader>cs", "<cmd>ClaudeCodeSend<cr>", desc="Send to Claude Code" },
132
+
{ "<leader>ct", "<cmd>ClaudeCode<cr>", desc="Toggle Claude Terminal" },
133
+
{ "<leader>co", "<cmd>ClaudeCodeOpen<cr>", desc="Open Claude Terminal" },
134
+
{ "<leader>cx", "<cmd>ClaudeCodeClose<cr>", desc="Close Claude Terminal" },
0 commit comments