@@ -17,36 +17,50 @@ A proof of concept integration between Claude Desktop and Neovim using Model Con
17
17
### Resources
18
18
19
19
- ` nvim://session ` : Current neovim text editor session
20
+ - ` nvim://buffers ` : List of all open buffers in the current Neovim session with metadata including modified status, syntax, and window IDs
20
21
21
22
### Tools
22
23
- ** vim_buffer**
23
24
- Current VIM text editor buffer with line numbers shown
24
25
- Input ` filename ` (string)
25
26
- Filename is ignored, returns a string of numbered lines with the current active buffer content
26
27
- ** vim_command**
27
- - Send a command to VIM for navigation, spot editing, and line deletion.
28
+ - Send a command to VIM for navigation, spot editing, and line deletion
28
29
- Input ` command ` (string)
29
- - Runs a vim command first passed through ` nvim.replaceTermcodes ` . Multiple commands will work if separated by newlines.
30
+ - Runs a vim command first passed through ` nvim.replaceTermcodes ` . Multiple commands will work if separated by newlines
30
31
- On error, ` 'nvim:errmsg' ` contents are returned
31
32
- ** vim_status**
32
33
- Get the status of the VIM editor
33
- - Status contains line, col , mode, filename, and visual selection
34
+ - Status contains cursor position , mode, filename, visual selection, window layout, current tab, marks, registers, and working directory
34
35
- ** vim_edit**
35
- - Edit lines using insert or replace in the VIM editor.
36
+ - Edit lines using insert or replace in the VIM editor
36
37
- Input ` startLine ` (number), ` mode ` (` "insert" ` | ` "replace" ` ), ` lines ` (string)
37
- - insert will insert lines at startLine. replace will replace lines starting at the startLine to the end of the buffer.
38
+ - insert will insert lines at startLine. replace will replace lines starting at the startLine to the end of the buffer
39
+ - ** vim_window**
40
+ - Manipulate Neovim windows (split, vsplit, close, navigate)
41
+ - Input ` command ` (string: "split", "vsplit", "only", "close", "wincmd h/j/k/l")
42
+ - Allows window management operations
43
+ - ** vim_mark**
44
+ - Set a mark at a specific position
45
+ - Input ` mark ` (string: a-z), ` line ` (number), ` column ` (number)
46
+ - Sets named marks at specified positions
47
+ - ** vim_register**
48
+ - Set content of a register
49
+ - Input ` register ` (string: a-z or "), ` content ` (string)
50
+ - Manages register contents
51
+ - ** vim_visual**
52
+ - Make a visual selection
53
+ - Input ` startLine ` (number), ` startColumn ` (number), ` endLine ` (number), ` endColumn ` (number)
54
+ - Creates visual mode selections
38
55
39
56
Using this simple set of tools, Claude can peer into your neovim session to answer questions as well as make edits to the buffer.
40
57
41
58
## Limitations
42
59
43
60
- This is a quick proof of concept to experiment with Model Context Protocol. Use at your own risk.
44
61
- May not interact well with a custom neovim config!
45
- - It may or may not be properly handling the socket connections to neovim.
46
62
- Error handling could be better.
47
- - Sometimes Claude doesn't get the vim command input just right or the way I am passing it along doesn't agree.
48
- - Reading the output from a vim command needs improvement.
49
- - Support for multiple buffers/windows.
63
+ - Sometimes Claude doesn't get the vim command input just right.
50
64
51
65
## Usage with Claude Desktop
52
66
Add this to your ` claude_desktop_config.json ` :
0 commit comments