Skip to content

ErikBjare/gptme.vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

gptme.vim

A Vim plugin for gptme integration, allowing you to interact with gptme directly from your editor.

Features

  • Run gptme queries with context from your current buffer
  • Automatically includes surrounding lines as context
  • Results shown in a new buffer
  • Configurable context size and key mappings

Installation

The plugin assumes you have gptme installed and available in your PATH.

Using a Plugin Manager

Add this to your .vimrc:

Plug 'ErikBjare/gptme.vim'

Then run:

:PlugInstall

Usage

The plugin provides both a command and a default mapping:

  • :Gptme - Prompts for input and runs gptme with context
  • <Leader>g - Same as :Gptme

When invoked, it will:

  1. Prompt for your input
  2. Get lines around cursor as context
  3. Get file content as context
  4. Run gptme with the prompt and context interactively in a new buffer

Configuration

You can configure the following settings in your .vimrc:

Context Lines

Set the number of context lines to include before and after cursor (default: 3):

let g:gptme_context_lines = 5

Key Mappings

Disable default key mappings:

let g:gptme_no_mappings = 1

If you disable the default mappings, you can set your own:

nnoremap <Leader>G :Gptme<CR>

License

Same as Vim itself - see :help license

About

Vim plugin for gptme integration

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published