Skip to content

firemariovn/ai.nvim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

ai.nvim

A Neovim plugin powered by Google Gemini.

Installation

First get an API key from Gemini. It's free!

Using lazy.nvim:

{
  'firemariovn/ai.nvim',
  dependencies = 'nvim-lua/plenary.nvim',
  opts = {
    api_key = 'YOUR_GEMINI_API_KEY', -- or read from env: `os.getenv('GEMINI_API_KEY')`
    -- The locale for the content to be defined/translated into
    locale = 'en',
    -- The locale for the content in the locale above to be translated into
    alternate_locale = 'vn',
  },
  cmd = { 'GeminiDefine', 'GeminiDefineV', 'GeminiTranslate', 'GeminiAsk' },
},

Usage

Define a word or phrase

" Define the word under cursor
:GeminiDefine

" Define the specified word
:GeminiDefine happy

Define the selected word or phrase:

:'<,'>GeminiDefineV

Translate contents

" Translate selection
:GeminiTranslate

" Translate the specified content
:GeminiTranslate I am happy.

Ask anything

" Use selection as the prompt
:GeminiAsk

" Pass prompt explicitly
:GeminiAsk How to add two numbers in TypeScript?

Credit

Forked from ai.nvim from gera2ld. Thank you!

About

A Neovim plugin powered by Google Gemini.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 100.0%