gemini-cli

August 25, 2025 ยท View on GitHub

Mentioned in Awesome Gemini CLI

A Neovim plugin to seamlessly integrate the Gemini CLI.

https://github.com/user-attachments/assets/a40b8bab-9a9c-4654-878e-c6f03577585c

Features

  • Toggle the Gemini CLI in a split window (vertical or horizontal).
  • Automatically checks if the gemini CLI is installed on startup.
  • Prompts to install the gemini CLI if it's missing.
  • Sets the EDITOR environment variable to nvim for the Gemini CLI session, so you can use Neovim to edit files from within Gemini.

Requirements

Installation

lazy.nvim

{
  "jonroosevelt/gemini-cli.nvim",
  config = function()
    require("gemini").setup({
      split_direction = "horizontal", -- optional: "vertical" (default) or "horizontal"
    })
  end,
}

packer.nvim

use {
  "jonroosevelt/gemini-cli.nvim",
  config = function()
    require("gemini").setup({
      split_direction = "horizontal", -- optional: "vertical" (default) or "horizontal"
    })
  end,
}

vim-plug

Plug 'jonroosevelt/gemini-cli.nvim'

And then in your init.lua:

require('gemini').setup()

Configuration

The plugin can be configured with the following options:

require('gemini').setup({
  split_direction = "horizontal", -- "vertical" (default) or "horizontal"
})

Configuration Options

  • split_direction: Controls how the Gemini CLI window opens
    • "vertical" (default): Opens in a vertical split (side by side)
    • "horizontal": Opens in a horizontal split (top and bottom)

Examples

Vertical Split (Default)

require('gemini').setup() -- or
require('gemini').setup({
  split_direction = "vertical"
})

Horizontal Split

require('gemini').setup({
  split_direction = "horizontal"
})

Usage

  • Use the keymap <leader>og to open and close the Gemini CLI window.
  • In visual mode, select one or more lines and use the keymap <leader>sg to send the selected text to the Gemini CLI. If the CLI window is not open, a floating message will prompt you to open it first.

When you first run the plugin, it will check if you have the gemini CLI installed. If not, it will prompt you to install it.