A Neovim plugin that integrates with DeepShell, allowing users to process and generate code snippets via DeepShell directly from Neovim.
Ensure that DeepShell is installed and accessible from your shell. If it's installed in ~/.local/bin, you may need to update your PATH:
export PATH="$HOME/.local/bin:$PATH"Add this line to your shell configuration file (~/.bashrc, ~/.zshrc, etc.) to make it persistent.
Place your Lua file (e.g., deep_shell.lua) in your Neovim configuration directory. For example, create a folder and place the file there:
mkdir -p ~/.config/nvim/lua/deepshell/
cp deep_shell.lua ~/.config/nvim/lua/deepshell/In your init.lua or equivalent configuration file, require the module to ensure it loads on startup:
require("deepshell.deep_shell")Restart Neovim to apply the changes.
Processes a selected code snippet along with a user request using DeepShell in CODE_MODE and replaces the selection with the output.
-
Visual Mode: Select text and run:
:'<,'>DeepShell "Add a docstring to this function"
-
Generate Mode: Without selection, it will generate the code from the user prompt.
:DeepShell "Generate a Python function for validating user input"
Sends user input (and optionally selected code) to DeepShell in DEFAULT_MODE and displays the output in popup window without modifying the file.
-
Visual Mode: Select text and run:
:'<,'>AskDeepShell "Explain this function"
-
Command Mode: Without selection, it sends only the user request:
:AskDeepShell "Explain recursion"
Run this in your terminal:
deepshell --helpIf the command is not found, make sure DeepShell is installed and its binary is in your PATH.
Run in Neovim:
:echo exists(':DeepShell')If it returns 0, the plugin is not loaded. Ensure your plugin manager has installed it.
MIT License. See LICENSE for details.