https://github.com/haydenkz/nvim-wingman
Copilot like code completion for a local Ollama server or GrokAPI
https://github.com/haydenkz/nvim-wingman
grok lua neovim neovim-plugin ollama
Last synced: 4 months ago
JSON representation
Copilot like code completion for a local Ollama server or GrokAPI
- Host: GitHub
- URL: https://github.com/haydenkz/nvim-wingman
- Owner: haydenkz
- License: mit
- Created: 2025-03-03T22:32:49.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-14T05:25:33.000Z (about 1 year ago)
- Last Synced: 2025-03-14T06:26:31.506Z (about 1 year ago)
- Topics: grok, lua, neovim, neovim-plugin, ollama
- Language: Lua
- Homepage:
- Size: 29.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# Wingman
**Wingman** is a Neovim plugin that provides intelligent code completion suggestions using either the Grok API (from xAI) or a local Ollama instance. It displays suggestions as virtual text in your buffer and allows you to accept them with a single keypress. Designed for seamless integration with LazyVim, Wingman aims to enhance your coding workflow with minimal setup.
## Features
- **Real-time code completion**: Suggestions appear as you type, based on your current context.
- **Supports Grok and Ollama**: Use either the cloud-based Grok API or a local Ollama instance for completions.
- **Configurable settings**: Customize API endpoints, models, keymaps, and more.
- **Automatic triggering**: Suggestions are triggered automatically after a configurable character threshold.
- **Toggle and manual completion**: Enable/disable suggestions or manually request completions via commands.
- **Lightweight**: Depends only on `plenary.nvim` for HTTP requests.
## Installation
Wingman.nvim is designed to work with [LazyVim](https://github.com/folke/lazy.nvim), a modern Neovim plugin manager. Follow these steps to install it:
### Using LazyVim
Add the following to your LazyVim configuration (typically in `~/.config/nvim/lua/plugins/`):
```lua
return {
"haydenkz/nvim-wingman",
lazy = false, -- Load immediately (recommended for real-time suggestions)
dependencies = { "nvim-lua/plenary.nvim" }, -- Required for HTTP requests
config = function()
require("wingman").setup({
api_key = "your-grok-api-key", -- Replace with your xAI Grok API key
useOllama = false, -- Set to true to use Ollama instead of Grok
model = "grok-2-latest", -- Specify the model to use
ollama_url = "http://localhost:11434", -- Ollama API endpoint
grok_url = "https://api.x.ai/v1/chat/completions", -- Grok API endpoint
})
end,
}