8000 GitHub - pauldub/claude-code-nvim
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

pauldub/claude-code-nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

claude-code.nvim

A minimal Neovim plugin for Claude Code integration. One command, no fluff.

Requirements

Installation

Using lazy.nvim:

{
  "pauldub/claude-code-nvim",
  config = function()
    require('claude-code').setup({
      -- Optional configuration
      timeout = 60000,  -- milliseconds (default: 1 minute)
      split_direction = "horizontal",  -- or "vertical"
      output_format = "json",  -- "text", "json", or "stream-json"
      show_metadata = false  -- show cost/duration info
    })
  end
}

Usage

Normal Mode

:Claude <your prompt>

Examples:

  • :Claude explain this function
  • :Claude refactor for better performance
  • :Claude write tests for this code

Visual Mode

Select code and run :Claude to analyze it:

  1. Select code in visual mode (v, V, or <C-v>)
  2. Type :Claude (or :'<,'>Claude)
  3. Optionally add a prompt: :'<,'>Claude explain this function

When used in visual mode:

  • Without prompt: sends just the selected code
  • With prompt: sends both your prompt and the selected code

The output will open in a new split buffer with markdown syntax highlighting.

Developer Experience

  • Type Annotations: Full LuaLS annotations for autocomplete and type checking
  • Documentation: Access help with :h claude-code
  • Testing: Run tests with ./run_tests.sh

Configuration

require('claude-code').setup({
  timeout = 120000,  -- Timeout in milliseconds (default: 60000 = 1 minute)
  split_direction = "vertical",  -- Split direction: "horizontal" or "vertical"
  output_format = "json",  -- Output format: "text", "json" (default), or "stream-json"
  show_metadata = true,  -- Show cost and timing info (default: false)
  debug = false,  -- Enable debug logging (default: false)
  
  -- Tool restrictions (optional)
  allowed_tools = "Bash,Edit,Read",  -- String or array of allowed tools
  disallowed_tools = {  -- String or array of disallowed tools
    "Bash(git push)",
    "Bash(rm -rf)",
    "Write"
  }
})

Tool Restrictions

Control which tools Claude can use:

  • allowed_tools: Whitelist specific tools or commands

    • "Bash" - allow all Bash commands
    • "Bash(npm install)" - allow only specific commands
    • "mcp__filesystem__*" - allow MCP tool patterns
  • disallowed_tools: Blacklist dangerous operations

    • "Bash(git commit)" - prevent git commits
    • {"Write", "Delete"} - prevent file modifications

## License

MIT

About

No description, website, or topics provided.

Resources

4C26

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0