Arkar Myat

Introducing a simple text editing assistant with Gemini for Neovim

Feb 10, 2025Arkar
Vim

Gemini + Neovim; a simple text editing assistant

On this page

Why?

I often find myself frequently using AI for doing quick activities like

  • hey ChatGPT, validate this JSON for me
  • hey AI, rename all the fields in this JSON for me
  • hey AI, check grammar for me
  • hey AI, generate JSDocs for this function

I do these kinds of tiny transformation in my daily coding activies. So I wonder If I have like a Neovim plugin that I can just select lines that I want to modify and typed in a prompt easily without leaving my editor.

And hence gideon.nvim .

What it's not

I look around for a plugin before I decided to build a new one and I found a good amount of plugins that have really good AI integration inside Neovim.

Here are what my plugin is not

  • not a full blown AI chat integration
  • no, you are not suppose to go back and forth with the AI
  • not it's not a heavy RAG solution that check everything in your code base and give you solution

It's just a AI quick assistant that you can use without switching context or going to browser, no context switching while coding.

You might get some weird output that you didn't expect sometime, its fine and you are not suppose to be a senior prompt engineer while using this plugin.

If you have to spend a lot of time thinking a prompt in this plugin, you might be using this for unintended purpose.

How?

You can install this plugin pretty much easily with just lazy or any other plugins system but I recommend using lazy,nvim .

-- lazy
return {
  "Riley1101/gideon.nvim",
  config = function()
    local gideon = require("gideon")
    gideon.setup()
  end,
}

Make sure you have "GEMINI_API_KEY" in your shell environment variables as well. You can generate it in Google AI studio.

Once you installed the plugin, you can just run in your command mode. And this will send your message to Gemini and paste the result directly under next line. So it's important your buffer is not read-only.

:Gideongen <prompt>

Visual mode prompt

If you want to send any text from your current file, you can just go to visual mode and highlight the text you want , for example Shift+V for multiple lines and the plugin will pick up the last highlighted chunk and send to Gemini.

article image

What's next

For sure, I would like to add options to allow more prompt setting and model options etc. I will try to schedule myself to give enough time for this.

If you have any idea feel free to fork and make pr , I would greatly appreciate it.

Subscribe to my NewsLetter!

Join my web development newsletter to receive the latest updates, tips, and trends directly in your inbox.