Skip to content

cdreetz/groq-nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

groq-nvim

A Neovim plugin for interacting with the Groq API.

Getting Started

If you don't have it already, install Packer with this command

git clone --depth 1 https://github.com/wbthomason/packer.nvim\
 ~/.local/share/nvim/site/pack/packer/start/packer.nvim

With that installed, we can now add our packer setup to our '~/.config/nvim/init.lua'

-- packer setup
vim.cmd [[packadd packer.nvim]]
require('packer').startup(function(use)
    use 'wbthomason/packer.nvim'
    use 'nvim-lua/plenary.nvim'
    
    -- Add groq-nvim plugin from GitHub
    use {
        'cdreetz/groq-nvim',
        requires = {'nvim-lua/plenary.nvim'},
        config = function()
            require('groq-nvim').setup({
                api_key = "your_groq_api_key",
                model = "llama3-70b-8192"
            })
        end
    }
end)

Commands

These are the current available commands

- :GroqGenerate

- :GroqGenerateWithContext

- :GroqEdit

To use GroqGenerate, all you do is :GroqGenerate your prompt and the code will be generated at the place of the cursor

To use GroqGenerateWithContext, you start with :GroqGenerateWithContext your prompt /path/to/context/file.py

To use GroqEdit, you begin by selecting some text, typically in visual mode, and then using :GroqEdit your prompt the selected code will be rewritten based on your prompt

Examples

Groq Generate

:GroqGenerate write a python function that prints hello world

Groq Edit

:GroqEdit rewrite this method while adding debug lines to it

Groq Generate With Context

:GroqGenerateWithContext write a new version of the method found in this file ./file.py

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages