From 1f2671c3291148961bda87b3708ebacffbd56f0d Mon Sep 17 00:00:00 2001 From: Jonas Widen Date: Sun, 16 Mar 2025 14:29:58 +0100 Subject: [PATCH] Updated readme --- README.md | 84 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 76 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ad4e4cd..076be22 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,90 @@ # neovim-gemini -A Neovim plugin for interacting with the Google AI API (formerly Gemini). +A Neovim plugin for interacting with the Google AI API (formerly Gemini). Get AI-powered assistance directly within your Neovim editor. ## Requirements -* Neovim 0.8 or higher -* A Google AI API key (obtainable from [https://makersuite.google.com/app/apikey](https://makersuite.google.com/app/apikey)) +* Neovim 0.8 or higher +* A Google AI API key (obtainable from [https://makersuite.google.com/app/apikey](https://makersuite.google.com/app/apikey)) +* `curl` installed on your system ## Installation -Use your favorite Neovim package manager (e.g., Lazy.nvim): +Use your favorite Neovim package manager. Here's how to install with Lazy.nvim: ```lua --- Example Lazy.nvim configuration { - "your_username/neovim-gemini", -- Replace with your GitHub username and repo name + "your_username/neovim-gemini", config = function() - require("gemini").setup() -- Optional: Add a setup function in your init.lua + require("gemini").setup() end, - dependencies = {}, -- Add any dependencies here } +``` + +## Configuration + +Set your API key using one of these methods: + +1. Environment variable: +```bash +export GEMINI_API_KEY="your-api-key-here" +``` + +2. Neovim configuration: +```lua +-- In your init.lua +vim.g.gemini_api_key = "your-api-key-here" +``` + +## Usage + +The plugin provides two ways to interact with Gemini: + +1. Command Mode: +```vim +:Gemini What is SOLID in software engineering? +``` + +2. Keymap (default): +- Press `g` to open an input prompt +- Type your query and press Enter + +### Response Window + +The AI response appears in a floating window. You can close it using: +- `q` key +- `` key +- `` key +- `:q` command + +## Features + +- Floating window interface +- Non-blocking API calls +- Error handling and notifications +- Easy-to-use command and keymap interface +- Support for the latest Gemini 2.0 Flash model + +## Troubleshooting + +If you encounter issues: + +1. Verify your API key is correctly set: +```lua +:lua print(vim.g.gemini_api_key) +``` + +2. Check if curl is installed: +```bash +curl --version +``` + +3. Ensure you have billing set up in your Google Cloud project + +## License + +This project is licensed under the ISC License. See the [LICENSE](LICENSE) file for details. + +## Contributing + +Contributions are welcome! Please feel free to submit a Pull Request.