{"repo": "archibate/gpt4o", "files": {"README.md": {"6a10f2694dd347357f1d5e725e08fb65c4c2b658": {"t": 1785746710.8009202, "n": 10418, "h": "e13cc3282bde340e", "c": "# gpt4o.nvim\n\nBlazing fast πŸš€ code assistant in NeoVim powered by GPT-4o ✨, offering intelligent code completion and editing to elevate developer productivity. πŸš„\n\n(Work In Progress ⚠️ )\n\n\n\n## Features\n- Context-aware suggestions 🌍\n- Project files accounted πŸ…\n- Recent change awareness πŸ“œ\n- Real-time code completion ⏰\n- Incremental streaming result ⏳\n- Edit existing code bases πŸ› οΈ\n- Able to see diagnostics ⚠️\n- Fix your code in place πŸ“\n- Auto-move around cursor 🚦\n- Terminal output included πŸ’»\n- Auto-embed for related files πŸ€“\n- Multi-language support 🌐\n- Customizable settings βš™οΈ\n- Edit-mode and chat-mode πŸ’¬\n- Lightweight and efficient ⚑\n- Async execution for performance πŸ’ͺ\n- Ready to use out of the box πŸ“¦\n\n## Installation\nTo install gpt4o.nvim, first make sure you have python3 support on your NeoVim πŸ™Œ\n\nYou may do this by running:\n\n```bash\npython3 -m pip install neovim openai tiktoken\n```\n\nSo far, by running `:checkhealth provider.python`, you should see:\n\n```txt\nOK: Latest pynvim is installed.\n```\n\nNow, let's install this plugin with your plguin manager ☺️\n\n### [packer.nvim](https://github.com/wbthomason/packer.nvim)\n\nAdd the following to your `~/.config/nvim/init.lua`:\n\n```lua\nuse {\n 'archibate/gpt4o.nvim',\n run = ':silent! UpdateRemotePlugins',\n}\n```\n\nThen, run `:PackerInstall` in NeoVim.\n\n### [lazy.nvim](https://github.com/folke/lazy.nvim)\n\nAdd the following to your `~/.config/nvim/init.lua`:\n\n### [vim-plug](https://github.com/junegunn/vim-plug)\n\nAdd the following to your `~/.config/nvim/init.vim`:\n\n```vim\nPlug 'archibate/gpt4o.nvim'\n```\n\nThen, run `:PlugInstall` in NeoVim.\n\nAfter that, run `:UpdateRemotePlugins` to setup our python3 plugin (if your plugin manager didn't setup it automatically).\n\n## LLM providers\nWe are almost done! The only thing remain is to find an LLM provider.\n\n### @archibate's free service\nWorry not, this plugin can be used directly by default! No need to configure any provider.\n\nThis is all thanks to the free service at https://142857.red provided by @archibate just for you πŸ’•\n\nThe default free service is only provided as a trial for people who have difficulty in registering LLM accounts. The server is deployed in Hangzhou, China, hosted by Aliyun.\n\nI will not try to save or trace any of your data! However, there is also no warranty if the poor server is being accidentally attacked or shutdown.\n\nSo, for advanced users, it's suggested to configure your own LLM provider if possible. This would not only save @archibate's poor salary, but also improve your data security as well.\n\n### OpenAI (gpt4o)\nGoto [OpenAI platform](https://platform.openai.com/api-keys), create a new API key. You want to register an OpenAI account if you haven't yet.\n\nThere is a free trial of $5 budget if I recall correctly. Each invocation will consume this budget, and if the free trial has been exhausted, you'll need to set up a payment method (e.g. VISA) to continue using the service.\n\n> The API key will look like this: `sk-xxxxxxxxxxxxx`, do not share it with other people.\n\nThen, append a line to your `~/.bashrc` (`~/.zshrc` for Zsh users):\n```bash\nexport OPENAI_API_KEY=\"sk-xxxxxxxxxxxxx\"\n```\n\nRestart your shell, enter NeoVim and try run `:GPT` and have fun!\n\n> The plugin will invoke `https://api.openai.com` in the background for you for code completion 😎\n\n### DeepSeek (deepseek-coder)\nDeepSeek is a Chinese company that specializes in AI-driven programming tools and code assistance solutions, which is kinda Messiah for Chinese students who could't afford an VISA card. Their slogan is:\n\n> Unravel the mystery of AGI with curiosity. Answer the essential question with long-termism 😎\n\nDeepSeek conveniently provides an OpenAI compatible API at `https://api.deepseek.com`. As you may have already guessed, goto [DeepSeek Platform](https://platform.deepseek.com/api_keys) to obtain an API key. Register an DeepSeek account if you haven't one yet.\n\n> They provide Β₯20 free trial for every new customer too; but make sure you use it within 1 month! Otherwise, it seems to become expired and no longer usable. ☹️\n\nAnyway, append these lines to your `~/.bashrc` (`~/.zshrc` for Zsh users):\n```bash\nexport OPENAI_BASE_URL=\"https://api.deepseek.com\"\nexport OPENAI_API_KEY=\"sk-xxxxxxxxxxxxx\"\n```\n\n> Note that `OPENAI_BASE_URL` is required for overriding the default OpenAI API into an OpenAI-compatible API (`https://api.deepseek.com` in this case).\n\n## Usage\n\nTODO: Showcase Work In Progress ⚠️ \n\n```vim\n:GPTEdit\n:GPTEdit please optimize this function\n```\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Contributing\nContributions are welcome! If you'd like to help improve gpt4o.nvim, please open a pull request or issue on the repository. Here are some ways you can contribute:\n- Report bugs or suggest new features to help us enhance functionality.\n- Submit code contributions to fix bugs or add new features, following the project's coding standards.\n- Improve documentation by submitting edits or examples to assist other users in using gpt4o.nvim effectively.\n- Share your experiences and best practices in the community forums to foster collaboration and knowledge sharing.\n- Engage with other developers by participating in discussions or providing feedback on proposed changes.\n- Create tutorials or guides that showcase how to leverage gpt4o.nvim for various use cases and programming languages.\n- Test updates and new features thoroughly to ensure they perform as expected and report any issues encountered during testing.\n- Promote gpt4o.nvim in relevant developer communities to increase awareness and user adoption.\n\nWe appreciate your involvement and look forward to your contributions!\n\n## License\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. By contributing to this project, you agree that your contributions will also be licensed under the same MIT License.\n\n## Fun Fact\nThe README above is written with gpt4o.nvim πŸ˜„\n![awesome-face](https://142857.red/book/img/favicon.ico)\n\n\n\n\n\n\n\n\n\n\n"}, "2caa3fbba6bce1a53413abaed98d35b847d7269c": {"t": 1785767179.8423486, "n": 10418, "h": "e13cc3282bde340e", "c": "# gpt4o.nvim\n\nBlazing fast πŸš€ code assistant in NeoVim powered by GPT-4o ✨, offering intelligent code completion and editing to elevate developer productivity. πŸš„\n\n(Work In Progress ⚠️ )\n\n\n\n## Features\n- Context-aware suggestions 🌍\n- Project files accounted πŸ…\n- Recent change awareness πŸ“œ\n- Real-time code completion ⏰\n- Incremental streaming result ⏳\n- Edit existing code bases πŸ› οΈ\n- Able to see diagnostics ⚠️\n- Fix your code in place πŸ“\n- Auto-move around cursor 🚦\n- Terminal output included πŸ’»\n- Auto-embed for related files πŸ€“\n- Multi-language support 🌐\n- Customizable settings βš™οΈ\n- Edit-mode and chat-mode πŸ’¬\n- Lightweight and efficient ⚑\n- Async execution for performance πŸ’ͺ\n- Ready to use out of the box πŸ“¦\n\n## Installation\nTo install gpt4o.nvim, first make sure you have python3 support on your NeoVim πŸ™Œ\n\nYou may do this by running:\n\n```bash\npython3 -m pip install neovim openai tiktoken\n```\n\nSo far, by running `:checkhealth provider.python`, you should see:\n\n```txt\nOK: Latest pynvim is installed.\n```\n\nNow, let's install this plugin with your plguin manager ☺️\n\n### [packer.nvim](https://github.com/wbthomason/packer.nvim)\n\nAdd the following to your `~/.config/nvim/init.lua`:\n\n```lua\nuse {\n 'archibate/gpt4o.nvim',\n run = ':silent! UpdateRemotePlugins',\n}\n```\n\nThen, run `:PackerInstall` in NeoVim.\n\n### [lazy.nvim](https://github.com/folke/lazy.nvim)\n\nAdd the following to your `~/.config/nvim/init.lua`:\n\n### [vim-plug](https://github.com/junegunn/vim-plug)\n\nAdd the following to your `~/.config/nvim/init.vim`:\n\n```vim\nPlug 'archibate/gpt4o.nvim'\n```\n\nThen, run `:PlugInstall` in NeoVim.\n\nAfter that, run `:UpdateRemotePlugins` to setup our python3 plugin (if your plugin manager didn't setup it automatically).\n\n## LLM providers\nWe are almost done! The only thing remain is to find an LLM provider.\n\n### @archibate's free service\nWorry not, this plugin can be used directly by default! No need to configure any provider.\n\nThis is all thanks to the free service at https://142857.red provided by @archibate just for you πŸ’•\n\nThe default free service is only provided as a trial for people who have difficulty in registering LLM accounts. The server is deployed in Hangzhou, China, hosted by Aliyun.\n\nI will not try to save or trace any of your data! However, there is also no warranty if the poor server is being accidentally attacked or shutdown.\n\nSo, for advanced users, it's suggested to configure your own LLM provider if possible. This would not only save @archibate's poor salary, but also improve your data security as well.\n\n### OpenAI (gpt4o)\nGoto [OpenAI platform](https://platform.openai.com/api-keys), create a new API key. You want to register an OpenAI account if you haven't yet.\n\nThere is a free trial of $5 budget if I recall correctly. Each invocation will consume this budget, and if the free trial has been exhausted, you'll need to set up a payment method (e.g. VISA) to continue using the service.\n\n> The API key will look like this: `sk-xxxxxxxxxxxxx`, do not share it with other people.\n\nThen, append a line to your `~/.bashrc` (`~/.zshrc` for Zsh users):\n```bash\nexport OPENAI_API_KEY=\"sk-xxxxxxxxxxxxx\"\n```\n\nRestart your shell, enter NeoVim and try run `:GPT` and have fun!\n\n> The plugin will invoke `https://api.openai.com` in the background for you for code completion 😎\n\n### DeepSeek (deepseek-coder)\nDeepSeek is a Chinese company that specializes in AI-driven programming tools and code assistance solutions, which is kinda Messiah for Chinese students who could't afford an VISA card. Their slogan is:\n\n> Unravel the mystery of AGI with curiosity. Answer the essential question with long-termism 😎\n\nDeepSeek conveniently provides an OpenAI compatible API at `https://api.deepseek.com`. As you may have already guessed, goto [DeepSeek Platform](https://platform.deepseek.com/api_keys) to obtain an API key. Register an DeepSeek account if you haven't one yet.\n\n> They provide Β₯20 free trial for every new customer too; but make sure you use it within 1 month! Otherwise, it seems to become expired and no longer usable. ☹️\n\nAnyway, append these lines to your `~/.bashrc` (`~/.zshrc` for Zsh users):\n```bash\nexport OPENAI_BASE_URL=\"https://api.deepseek.com\"\nexport OPENAI_API_KEY=\"sk-xxxxxxxxxxxxx\"\n```\n\n> Note that `OPENAI_BASE_URL` is required for overriding the default OpenAI API into an OpenAI-compatible API (`https://api.deepseek.com` in this case).\n\n## Usage\n\nTODO: Showcase Work In Progress ⚠️ \n\n```vim\n:GPTEdit\n:GPTEdit please optimize this function\n```\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Contributing\nContributions are welcome! If you'd like to help improve gpt4o.nvim, please open a pull request or issue on the repository. Here are some ways you can contribute:\n- Report bugs or suggest new features to help us enhance functionality.\n- Submit code contributions to fix bugs or add new features, following the project's coding standards.\n- Improve documentation by submitting edits or examples to assist other users in using gpt4o.nvim effectively.\n- Share your experiences and best practices in the community forums to foster collaboration and knowledge sharing.\n- Engage with other developers by participating in discussions or providing feedback on proposed changes.\n- Create tutorials or guides that showcase how to leverage gpt4o.nvim for various use cases and programming languages.\n- Test updates and new features thoroughly to ensure they perform as expected and report any issues encountered during testing.\n- Promote gpt4o.nvim in relevant developer communities to increase awareness and user adoption.\n\nWe appreciate your involvement and look forward to your contributions!\n\n## License\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. By contributing to this project, you agree that your contributions will also be licensed under the same MIT License.\n\n## Fun Fact\nThe README above is written with gpt4o.nvim πŸ˜„\n![awesome-face](https://142857.red/book/img/favicon.ico)\n\n\n\n\n\n\n\n\n\n\n"}, "78201ed91765d8e0bf059f6911bcc8c25ce9aceb": {"t": 1785767181.2587812, "n": 9708, "h": "c8aa7eea887582eb", "c": "# gpt4o.nvim\n\nBlazing fast πŸš€ code assistant in NeoVim powered by GPT-4o ✨, offering intelligent code completion and editing to elevate developer productivity. πŸš„\n\n(Work In Progress ⚠️ )\n\n\n\n## Features\n- Context-aware suggestions 🌍\n- Project files accounted πŸ…\n- Recent change awareness πŸ“œ\n- Real-time code completion ⏰\n- Incremental streaming result ⏳\n- Edit existing code bases πŸ› οΈ\n- Able to see diagnostics ⚠️\n- Fix your code in place πŸ“\n- Auto-move around cursor 🚦\n- Terminal output included πŸ’»\n- Auto-embed for related files πŸ€“\n- Multi-language support 🌐\n- Customizable settings βš™οΈ\n- Edit-mode and chat-mode πŸ’¬\n- Lightweight and efficient ⚑\n- Async execution for performance πŸ’ͺ\n- Ready to use out of the box πŸ“¦\n\n## Installation\nTo install gpt4o.nvim, first make sure you have python3 support on your NeoVim πŸ™Œ\n\nYou may do this by running:\n\n```bash\npython3 -m pip install neovim openai tiktoken\n```\n\nSo far, by running `:checkhealth provider.python`, you should see:\n\n```txt\nOK: Latest pynvim is installed.\n```\n\nNow, let's install this plugin with your plguin manager ☺️\n\n### [packer.nvim](https://github.com/wbthomason/packer.nvim)\n\nAdd the following to your `~/.config/nvim/init.lua`:\n\n```lua\nuse {\n 'archibate/gpt4o.nvim',\n run = ':silent! UpdateRemotePlugins',\n}\n```\n\nThen, run `:PackerInstall` in NeoVim.\n\n### [lazy.nvim](https://github.com/folke/lazy.nvim)\n\nAdd the following to your `~/.config/nvim/init.lua`:\n\n### [vim-plug](https://github.com/junegunn/vim-plug)\n\nAdd the following to your `~/.config/nvim/init.vim`:\n\n```vim\nPlug 'archibate/gpt4o.nvim'\n```\n\nThen, run `:PlugInstall` in NeoVim.\n\nAfter that, run `:UpdateRemotePlugins` to setup our python3 plugin (if your plugin manager didn't setup it automatically).\n\n## LLM providers\nWe are almost done! The only thing remain is to find an LLM provider.\n\n### @archibate's free service\nWorry not, this plugin can be used directly by default! No need to configure any provider.\n\nThis is all thanks to the free service at https://142857.red provided by @archibate just for you πŸ’•\n\nThe default free service is only provided as a trial for people who have difficulty in registering LLM accounts. The server is deployed in Hangzhou, China, hosted by Aliyun.\n\nI will not try to save or trace any of your data! However, there is also no warranty if the poor server is being accidentally attacked or shutdown.\n\nSo, for advanced users, it's suggested to configure your own LLM provider if possible. This would not only save @archibate's poor salary, but also improve your data security as well.\n\n### OpenAI (gpt4o)\nGoto [OpenAI platform](https://platform.openai.com/api-keys), create a new API key. You want to register an OpenAI account if you haven't yet.\n\nThere is a free trial of $5 budget if I recall correctly. Each invocation will consume this budget, and if the free trial has been exhausted, you'll need to set up a payment method (e.g. VISA) to continue using the service.\n\n> The API key will look like this: `sk-xxxxxxxxxxxxx`, do not share it with other people.\n\nThen, append a line to your `~/.bashrc` (`~/.zshrc` for Zsh users):\n```bash\nexport OPENAI_API_KEY=\"sk-xxxxxxxxxxxxx\"\n```\n\nRestart your shell, enter NeoVim and try run `:GPT` and have fun!\n\n> The plugin will invoke `https://api.openai.com` in the background for you for code completion 😎\n\n### DeepSeek (deepseek-coder)\nDeepSeek is a Chinese company that specializes in AI-driven programming tools and code assistance solutions, which is kinda Messiah for Chinese students who could't afford an VISA card. Their slogan is:\n\n> Unravel the mystery of AGI with curiosity. Answer the essential question with long-termism 😎\n\nDeepSeek conveniently provides an OpenAI compatible API at `https://api.deepseek.com`. As you may have already guessed, goto [DeepSeek Platform](https://platform.deepseek.com/api_keys) to obtain an API key. Register an DeepSeek account if you haven't one yet.\n\n> They provide Β₯20 free trial for every new customer too; but make sure you use it within 1 month! Otherwise, it seems to become expired and no longer usable. ☹️\n\nAnyway, append these lines to your `~/.bashrc` (`~/.zshrc` for Zsh users):\n```bash\nexport OPENAI_BASE_URL=\"https://api.deepseek.com\"\nexport OPENAI_API_KEY=\"sk-xxxxxxxxxxxxx\"\n```\n\n> Note that `OPENAI_BASE_URL` is required for overriding the default OpenAI API into an OpenAI-compatible API (`https://api.deepseek.com` in this case).\n\n## Usage\nOnce installed and configured, enter VISUAL mode by selecting the region of code you want to edit. Then invoke gpt4o by typing `:GPT `, where `` is your question or instruction to ask gpt4o to help, for example, `:GPT refactor this code` or `:GPT extract chunk_size into variable`. The assistant will edit the selected section of code to fulfill your instruction, the context of your code around are considered.\n\nIf no `` provided, gpt4o will try to complete and fix possible mistakes in the editing code.\n\nIf you invoke `:GPT` with no selection, i.e. not in VISUAL mode, gpt4o will only edit the current line of code where cursor located at, a single line.\n\n### `:GPT4`\n\nInvoke `:GPT4` instead, allows gpt4o editing Β± 4 lines of code around the cursor, which is usually the small fraction of code you'd like to edit.\n\n> πŸ˜‚ In case you missed my laughing point: GPT4 = GPT4o with Β± 4 lines editing ability πŸ€£πŸŽ‰ Hope you find this fun...\n\nActually, `:GPT4` is just a shortcut for `:-4,+4GPT`, which is Vim's range specifier syntax.\n\n### `:%GPT`\n\nTyping `:%GPT` would allow gpt4o to edit the whole file. Since `%` means 'All lines' in Vim's range specifier syntax.\n\n\n\n\n\n## Key maps\nIt's suggested to map your preferred key bindings to quickly invoke gpt4o commands. For example, you might want to add the following lines to your `init.vim`:\n\n```vim\nnnoremap gp :GPT\nvnoremap gp :GPT\nnnoremap GPT\nvnoremap GPT\ninoremap GPT\n```\n\nor `init.lua`:\n\n```lua\nvim.keymap.set({'v', 'n'}, 'gp', ':GPT')\nvim.keymap.set({'i', 'v', 'n'}, '', 'GPT')\n```\n\nAfterwards you may type `gp` in VISUAL or NORMAL mode to trigger GPT completion for selected range or current line. And `gp@term` if you'd like to attach terminal output. Optionally type `gpoptimize this code` for giving custom instructions.\n\nTogether with [nvim-treesitter-textobjects](https://github.com/nvim-treesitter/nvim-treesitter-textobjects) for example, you may type `vafgp` to let gpt4o edit the current function, and `vacgp` for the current class, and so on.\n\nAnd `` in INSERT mode for triggering code completion in place when you feel lazy 😊.\n\nFor example, you may also map `` to `:-8,+8GPT refactor this code` for refactoring +- 8 line of code.\n\n```lua\nvim.keymap.set({'i', 'n'}, '', '-8,+8GPT refactor this code')\nvim.keymap.set({'v'}, '', 'GPT refactor this code')\n```\n\n## Configuration\nYou can customize the behavior of gpt4o by adding the following to your `init.vim` or `init.lua`:\n\n```vim\n:GPTSetup model=gpt-4o-mini temperature=0\n```\n\nRun `:GPTSetup` (with no arguments) to list all configurable options.\n\n> By default, model is `gpt-4o-mini` for best speed and economy. You may change this by setting, for example, `model=gpt-4o`.\n\n## Contributing\nContributions are welcome! If you'd like to help improve gpt4o.nvim, please open a pull request or issue on the repository. Here are some ways you can contribute:\n- Report bugs or suggest new features to help us enhance functionality.\n- Submit code contributions to fix bugs or add new features, following the project's coding standards.\n- Improve documentation by submitting edits or examples to assist other users in using gpt4o.nvim effectively.\n- Share your experiences and best practices in the community forums to foster collaboration and knowledge sharing.\n- Engage with other developers by participating in discussions or providing feedback on proposed changes.\n- Create tutorials or guides that showcase how to leverage gpt4o.nvim for various use cases and programming languages.\n- Test updates and new features thoroughly to ensure they perform as expected and report any issues encountered during testing.\n- Promote gpt4o.nvim in relevant developer communities to increase awareness and user adoption.\n\nWe appreciate your involvement and look forward to your contributions!\n\n## License\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. By contributing to this project, you agree that your contributions will also be licensed under the same MIT License.\n\n## Fun Fact\nThe README above is written with gpt4o.nvim πŸ˜„\n![awesome-face](https://142857.red/book/img/favicon.ico)\n\nUsage showcase:\n```markdown\nMay also instead invoke `:GPT4` to allow gpt4o editing +- 4 lines of code around the cursor.\n```\nAnd I type `:GPT make this +- the real +- symbol` and gpt4o automatically fix that for me 😎\n```markdown\nMay also instead invoke `:GPT4` to allow gpt4o editing Β± 4 lines of code around the cursor.\n```\nSo emojis in the 'Features' section are added by gpt4o too... I can finally uninstall my emoji input method πŸ’” Have fun!\n"}, "8bdeb9c6fba1576cf78f4d00ffc26a5566164909": {"t": 1785767182.5926075, "n": 8430, "h": "2683f44cc4d2c74c", "c": "# gpt4o.nvim\n\nBlazing fast πŸš€ code assistant in NeoVim powered by GPT-4o ✨, offering intelligent code completion and editing to elevate developer productivity.\n\n(Work In Progress ⚠️ )\n\n\n\n## Features\n- Context-aware suggestions 🌍\n- Project files accounted πŸ“„\n- Recent change awareness Β±\n- Real-time code completion ⚑\n- Incremental streaming result ⏳\n- Edit existing code bases πŸ› οΈ\n- Recognizing terminal errors ⚠️\n- Fix your code in place πŸ“\n- Multi-language support 🌐\n- Customizable settings βš™οΈ\n- Lightweight and efficient πŸ’¨\n\n## Installation\nTo install gpt4o.nvim, first make sure you have python3 support on your NeoVim.\n\nYou may do this by running:\n\n```bash\npython3 -m pip install neovim openai tiktoken\n```\n\nSo far, you should see `OK` in the python3 support when running `:checkhealth`.\n\nNow add the following to your `~/.config/nvim/init.vim`, with your plugin manager, [vim-plug](https://github.com/junegunn/vim-plug) for example:\n\n```vim\nPlug 'archibate/gpt4o.nvim'\n```\n\nThen, run `:PlugInstall` (or whatever your plugin manager name it) in NeoVim.\n\nAfter that, run `:UpdateRemotePlugins` to setup our python3 plugin (if your plugin manager didn't setup it automatically).\n\n## LLM providers\nWe are almost done! The only thing remain is to find an LLM provider.\n\n### OpenAI (gpt4o)\nGoto [OpenAI platform](https://platform.openai.com/api-keys), create a new API key. You want to register an OpenAI account if you haven't yet.\n\nThere is a free trial of $5 budget if I recall correctly. Each invocation will consume this budget, and if the free trial has been exhausted, you'll need to set up a payment method (e.g. VISA) to continue using the service.\n\n> The API key will look like this: `sk-xxxxxxxxxxxxx`, do not share it with other people.\n\nThen, append a line to your `~/.bashrc` (`~/.zshrc` for Zsh users):\n```bash\nexport OPENAI_API_KEY=\"sk-xxxxxxxxxxxxx\"\n```\n\nRestart your shell, enter NeoVim and try run `:GPT` and have fun!\n\n> The plugin will invoke `https://api.openai.com` in the background for you for code completion 😎\n\n### DeepSeek (deepseek-coder)\nDeepSeek is a Chinese company that specializes in AI-driven programming tools and code assistance solutions, which is kinda Messiah for Chinese students who could't afford an VISA card. Their slogan is:\n\n> Unravel the mystery of AGI with curiosity. Answer the essential question with long-termism 😎\n\nDeepSeek conveniently provides an OpenAI compatible API at `https://api.deepseek.com`. As you may have already guessed, goto [DeepSeek Platform](https://platform.deepseek.com/api_keys) to obtain an API key. Register an DeepSeek account if you haven't one yet.\n\n> They provide Β₯20 free trial for every new customer too; but make sure you use it within 1 month! Otherwise, it seems to become expired and no longer usable. ☹️\n\nAnyway, append these lines to your `~/.bashrc` (`~/.zshrc` for Zsh users):\n```bash\nexport OPENAI_BASE_URL=\"https://api.deepseek.com\"\nexport OPENAI_API_KEY=\"sk-xxxxxxxxxxxxx\"\n```\n\n> Note that `OPENAI_BASE_URL` is required for overriding the default OpenAI API into an OpenAI-compatible API (`https://api.deepseek.com` in this case).\n\n## Usage\nOnce installed and configured, enter VISUAL mode by selecting the region of code you want to edit. Then invoke gpt4o by typing `:GPT `, where `` is your question or instruction to ask gpt4o to help, for example, `:GPT refactor this code` or `:GPT extract chunk_size into variable`. The assistant will edit the selected section of code to fulfill your instruction, the context of your code around are considered.\n\nIf no `` provided, gpt4o will try to complete and fix possible mistakes in the editing code.\n\nIf you invoke `:GPT` with no selection, i.e. not in VISUAL mode, gpt4o will only edit the current line of code where cursor located at, a single line.\n\n### `:GPT4`\n\nInvoke `:GPT4` instead, allows gpt4o editing Β± 4 lines of code around the cursor, which is usually the small fraction of code you'd like to edit.\n\n> πŸ˜‚ In case you missed my laughing point: GPT4 = GPT4o with Β± 4 lines editing ability πŸ€£πŸŽ‰ Hope you find this fun...\n\nActually, `:GPT4` is just a shortcut for `:-4,+4GPT`, which is Vim's range specifier syntax.\n\n### `:%GPT`\n\nTyping `:%GPT` would allow gpt4o to edit the whole file. Since `%` means 'All lines' in Vim's range specifier syntax.\n\n\n\n\n\n## Key maps\nIt's suggested to map your preferred key bindings to quickly invoke gpt4o commands. For example, you might want to add the following lines to your `init.vim`:\n\n```vim\nnnoremap gp :GPT\nvnoremap gp :GPT\nnnoremap GPT\nvnoremap GPT\ninoremap GPT\n```\n\nor `init.lua`:\n\n```lua\nvim.keymap.set({'v', 'n'}, 'gp', ':GPT')\nvim.keymap.set({'i', 'v', 'n'}, '', 'GPT')\n```\n\nAfterwards you may type `gp` in VISUAL or NORMAL mode to trigger GPT completion for selected range or current line. And `gp@term` if you'd like to attach terminal output. Optionally type `gpoptimize this code` for giving custom instructions.\n\nTogether with [nvim-treesitter-textobjects](https://github.com/nvim-treesitter/nvim-treesitter-textobjects) for example, you may type `vafgp` to let gpt4o edit the current function, and `vacgp` for the current class, and so on.\n\nAnd `` in INSERT mode for triggering code completion in place when you feel lazy 😊.\n\nFor example, you may also map `` to `:-8,+8GPT refactor this code` for refactoring +- 8 line of code.\n\n```lua\nvim.keymap.set({'i', 'n'}, '', '-8,+8GPT refactor this code')\nvim.keymap.set({'v'}, '', 'GPT refactor this code')\n```\n\n## Configuration\nYou can customize the behavior of gpt4o by adding the following to your `init.vim` or `init.lua`:\n\n```vim\n:GPTSetup model=gpt-4o-mini temperature=0\n```\n\nRun `:GPTSetup` (with no arguments) to list all configurable options.\n\n> By default, model is `gpt-4o-mini` for best speed and economy. You may change this by setting, for example, `model=gpt-4o`.\n\n## Contributing\nContributions are welcome! If you'd like to help improve gpt4o.nvim, please open a pull request or issue on the repository. Here are some ways you can contribute:\n- Report bugs or suggest new features to help us enhance functionality.\n- Submit code contributions to fix bugs or add new features, following the project's coding standards.\n- Improve documentation by submitting edits or examples to assist other users in using gpt4o.nvim effectively.\n- Share your experiences and best practices in the community forums to foster collaboration and knowledge sharing.\n- Engage with other developers by participating in discussions or providing feedback on proposed changes.\n- Create tutorials or guides that showcase how to leverage gpt4o.nvim for various use cases and programming languages.\n- Test updates and new features thoroughly to ensure they perform as expected and report any issues encountered during testing.\n- Promote gpt4o.nvim in relevant developer communities to increase awareness and user adoption.\n\nWe appreciate your involvement and look forward to your contributions!\n\n## License\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. By contributing to this project, you agree that your contributions will also be licensed under the same MIT License.\n\n## Fun Fact\nThe README above is written with gpt4o.nvim πŸ˜„\n![awesome-face](https://142857.red/book/img/favicon.ico)\n\nUsage showcase:\n```markdown\nMay also instead invoke `:GPT4` to allow gpt4o editing +- 4 lines of code around the cursor.\n```\nAnd I type `:GPT make this +- the real +- symbol` and gpt4o automatically fix that for me 😎\n```markdown\nMay also instead invoke `:GPT4` to allow gpt4o editing Β± 4 lines of code around the cursor.\n```\nSo emojis in the 'Features' section are added by gpt4o too... I can finally uninstall my emoji input method πŸ’” Have fun!\n"}, "a1e3e2a782471c78daa97bbea7e1b2bebffb3f8a": {"t": 1785767183.9038987, "n": 8406, "h": "475fd77b55e3bba6", "c": "# gpt4o.nvim\n\nBlazing fast πŸš€ code assistant in NeoVim powered by GPT-4o ✨, offering intelligent code completion and editing to elevate developer productivity.\n\n\n\n## Features\n- Context-aware suggestions 🌍\n- Project files accounted πŸ“„\n- Recent change awareness Β±\n- Real-time code completion ⚑\n- Incremental streaming result ⏳\n- Edit existing code bases πŸ› οΈ\n- Recognizing terminal errors ⚠️\n- Fix your code in place πŸ“\n- Multi-language support 🌐\n- Customizable settings βš™οΈ\n- Lightweight and efficient πŸ’¨\n\n## Installation\nTo install gpt4o.nvim, first make sure you have python3 support on your NeoVim.\n\nYou may do this by running:\n\n```bash\npython3 -m pip install neovim openai tiktoken\n```\n\nSo far, you should see `OK` in the python3 support when running `:checkhealth`.\n\nNow add the following to your `~/.config/nvim/init.vim`, with your plugin manager, [vim-plug](https://github.com/junegunn/vim-plug) for example:\n\n```vim\nPlug 'archibate/gpt4o.nvim'\n```\n\nThen, run `:PlugInstall` (or whatever your plugin manager name it) in NeoVim.\n\nAfter that, run `:UpdateRemotePlugins` to setup our python3 plugin (if your plugin manager didn't setup it automatically).\n\n## LLM providers\nWe are almost done! The only thing remain is to find an LLM provider.\n\n### OpenAI (gpt4o)\nGoto [OpenAI platform](https://platform.openai.com/api-keys), create a new API key. You want to register an OpenAI account if you haven't yet.\n\nThere is a free trial of $5 budget if I recall correctly. Each invocation will consume this budget, and if the free trial has been exhausted, you'll need to set up a payment method (e.g. VISA) to continue using the service.\n\n> The API key will look like this: `sk-xxxxxxxxxxxxx`, do not share it with other people.\n\nThen, append a line to your `~/.bashrc` (`~/.zshrc` for Zsh users):\n```bash\nexport OPENAI_API_KEY=\"sk-xxxxxxxxxxxxx\"\n```\n\nRestart your shell, enter NeoVim and try run `:GPT` and have fun!\n\n> The plugin will invoke `https://api.openai.com` in the background for you for code completion 😎\n\n### DeepSeek (deepseek-coder)\nDeepSeek is a Chinese company that specializes in AI-driven programming tools and code assistance solutions, which is kinda Messiah for Chinese students who could't afford an VISA card. Their slogan is:\n\n> Unravel the mystery of AGI with curiosity. Answer the essential question with long-termism 😎\n\nDeepSeek conveniently provides an OpenAI compatible API at `https://api.deepseek.com`. As you may have already guessed, goto [DeepSeek Platform](https://platform.deepseek.com/api_keys) to obtain an API key. Register an DeepSeek account if you haven't one yet.\n\n> They provide Β₯20 free trial for every new customer too; but make sure you use it within 1 month! Otherwise, it seems to become expired and no longer usable. ☹️\n\nAnyway, append these lines to your `~/.bashrc` (`~/.zshrc` for Zsh users):\n```bash\nexport OPENAI_BASE_URL=\"https://api.deepseek.com\"\nexport OPENAI_API_KEY=\"sk-xxxxxxxxxxxxx\"\n```\n\n> Note that `OPENAI_BASE_URL` is required for overriding the default OpenAI API into an OpenAI-compatible API (`https://api.deepseek.com` in this case).\n\n## Usage\nOnce installed and configured, enter VISUAL mode by selecting the region of code you want to edit. Then invoke gpt4o by typing `:GPT `, where `` is your question or instruction to ask gpt4o to help, for example, `:GPT refactor this code` or `:GPT extract chunk_size into variable`. The assistant will edit the selected section of code to fulfill your instruction, the context of your code around are considered.\n\nIf no `` provided, gpt4o will try to complete and fix possible mistakes in the editing code.\n\nIf you invoke `:GPT` with no selection, i.e. not in VISUAL mode, gpt4o will only edit the current line of code where cursor located at, a single line.\n\n### `:GPT4`\n\nInvoke `:GPT4` instead, allows gpt4o editing Β± 4 lines of code around the cursor, which is usually the small fraction of code you'd like to edit.\n\n> πŸ˜‚ In case you missed my laughing point: GPT4 = GPT4o with Β± 4 lines editing ability πŸ€£πŸŽ‰ Hope you find this fun...\n\nActually, `:GPT4` is just a shortcut for `:-4,+4GPT`, which is Vim's range specifier syntax.\n\n### `:%GPT`\n\nTyping `:%GPT` would allow gpt4o to edit the whole file. Since `%` means 'All lines' in Vim's range specifier syntax.\n\n\n\n\n\n## Key maps\nIt's suggested to map your preferred key bindings to quickly invoke gpt4o commands. For example, you might want to add the following lines to your `init.vim`:\n\n```vim\nnnoremap gp :GPT\nvnoremap gp :GPT\nnnoremap GPT\nvnoremap GPT\ninoremap GPT\n```\n\nor `init.lua`:\n\n```lua\nvim.keymap.set({'v', 'n'}, 'gp', ':GPT')\nvim.keymap.set({'i', 'v', 'n'}, '', 'GPT')\n```\n\nAfterwards you may type `gp` in VISUAL or NORMAL mode to trigger GPT completion for selected range or current line. And `gp@term` if you'd like to attach terminal output. Optionally type `gpoptimize this code` for giving custom instructions.\n\nTogether with [nvim-treesitter-textobjects](https://github.com/nvim-treesitter/nvim-treesitter-textobjects) for example, you may type `vafgp` to let gpt4o edit the current function, and `vacgp` for the current class, and so on.\n\nAnd `` in INSERT mode for triggering code completion in place when you feel lazy 😊.\n\nFor example, you may also map `` to `:-8,+8GPT refactor this code` for refactoring +- 8 line of code.\n\n```lua\nvim.keymap.set({'i', 'n'}, '', '-8,+8GPT refactor this code')\nvim.keymap.set({'v'}, '', 'GPT refactor this code')\n```\n\n## Configuration\nYou can customize the behavior of gpt4o by adding the following to your `init.vim` or `init.lua`:\n\n```vim\n:GPTSetup model=gpt-4o-mini temperature=0\n```\n\nRun `:GPTSetup` (with no arguments) to list all configurable options.\n\n> By default, model is `gpt-4o-mini` for best speed and economy. You may change this by setting, for example, `model=gpt-4o`.\n\n## Contributing\nContributions are welcome! If you'd like to help improve gpt4o.nvim, please open a pull request or issue on the repository. Here are some ways you can contribute:\n- Report bugs or suggest new features to help us enhance functionality.\n- Submit code contributions to fix bugs or add new features, following the project's coding standards.\n- Improve documentation by submitting edits or examples to assist other users in using gpt4o.nvim effectively.\n- Share your experiences and best practices in the community forums to foster collaboration and knowledge sharing.\n- Engage with other developers by participating in discussions or providing feedback on proposed changes.\n- Create tutorials or guides that showcase how to leverage gpt4o.nvim for various use cases and programming languages.\n- Test updates and new features thoroughly to ensure they perform as expected and report any issues encountered during testing.\n- Promote gpt4o.nvim in relevant developer communities to increase awareness and user adoption.\n\nWe appreciate your involvement and look forward to your contributions!\n\n## License\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. By contributing to this project, you agree that your contributions will also be licensed under the same MIT License.\n\n## Fun Fact\nThe README above is written with gpt4o.nvim πŸ˜„\n![awesome-face](https://142857.red/book/img/favicon.ico)\n\nUsage showcase:\n```markdown\nMay also instead invoke `:GPT4` to allow gpt4o editing +- 4 lines of code around the cursor.\n```\nAnd I type `:GPT make this +- the real +- symbol` and gpt4o automatically fix that for me 😎\n```markdown\nMay also instead invoke `:GPT4` to allow gpt4o editing Β± 4 lines of code around the cursor.\n```\nSo emojis in the 'Features' section are added by gpt4o too... I can finally uninstall my emoji input method πŸ’” Have fun!\n"}, "c39acb377dc23834e6cee24270c0a2edaf92a52c": {"t": 1785767185.1880612, "n": 8761, "h": "784e8adcb669aaa6", "c": "# gpt4o.nvim\n\nBlazing fast πŸš€ code assistant in NeoVim powered by GPT-4o ✨, offering intelligent code completion and editing to elevate developer productivity.\n\n\n\n## Features\n- Context-aware suggestions 🌍\n- Project files accounted πŸ“„\n- Recent change awareness Β±\n- Real-time code completion ⚑\n- Incremental streaming result ⏳\n- Edit existing code bases πŸ› οΈ\n- Recognizing terminal errors ⚠️\n- Fix your code in place πŸ“\n- Multi-language support 🌐\n- Customizable settings βš™οΈ\n- Lightweight and efficient πŸ’¨\n\n## Installation\nTo install gpt4o.nvim, first make sure you have python3 support on your NeoVim.\n\nYou may do this by running:\n\n```bash\npython3 -m pip install neovim openai tiktoken\n```\n\nSo far, you should see `OK` in the python3 support when running `:checkhealth`.\n\nNow add the following to your `~/.config/nvim/init.vim`, with your plugin manager, [vim-plug](https://github.com/junegunn/vim-plug) for example:\n\n```vim\nPlug 'archibate/gpt4o.nvim'\n```\n\nThen, run `:PlugInstall` (or whatever your plugin manager name it) in NeoVim.\n\nAfter that, run `:UpdateRemotePlugins` to setup our python3 plugin (if your plugin manager didn't setup it automatically).\n\n## LLM providers\nWe are almost done! The only thing remain is to find an LLM provider.\n\n### OpenAI (gpt4o)\nGoto [OpenAI platform](https://platform.openai.com/api-keys), create a new API key. You want to register an OpenAI account if you haven't yet.\n\nThere is a free trial of $5 budget if I recall correctly. Each invocation will consume this budget, and if the free trial has been exhausted, you'll need to set up a payment method (e.g. VISA) to continue using the service.\n\n> The API key will look like this: `sk-xxxxxxxxxxxxx`, do not share it with other people.\n\nThen, append a line to your `~/.bashrc` (`~/.zshrc` for Zsh users):\n```bash\nexport OPENAI_API_KEY=\"sk-xxxxxxxxxxxxx\"\n```\n\nRestart your shell, enter NeoVim and try run `:GPT` and have fun!\n\n> The plugin will invoke `https://api.openai.com` in the background for you for code completion 😎\n\n### DeepSeek (deepseek-coder)\nDeepSeek is a Chinese company that specializes in AI-driven programming tools and code assistance solutions, which is kinda Messiah for Chinese students who could't afford an VISA card. Their slogan is:\n\n> Unravel the mystery of AGI with curiosity. Answer the essential question with long-termism 😎\n\nDeepSeek conveniently provides an OpenAI compatible API at `https://api.deepseek.com`. As you may have already guessed, goto [DeepSeek Platform](https://platform.deepseek.com/api_keys) to obtain an API key. Register an DeepSeek account if you haven't one yet.\n\n> They provide Β₯20 free trial for every new customer too; but make sure you use it within 1 month! Otherwise, it seems to become expired and no longer usable. ☹️\n\nAnyway, append these lines to your `~/.bashrc` (`~/.zshrc` for Zsh users):\n```bash\nexport OPENAI_BASE_URL=\"https://api.deepseek.com\"\nexport OPENAI_API_KEY=\"sk-xxxxxxxxxxxxx\"\n```\n\n> Note that `OPENAI_BASE_URL` is required for overriding the default OpenAI API into an OpenAI-compatible API (`https://api.deepseek.com` in this case).\n\n## Usage\nOnce installed and configured, enter VISUAL mode by selecting the region of code you want to edit. Then invoke gpt4o by typing `:GPT `, where `` is your question or instruction to ask gpt4o to help, for example, `:GPT refactor this code` or `:GPT extract chunk_size into variable`. The assistant will edit the selected section of code to fulfill your instruction, the context of your code around are considered.\n\nIf no `` provided, gpt4o will try to complete and fix possible mistakes in the editing code.\n\nIf you invoke `:GPT` with no selection, i.e. not in VISUAL mode, gpt4o will only edit the current line of code where cursor located at, a single line.\n\n### `:GPT4`\n\nInvoke `:GPT4` instead, allows gpt4o editing Β± 4 lines of code around the cursor, which is usually the small fraction of code you'd like to edit.\n\n> πŸ˜‚ In case you missed my laughing point: GPT4 = GPT4o with Β± 4 lines editing ability πŸ€£πŸŽ‰ Hope you find this fun...\n\nActually, `:GPT4` is just a shortcut for `:-4,+4GPT`, which is Vim's range specifier syntax.\n\n### `:%GPT`\n\nTyping `:%GPT` would allow gpt4o to edit the whole file. Since `%` means 'All lines' in Vim's range specifier syntax.\n\n\n\n\n\n## Key maps\nIt's suggested to map your preferred key bindings to quickly invoke gpt4o commands. For example, you might want to add the following lines to your `init.vim`:\n\n```vim\nnnoremap gp :GPT\nvnoremap gp :GPT\nnnoremap GPT\nvnoremap GPT\ninoremap GPT\n```\n\nor `init.lua`:\n\n```lua\nvim.keymap.set({'v', 'n'}, 'gp', ':GPT')\nvim.keymap.set({'i', 'v', 'n'}, '', 'GPT')\n```\n\nAfterwards you may type `gp` in VISUAL or NORMAL mode to trigger GPT completion for selected range or current line. And `gp@term` if you'd like to attach terminal output. Optionally type `gpoptimize this code` for giving custom instructions.\n\nTogether with [nvim-treesitter-textobjects](https://github.com/nvim-treesitter/nvim-treesitter-textobjects) for example, you may type `vafgp` to let gpt4o edit the current function, and `vacgp` for the current class, and so on.\n\nAnd `` in INSERT mode for triggering code completion in place when you feel lazy 😊.\n\nFor example, you may also map `` to `:-8,+8GPT refactor this code` for refactoring +- 8 line of code.\n\n```lua\nvim.keymap.set({'i', 'n'}, '', '-8,+8GPT refactor this code')\nvim.keymap.set({'v'}, '', 'GPT refactor this code')\n```\n\n## Configuration\nYou can customize the behavior of gpt4o by adding the following to your `init.vim` or `init.lua`:\n\n```vim\n:call GPTSetup({\n \\ \"extra_range_lines\": 4,\n \\ \"api_key\": v:null,\n \\ \"base_url\": v:null,\n \\ \"organization\": v:null,\n \\ \"project\": v:null,\n \\ \"model\": \"auto\",\n \\ \"embedding_model\": \"auto\",\n \\ \"limit_context_tokens\": 10000,\n \\ \"context_chunk_size\": 20,\n \\ \"max_tokens\": v:null,\n \\ \"temperature\": v:null,\n \\ \"frequency_penalty\": v:null,\n \\ \"presence_penalty\": v:null,\n \\ \"include_usage\": v:true,\n \\ \"include_time\": v:true,\n \\ \"timeout\": v:null,\n\\ })\n```\n\n> By default, model is `gpt-4o-mini` for best speed and economy. You may change this by setting, for example, `\"model\": \"gpt-4o\"`.\n\n## Contributing\nContributions are welcome! If you'd like to help improve gpt4o.nvim, please open a pull request or issue on the repository. Here are some ways you can contribute:\n- Report bugs or suggest new features to help us enhance functionality.\n- Submit code contributions to fix bugs or add new features, following the project's coding standards.\n- Improve documentation by submitting edits or examples to assist other users in using gpt4o.nvim effectively.\n- Share your experiences and best practices in the community forums to foster collaboration and knowledge sharing.\n- Engage with other developers by participating in discussions or providing feedback on proposed changes.\n- Create tutorials or guides that showcase how to leverage gpt4o.nvim for various use cases and programming languages.\n- Test updates and new features thoroughly to ensure they perform as expected and report any issues encountered during testing.\n- Promote gpt4o.nvim in relevant developer communities to increase awareness and user adoption.\n\nWe appreciate your involvement and look forward to your contributions!\n\n## License\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. By contributing to this project, you agree that your contributions will also be licensed under the same MIT License.\n\n## Fun Fact\nThe README above is written with gpt4o.nvim πŸ˜„\n![awesome-face](https://142857.red/book/img/favicon.ico)\n\nUsage showcase:\n```markdown\nMay also instead invoke `:GPT4` to allow gpt4o editing +- 4 lines of code around the cursor.\n```\nAnd I type `:GPT make this +- the real +- symbol` and gpt4o automatically fix that for me 😎\n```markdown\nMay also instead invoke `:GPT4` to allow gpt4o editing Β± 4 lines of code around the cursor.\n```\nSo emojis in the 'Features' section are added by gpt4o too... I can finally uninstall my emoji input method πŸ’” Have fun!\n"}, "2a90526e51ad452335050f8942a112d097e2aef0": {"t": 1785767186.5718741, "n": 8683, "h": "81a9d77a64edd9fb", "c": "# gpt4o.nvim\n\nBlazing fast πŸš€ code assistant in NeoVim powered by GPT-4o ✨, offering intelligent code completion and editing to elevate developer productivity.\n\n\n\n## Features\n- Context-aware suggestions 🌍\n- Project files accounted πŸ“„\n- Real-time code completion ⚑\n- Incremental streaming result ⏳\n- Edit existing code bases πŸ› οΈ\n- Recognizing terminal errors ⚠️\n- Fix your code in place πŸ“\n- Multi-language support 🌐\n- Customizable settings βš™οΈ\n- Lightweight and efficient πŸ’¨\n\n## Installation\nTo install gpt4o.nvim, first make sure you have python3 support on your NeoVim.\n\nYou may do this by running:\n\n```bash\npython3 -m pip install neovim openai\n```\n\nSo far, you should see `OK` in the python3 support when running `:checkhealth`.\n\nNow add the following to your `~/.config/nvim/init.vim`, with your plugin manager, [vim-plug](https://github.com/junegunn/vim-plug) for example:\n\n```vim\nPlug 'archibate/gpt4o.nvim'\n```\n\nThen, run `:PlugInstall` (or whatever your plugin manager name it) in NeoVim.\n\nAfter that, run `:UpdateRemotePlugins` to setup our python3 plugin (if your plugin manager didn't setup it automatically).\n\n## LLM providers\nWe are almost done! The only thing remain is to find an LLM provider.\n\n### OpenAI (gpt4o)\nGoto [OpenAI platform](https://platform.openai.com/api-keys), create a new API key. You want to register an OpenAI account if you haven't yet.\n\nThere is a free trial of $5 budget if I recall correctly. Each invocation will consume this budget, and if the free trial has been exhausted, you'll need to set up a payment method (e.g. VISA) to continue using the service.\n\n> The API key will look like this: `sk-xxxxxxxxxxxxx`, do not share it with other people.\n\nThen, append a line to your `~/.bashrc` (`~/.zshrc` for Zsh users):\n```bash\nexport OPENAI_API_KEY=\"sk-xxxxxxxxxxxxx\"\n```\n\nRestart your shell, enter NeoVim and try run `:GPT` and have fun!\n\n> The plugin will invoke `https://api.openai.com` in the background for you for code completion 😎\n\n### DeepSeek (deepseek-coder)\nDeepSeek is a Chinese company that specializes in AI-driven programming tools and code assistance solutions, which is kinda Messiah for Chinese students who could't afford an VISA card. Their slogan is:\n\n> Unravel the mystery of AGI with curiosity. Answer the essential question with long-termism 😎\n\nDeepSeek conveniently provides an OpenAI compatible API at `https://api.deepseek.com`. As you may have already guessed, goto [DeepSeek Platform](https://platform.deepseek.com/api_keys) to obtain an API key. Register an DeepSeek account if you haven't one yet.\n\n> They provide Β₯20 free trial for every new customer too; but make sure you use it within 1 month! Otherwise, it seems to become expired and no longer usable. ☹️\n\nAnyway, append these lines to your `~/.bashrc` (`~/.zshrc` for Zsh users):\n```bash\nexport OPENAI_BASE_URL=\"https://api.deepseek.com\"\nexport OPENAI_API_KEY=\"sk-xxxxxxxxxxxxx\"\n```\n\n> Note that `OPENAI_BASE_URL` is required for overriding the default OpenAI API into an OpenAI-compatible API (`https://api.deepseek.com` in this case).\n\n## Usage\nOnce installed and configured, enter VISUAL mode by selecting the region of code you want to edit. Then invoke gpt4o by typing `:GPT `, where `` is your question or instruction to ask gpt4o to help, for example, `:GPT refactor this code` or `:GPT extract chunk_size into variable`. The assistant will edit the selected section of code to fulfill your instruction, the context of your code around are considered.\n\nIf no `` provided, gpt4o will try to complete and fix possible mistakes in the editing code.\n\nIf you invoke `:GPT` with no selection, i.e. not in VISUAL mode, gpt4o will only edit the current line of code where cursor located at, a single line.\n\n### `:GPT4`\n\nInvoke `:GPT4` instead, allows gpt4o editing Β± 4 lines of code around the cursor, which is usually the small fraction of code you'd like to edit.\n\n> πŸ˜‚ In case you missed my laughing point: GPT4 = GPT4o with Β± 4 lines editing ability πŸ€£πŸŽ‰ Hope you find this fun...\n\nActually, `:GPT4` is just a shortcut for `:-4,+4GPT`, which is Vim's range specifier syntax.\n\n### `:%GPT`\n\nTyping `:%GPT` would allow gpt4o to edit the whole file. Since `%` means 'All lines' in Vim's range specifier syntax.\n\n### `:GPT @term`\n\nInvoke `:GPT @term` or `:GPT4 @term` (with special argument `@term`) will attach the recent terminal output (supports [toggleterm](https://github.com/akinsho/toggleterm.nvim)!), which is typically some annoying error messages, for gpt4o to account into context. This can be useful for example: you run the Python script into an error, then you may switch back to the Python file and type `:%GPT @term` to let gpt4o edit and automatically fix the error for you. πŸŽ‰\n\n## Key maps\nIt's suggested to map your preferred key bindings to quickly invoke gpt4o commands. For example, you might want to add the following lines to your `init.vim`:\n\n```vim\nnnoremap gp :GPT\nvnoremap gp :GPT\nnnoremap GPT\nvnoremap GPT\ninoremap GPT\n```\n\nor `init.lua`:\n\n```lua\nvim.keymap.set({'v', 'n'}, 'gp', ':GPT')\nvim.keymap.set({'i', 'v', 'n'}, '', ':GPT')\n```\n\nAfterwards you may type `gp` in VISUAL or NORMAL mode to trigger GPT completion for selected range or current line. And `gp@term` if you'd like to attach terminal output. Optionally type `gpoptimize this code` for giving custom instructions.\n\nTogether with [nvim-treesitter-textobjects](https://github.com/nvim-treesitter/nvim-treesitter-textobjects) for example, you may type `vafgp` to let gpt4o edit the current function, and `vacgp` for the current class, and so on.\n\nAnd `` in INSERT mode for triggering code completion in place when you feel lazy 😊.\n\nFor example, you may also map `` to `:-8,+8GPT refactor this code` for refactoring +- 8 line of code.\n\n```lua\nvim.keymap.set({'i', 'n'}, '', '-8,+8GPT refactor this code')\nvim.keymap.set({'v'}, '', 'GPT refactor this code')\n```\n\n## Configuration\nYou can customize the behavior of gpt4o by adding the following to your `init.vim` or `init.lua`:\n\n```vim\n:call GPTSetup({\n \\ \"extra_range_lines\": 4,\n \\ \"api_key\": v:null,\n \\ \"base_url\": v:null,\n \\ \"organization\": v:null,\n \\ \"project\": v:null,\n \\ \"model\": \"auto\",\n \\ \"embedding_model\": \"auto\",\n \\ \"limit_context_tokens\": 10000,\n \\ \"context_chunk_size\": 20,\n \\ \"max_tokens\": v:null,\n \\ \"temperature\": v:null,\n \\ \"frequency_penalty\": v:null,\n \\ \"presence_penalty\": v:null,\n \\ \"include_usage\": v:true,\n \\ \"include_time\": v:true,\n \\ \"timeout\": v:null,\n\\ })\n```\n\n> By default, model is `gpt-4o-mini` for best speed and economy. You may change this by setting, for example, `\"model\": \"gpt-4o\"`.\n\n## Contributing\nContributions are welcome! If you'd like to help improve gpt4o.nvim, please open a pull request or issue on the repository. Here are some ways you can contribute:\n- Report bugs or suggest new features to help us enhance functionality.\n- Submit code contributions to fix bugs or add new features, following the project's coding standards.\n- Improve documentation by submitting edits or examples to assist other users in using gpt4o.nvim effectively.\n- Share your experiences and best practices in the community forums to foster collaboration and knowledge sharing.\n- Engage with other developers by participating in discussions or providing feedback on proposed changes.\n- Create tutorials or guides that showcase how to leverage gpt4o.nvim for various use cases and programming languages.\n- Test updates and new features thoroughly to ensure they perform as expected and report any issues encountered during testing.\n- Promote gpt4o.nvim in relevant developer communities to increase awareness and user adoption.\n\nWe appreciate your involvement and look forward to your contributions!\n\n## License\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. By contributing to this project, you agree that your contributions will also be licensed under the same MIT License.\n\n## Fun Fact\nThe README above is written with gpt4o.nvim πŸ˜„\n![awesome-face](https://142857.red/book/img/favicon.ico)\n\nUsage showcase:\n```markdown\nMay also instead invoke `:GPT4` to allow gpt4o editing +- 4 lines of code around the cursor.\n```\nAnd I type `:GPT make this +- the real +- symbol` and gpt4o automatically fix that for me 😎\n```markdown\nMay also instead invoke `:GPT4` to allow gpt4o editing Β± 4 lines of code around the cursor.\n```\nSo emojis in the 'Features' section are added by gpt4o too... I can finally uninstall my emoji input method πŸ’” Have fun!\n"}, "41f50f348fdbcaf9bb870f0ea37fd093426e82f5": {"t": 1785767188.007943, "n": 8681, "h": "c1604248bd9db433", "c": "# gpt4o.nvim\n\nBlazing fast πŸš€ code assistant in NeoVim powered by GPT-4o ✨, offering intelligent code completion and editing to elevate developer productivity.\n\n\n\n## Features\n- Context-aware suggestions 🌍\n- Real-time code completion ⚑\n- Incremental streaming result ⏳\n- Edit existing code bases πŸ› οΈ\n- Recognizing terminal errors ⚠️\n- Fix your code in place πŸ“\n- Multi-language support 🌐\n- Customizable settings βš™οΈ\n- Lightweight and efficient πŸ’¨\n\n## Installation\nTo install gpt4o.nvim, first make sure you have python3 support on your NeoVim.\n\nYou may do this by running:\n\n```bash\npython3 -m pip install neovim openai\n```\n\nSo far, you should see `OK` in the python3 support when running `:checkhealth`.\n\nNow add the following to your `~/.config/nvim/init.vim`, with your plugin manager, [vim-plug](https://github.com/junegunn/vim-plug) for example:\n\n```vim\nPlug 'archibate/gpt4o.nvim'\n```\n\nThen, run `:PlugInstall` (or whatever your plugin manager name it) in NeoVim.\n\nAfter that, run `:UpdateRemotePlugins` to setup our python3 plugin (if your plugin manager didn't setup it automatically).\n\n## LLM providers\nWe are almost done! The only thing remain is to find an LLM provider.\n\n### OpenAI (gpt4o)\nGoto [OpenAI platform](https://platform.openai.com/api-keys), create a new API key. You want to register an OpenAI account if you haven't yet.\n\nThere is a free trial of $5 budget if I recall correctly. Each invocation will consume this budget, and if the free trial has been exhausted, you'll need to set up a payment method (e.g. VISA) to continue using the service.\n\n> The API key will look like this: `sk-xxxxxxxxxxxxx`, do not share it with other people.\n\nThen, append a line to your `~/.bashrc` (`~/.zshrc` for Zsh users):\n```bash\nexport OPENAI_API_KEY=\"sk-xxxxxxxxxxxxx\"\n```\n\nRestart your shell, enter NeoVim and try run `:GPT` and have fun!\n\n> The plugin will invoke `https://api.openai.com` in the background for you for code completion 😎\n\n### DeepSeek (deepseek-coder)\nDeepSeek is a Chinese company that specializes in AI-driven programming tools and code assistance solutions, which is kinda Messiah for Chinese students who could't afford an VISA card. Their slogan is:\n\n> Unravel the mystery of AGI with curiosity. Answer the essential question with long-termism 😎\n\nDeepSeek conveniently provides an OpenAI compatible API at `https://api.deepseek.com`. As you may have already guessed, goto [DeepSeek Platform](https://platform.deepseek.com/api_keys) to obtain an API key. Register an DeepSeek account if you haven't one yet.\n\n> They provide Β₯20 free trial for every new customer too; but make sure you use it within 1 month! Otherwise, it seems to become expired and no longer usable. ☹️\n\nAnyway, append these lines to your `~/.bashrc` (`~/.zshrc` for Zsh users):\n```bash\nexport OPENAI_BASE_URL=\"https://api.deepseek.com\"\nexport OPENAI_API_KEY=\"sk-xxxxxxxxxxxxx\"\n```\n\n> Note that `OPENAI_BASE_URL` is required for overriding the default OpenAI API into an OpenAI-compatible API (`https://api.deepseek.com` in this case).\n\n## Usage\nOnce installed and configured, enter VISUAL mode by selecting the region of code you want to edit. Then invoke gpt4o by typing `:GPT `, where `` is your question or instruction to ask gpt4o to help, for example, `:GPT refactor this code` or `:GPT extract chunk_size into variable`. The assistant will edit the selected section of code to fulfill your instruction, the context of your code around are considered.\n\nIf no `` provided, gpt4o will try to complete and fix possible mistakes in the editing code.\n\nIf you invoke `:GPT` with no selection, i.e. not in VISUAL mode, gpt4o will only edit the current line of code where cursor located at, a single line.\n\n### `:GPT4`\n\nInvoke `:GPT4` instead, allows gpt4o editing Β± 4 lines of code around the cursor, which is usually the small fraction of code you'd like to edit.\n\n> πŸ˜‚ In case you missed my laughing point: GPT4 = GPT4o with Β± 4 lines editing ability πŸ€£πŸŽ‰ Hope you find this fun...\n\nActually, `:GPT4` is just a shortcut for `:-4,+4GPT`, which is Vim's range specifier syntax.\n\n### `:%GPT`\n\nTyping `:%GPT` would allow gpt4o to edit the whole file. Since `%` means 'All lines' in Vim's range specifier syntax.\n\n### `:GPT @term`\n\nInvoke `:GPT @term` or `:GPT4 @term` (with special argument `@term`) will attach the recent terminal output (supports [toggleterm](https://github.com/akinsho/toggleterm.nvim)!), which is typically some annoying error messages, for gpt4o to account into context. This can be useful for example: you run the Python script into an error, then you may switch back to the Python file and type `:%GPT @term` to let gpt4o edit and automatically fix the error for you. πŸŽ‰\n\n## Key maps\nIt's suggested to map your preferred key bindings to quickly invoke gpt4o commands. For example, you might want to add the following lines to your `init.vim`:\n\n```bim\nnnoremap gp :GPT\nvnoremap gp :GPT\nnnoremap GPT\nvnoremap GPT\ninoremap GPT\n```\n\nor `init.lua`:\n\n```lua\nvim.keymap.set({'v', 'n'}, 'gp', ':GPT')\nvim.keymap.set({'i', 'v', 'n'}, '', ':GPT')\n```\n\nAfterwards you may type `gp` in VISUAL or NORMAL mode to trigger GPT completion for selected range or current line. And `gp@term` if you'd like to attach terminal output. Optionally type `gpoptimize this code` for giving custom instructions.\n\nTogether with [nvim-treesitter-textobjects](https://github.com/nvim-treesitter/nvim-treesitter-textobjects) for example, you may type `vafgp` to let gpt4o edit the current function, and `vacgp` for the current class, and so on.\n\nAnd `` in INSERT mode for triggering code completion in place when you feel lazy 😊.\n\nFor example, you may also map `` to `:-8,+8GPT refactor this code` for refactoring +- 8 line of code.\n\n```lua\nvim.keymap.set({'i', 'n'}, '', '-8,+8GPT refactor this code')\nvim.keymap.set({'v'}, '', 'GPT refactor this code')\n```\n\n## Configuration\nYou can customize the behavior of gpt4o by adding the following to your `init.vim` or `init.lua`:\n\n```vim\n:call GPTSetup({\n \\ \"terminal_history_lines\": 100,\n \\ \"look_back_lines\": 150,\n \\ \"look_ahead_lines\": 80,\n \\ \"limit_attach_lines\": 400,\n \\ \"extra_range_lines\": 4,\n \\ \"api_key\": v:null,\n \\ \"base_url\": v:null,\n \\ \"organization\": v:null,\n \\ \"project\": v:null,\n \\ \"model\": \"auto\",\n \\ \"max_tokens\": v:null,\n \\ \"temperature\": v:null,\n \\ \"frequency_penalty\": v:null,\n \\ \"presence_penalty\": v:null,\n \\ \"include_usage\": v:true,\n \\ \"include_time\": v:true,\n \\ \"timeout\": v:null,\n\\ })\n```\n\n> By default, model is `gpt-4o-mini` for best speed and economy. You may change this by setting, for example, `\"model\": \"gpt-4o\"`.\n\n## Contributing\nContributions are welcome! If you'd like to help improve gpt4o.nvim, please open a pull request or issue on the repository. Here are some ways you can contribute:\n- Report bugs or suggest new features to help us enhance functionality.\n- Submit code contributions to fix bugs or add new features, following the project's coding standards.\n- Improve documentation by submitting edits or examples to assist other users in using gpt4o.nvim effectively.\n- Share your experiences and best practices in the community forums to foster collaboration and knowledge sharing.\n- Engage with other developers by participating in discussions or providing feedback on proposed changes.\n- Create tutorials or guides that showcase how to leverage gpt4o.nvim for various use cases and programming languages.\n- Test updates and new features thoroughly to ensure they perform as expected and report any issues encountered during testing.\n- Promote gpt4o.nvim in relevant developer communities to increase awareness and user adoption.\n\nWe appreciate your involvement and look forward to your contributions!\n\n## License\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. By contributing to this project, you agree that your contributions will also be licensed under the same MIT License.\n\n## Fun Fact\nThe README above is written with gpt4o.nvim πŸ˜„\n![awesome-face](https://142857.red/book/img/favicon.ico)\n\nUsage showcase:\n```markdown\nMay also instead invoke `:GPT4` to allow gpt4o editing +- 4 lines of code around the cursor.\n```\nAnd I type `:GPT make this +- the real +- symbol` and gpt4o automatically fix that for me 😎\n```markdown\nMay also instead invoke `:GPT4` to allow gpt4o editing Β± 4 lines of code around the cursor.\n```\nSo emojis in the 'Features' section are added by gpt4o too... I can finally uninstall my emoji input method πŸ’” Have fun!\n"}, "0bc987b0cd607f569b75dbbba1969e2a68fddc90": {"t": 1785767189.308481, "n": 8641, "h": "f8a72bf597653a08", "c": "# gpt4o.nvim\n\nBlazing fast πŸš€ code assistant in NeoVim powered by GPT-4o ✨, offering intelligent code completion and editing to elevate developer productivity.\n\n\n\n## Features\n- Context-aware suggestions 🌍\n- Real-time code completion ⚑\n- Incremental streaming result ⏳\n- Edit existing code bases πŸ› οΈ\n- Recognizing terminal errors ⚠️\n- Fix your code in place πŸ“\n- Multi-language support 🌐\n- Customizable settings βš™οΈ\n- Lightweight and efficient πŸ’¨\n\n## Installation\nTo install gpt4o.nvim, first make sure you have python3 support on your NeoVim.\n\nYou may do this by running:\n\n```bash\npython3 -m pip install neovim openai\n```\n\nSo far, you should see `OK` in the python3 support when running `:checkhealth`.\n\nNow add the following to your `~/.config/nvim/init.vim`, with your plugin manager, [vim-plug](https://github.com/junegunn/vim-plug) for example:\n\n```vim\nPlug 'archibate/gpt4o.nvim'\n```\n\nThen, run `:PlugInstall` (or whatever your plugin manager name it) in NeoVim.\n\n## LLM providers\nWe are almost done! The only thing remain is to find an LLM provider.\n\n### OpenAI (gpt4o)\nGoto [OpenAI platform](https://platform.openai.com/api-keys), create a new API key. You want to register an OpenAI account if you haven't yet.\n\nThere is a free trial of $5 budget if I recall correctly. Each invocation will consume this budget, and if the free trial has been exhausted, you'll need to set up a payment method (e.g. VISA) to continue using the service.\n\n> The API key will look like this: `sk-xxxxxxxxxxxxx`, do not share it with other people.\n\nThen, append a line to your `~/.bashrc` (`~/.zshrc` for Zsh users):\n```bash\nexport OPENAI_API_KEY=\"sk-xxxxxxxxxxxxx\"\n```\n\nRestart your shell, enter NeoVim and try run `:GPT` and have fun!\n\n> The plugin will invoke `https://api.openai.com` in the background for you for code completion 😎\n\nIf it didn't work, try `:UpdateRemotePlugins` and `:GPT` should be available then.\n\n### DeepSeek (deepseek-coder)\nDeepSeek is a Chinese company that specializes in AI-driven programming tools and code assistance solutions, which is kinda Messiah for Chinese students who could't afford an VISA card. Their slogan is:\n\n> Unravel the mystery of AGI with curiosity. Answer the essential question with long-termism 😎\n\nDeepSeek conveniently provides an OpenAI compatible API at `https://api.deepseek.com`. As you may have already guessed, goto [DeepSeek Platform](https://platform.deepseek.com/api_keys) to obtain an API key. Register an DeepSeek account if you haven't one yet.\n\n> They provide Β₯20 free trial for every new customer too; but make sure you use it within 1 month! Otherwise, it seems to become expired and no longer usable. ☹️\n\nAnyway, append these lines to your `~/.bashrc` (`~/.zshrc` for Zsh users):\n```bash\nexport OPENAI_BASE_URL=\"https://api.deepseek.com\"\nexport OPENAI_API_KEY=\"sk-xxxxxxxxxxxxx\"\n```\n\n> Note that `OPENAI_BASE_URL` is required for overriding the default OpenAI API into an OpenAI-compatible API (`https://api.deepseek.com` in this case).\n\n## Usage\nOnce installed and configured, enter VISUAL mode by selecting the region of code you want to edit. Then invoke gpt4o by typing `:GPT `, where `` is your question or instruction to ask gpt4o to help, for example, `:GPT refactor this code` or `:GPT extract chunk_size into variable`. The assistant will edit the selected section of code to fulfill your instruction, the context of your code around are considered.\n\nIf no `` provided, gpt4o will try to complete and fix possible mistakes in the editing code.\n\nIf you invoke `:GPT` with no selection, i.e. not in VISUAL mode, gpt4o will only edit the current line of code where cursor located at, a single line.\n\n### `:GPT4`\n\nInvoke `:GPT4` instead, allows gpt4o editing Β± 4 lines of code around the cursor, which is usually the small fraction of code you'd like to edit.\n\n> πŸ˜‚ In case you missed my laughing point: GPT4 = GPT4o with Β± 4 lines editing ability πŸ€£πŸŽ‰ Hope you find this fun...\n\nActually, `:GPT4` is just a shortcut for `:-4,+4GPT`, which is Vim's range specifier syntax.\n\n### `:%GPT`\n\nTyping `:%GPT` would allow gpt4o to edit the whole file. Since `%` means 'All lines' in Vim's range specifier syntax.\n\n### `:GPT @term`\n\nInvoke `:GPT @term` or `:GPT4 @term` (with special argument `@term`) will attach the recent terminal output (supports [toggleterm](https://github.com/akinsho/toggleterm.nvim)!), which is typically some annoying error messages, for gpt4o to account into context. This can be useful for example: you run the Python script into an error, then you may switch back to the Python file and type `:%GPT @term` to let gpt4o edit and automatically fix the error for you. πŸŽ‰\n\n## Key maps\nIt's suggested to map your preferred key bindings to quickly invoke gpt4o commands. For example, you might want to add the following lines to your `init.vim`:\n\n```bim\nnnoremap gp :GPT\nvnoremap gp :GPT\nnnoremap GPT\nvnoremap GPT\ninoremap GPT\n```\n\nor `init.lua`:\n\n```lua\nvim.keymap.set({'v', 'n'}, 'gp', ':GPT')\nvim.keymap.set({'i', 'v', 'n'}, '', ':GPT')\n```\n\nAfterwards you may type `gp` in VISUAL or NORMAL mode to trigger GPT completion for selected range or current line. And `gp@term` if you'd like to attach terminal output. Optionally type `gpoptimize this code` for giving custom instructions.\n\nTogether with [nvim-treesitter-textobjects](https://github.com/nvim-treesitter/nvim-treesitter-textobjects) for example, you may type `vafgp` to let gpt4o edit the current function, and `vacgp` for the current class, and so on.\n\nAnd `` in INSERT mode for triggering code completion in place when you feel lazy 😊.\n\nFor example, you may also map `` to `:-8,+8GPT refactor this code` for refactoring +- 8 line of code.\n\n```lua\nvim.keymap.set({'i', 'n'}, '', '-8,+8GPT refactor this code')\nvim.keymap.set({'v'}, '', 'GPT refactor this code')\n```\n\n## Configuration\nYou can customize the behavior of gpt4o by adding the following to your `init.vim` or `init.lua`:\n\n```vim\n:call GPTSetup({\n \\ \"terminal_history_lines\": 100,\n \\ \"look_back_lines\": 150,\n \\ \"look_ahead_lines\": 80,\n \\ \"limit_attach_lines\": 400,\n \\ \"extra_range_lines\": 4,\n \\ \"api_key\": v:null,\n \\ \"base_url\": v:null,\n \\ \"organization\": v:null,\n \\ \"project\": v:null,\n \\ \"model\": \"auto\",\n \\ \"max_tokens\": v:null,\n \\ \"temperature\": v:null,\n \\ \"frequency_penalty\": v:null,\n \\ \"presence_penalty\": v:null,\n \\ \"include_usage\": v:true,\n \\ \"include_time\": v:true,\n \\ \"timeout\": v:null,\n\\ })\n```\n\n> By default, model is `gpt-4o-mini` for best speed and economy. You may change this by setting, for example, `\"model\": \"gpt-4o\"`.\n\n## Contributing\nContributions are welcome! If you'd like to help improve gpt4o.nvim, please open a pull request or issue on the repository. Here are some ways you can contribute:\n- Report bugs or suggest new features to help us enhance functionality.\n- Submit code contributions to fix bugs or add new features, following the project's coding standards.\n- Improve documentation by submitting edits or examples to assist other users in using gpt4o.nvim effectively.\n- Share your experiences and best practices in the community forums to foster collaboration and knowledge sharing.\n- Engage with other developers by participating in discussions or providing feedback on proposed changes.\n- Create tutorials or guides that showcase how to leverage gpt4o.nvim for various use cases and programming languages.\n- Test updates and new features thoroughly to ensure they perform as expected and report any issues encountered during testing.\n- Promote gpt4o.nvim in relevant developer communities to increase awareness and user adoption.\n\nWe appreciate your involvement and look forward to your contributions!\n\n## License\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. By contributing to this project, you agree that your contributions will also be licensed under the same MIT License.\n\n## Fun Fact\nThe README above is written with gpt4o.nvim πŸ˜„\n![awesome-face](https://142857.red/book/img/favicon.ico)\n\nUsage showcase:\n```markdown\nMay also instead invoke `:GPT4` to allow gpt4o editing +- 4 lines of code around the cursor.\n```\nAnd I type `:GPT make this +- the real +- symbol` and gpt4o automatically fix that for me 😎\n```markdown\nMay also instead invoke `:GPT4` to allow gpt4o editing Β± 4 lines of code around the cursor.\n```\nSo emojis in the 'Features' section are added by gpt4o too... I can finally uninstall my emoji input method πŸ’” Have fun!\n"}, "8a0f4c0c22819b375b27e28c59dd149a118958d7": {"t": 1785767190.8382099, "n": 7743, "h": "7cc5b11b455da8bd", "c": "# gpt4o.nvim\n\nBlazing fast πŸš€ code assistant in NeoVim powered by GPT-4o 😎✨, offering intelligent code completion and editing to elevate developer productivity.\n\n\n\n## Features\n- Context-aware suggestions 🌍\n- Real-time code completion ⚑\n- Incremental streaming result ⏳\n- Edit existing code bases πŸ› οΈ\n- Recognizing terminal errors ⚠️\n- Fix your code in place πŸ“\n- Multi-language support 🌐\n- Customizable settings βš™οΈ\n- Lightweight and efficient πŸ’¨\n\n## Installation\nTo install gpt4o.nvim, first make sure you have python3 support on your NeoVim.\n\nYou may do this by running:\n\n```bash\npython3 -m pip install neovim openai\n```\n\nSo far, you should see `OK` in the python3 support when running `:checkhealth`.\n\nNow add the following to your `~/.config/nvim/init.vim`, with your plugin manager, [vim-plug](https://github.com/junegunn/vim-plug) for example:\n\n```vim\nPlug 'archibate/gpt4o.nvim'\n```\n\nThen, run `:PlugInstall` (or whatever your plugin manager name it) in NeoVim.\n\n## LLM providers\nWe are almost done! The only thing remain is to find an LLM provider.\n\n### OpenAI (gpt4o)\nGoto [OpenAI platform](https://platform.openai.com/api-keys), create a new API key. You want to register an OpenAI account if you haven't yet.\n\nThere is a free trial of $5 budget if I recall correctly. Each invocation will consume this budget, and if the free trial has been exhausted, you'll need to set up a payment method (e.g. VISA) to continue using the service.\n\n> The API key will look like this: `sk-xxxxxxxxxxxxx`, do not share it with other people.\n\nThen, append a line to your `~/.bashrc` (`~/.zshrc` for Zsh users):\n```bash\nexport OPENAI_API_KEY=\"sk-xxxxxxxxxxxxx\"\n```\n\nRestart your shell, enter NeoVim and try run `:GPT` and have fun!\n\n> The plugin will invoke `https://api.openai.com` in the background for you for code completion 😎\n\n### DeepSeek (deepseek-coder)\nDeepSeek is a Chinese company that specializes in AI-driven programming tools and code assistance solutions, which is kinda Messiah for Chinese students who could't afford an VISA card. Their slogan is:\n\n> Unravel the mystery of AGI with curiosity. Answer the essential question with long-termism 😎\n\nDeepSeek conveniently provides an OpenAI compatible API at `https://api.deepseek.com`. As you may have already guessed, goto [DeepSeek Platform](https://platform.deepseek.com/api_keys) to obtain an API key. Register an DeepSeek account if you haven't one yet.\n\n> They provide Β₯20 free trial for every new customer too; but make sure you use it within 1 month! Otherwise, it seems to become expired and no longer usable. ☹️\n\nAnyway, append these lines to your `~/.bashrc` (`~/.zshrc` for Zsh users):\n```bash\nexport OPENAI_BASE_URL=\"https://api.deepseek.com\"\nexport OPENAI_API_KEY=\"sk-xxxxxxxxxxxxx\"\n```\n\n> Note that `OPENAI_BASE_URL` is required for overriding the default OpenAI API into an OpenAI-compatible API (`https://api.deepseek.com` in this case).\n\n## Usage\nOnce installed and configured, enter VISUAL mode by selecting the region of code you want to edit. Then invoke gpt4o by typing `:GPT `, where `` is your question or instruction to ask gpt4o to help, for example, `:GPT refactor this code` or `:GPT extract chunk_size into variable`. The assistant will edit the selected section of code to fulfill your instruction, the context of your code around are considered.\n\nIf no `` provided, gpt4o will try to complete and fix possible mistakes in the editing code.\n\nIf you invoke `:GPT` with no selection, i.e. not in VISUAL mode, gpt4o will only edit the current line of code where cursor located at, a single line.\n\n### `:GPT4`\n\nInvoke `:GPT4` instead, allows gpt4o editing Β± 4 lines of code around the cursor, which is usually the small fraction of code you'd like to edit.\n\n> πŸ˜‚ In case you missed my laughing point: GPT4 = GPT4o with Β± 4 lines editing ability πŸ€£πŸŽ‰ Hope you find this fun...\n\nActually, `:GPT4` is just a shortcut for `:-4,+4GPT`, which is Vim's range specifier syntax.\n\n### `:%GPT`\n\nTyping `:%GPT` would allow gpt4o to edit the whole file. Since `%` means 'All lines' in Vim's range specifier syntax.\n\n### `:GPT!`\n\nInvoke `:GPT!` or `:GPT4!` (with bang `!`) will attach the recent terminal output (supports [toggleterm](https://github.com/akinsho/toggleterm.nvim)!), which is typically some annoying error messages, for gpt4o to account into context. This can be useful for example: you run the Python script into an error, then you may switch back to the Python file and type `:%GPT!` to let gpt4o edit and automatically fix the error for you. πŸŽ‰\n\n## Key maps\nIt's suggested to map your preferred key bindings to quickly invoke gpt4o commands. For example, you might want to add the following lines to your `init.vim`:\n\n```vim\nnnoremap gp :GPT\nvnoremap gp :GPT\nnnoremap gP :GPT!\nvnoremap gP :GPT!\n```\n\nAfterwards you may type `gp` in VISUAL or NORMAL mode to trigger GPT completion for selected range or current line. And `gP` if you'd like to attach terminal output.\n\nTogether with [nvim-treesitter-textobjects](https://github.com/nvim-treesitter/nvim-treesitter-textobjects) for example, you may type `vafgp` to let gpt4o edit the current function, and `vacgp` for the current class, and so on.\n\n## Configuration\nYou can customize the behavior of gpt4o by adding the following to your `init.vim` or `init.lua`:\n\n```vim\n:call GPTSetup({\n \\ \"terminal_history_lines\": 100,\n \\ \"look_back_lines\": 180,\n \\ \"look_ahead_lines\": 80,\n \\ \"limit_attach_lines\": 400,\n \\ \"extra_range_lines\": 4,\n \\ \"api_key\": v:null,\n \\ \"base_url\": v:null,\n \\ \"organization\": v:null,\n \\ \"project\": v:null,\n \\ \"model\": \"auto\",\n \\ \"max_tokens\": v:null,\n \\ \"temperature\": v:null,\n \\ \"frequency_penalty\": v:null,\n \\ \"presence_penalty\": v:null,\n \\ \"include_usage\": v:true,\n \\ \"include_time\": v:true,\n \\ \"timeout\": v:null,\n\\ })\n```\n\n## Contributing\nContributions are welcome! If you'd like to help improve gpt4o.nvim, please open a pull request or issue on the repository. Here are some ways you can contribute:\n- Report bugs or suggest new features to help us enhance functionality.\n- Submit code contributions to fix bugs or add new features, following the project's coding standards.\n- Improve documentation by submitting edits or examples to assist other users in using gpt4o.nvim effectively.\n- Share your experiences and best practices in the community forums to foster collaboration and knowledge sharing.\n- Engage with other developers by participating in discussions or providing feedback on proposed changes.\n- Create tutorials or guides that showcase how to leverage gpt4o.nvim for various use cases and programming languages.\n- Test updates and new features thoroughly to ensure they perform as expected and report any issues encountered during testing.\n- Promote gpt4o.nvim in relevant developer communities to increase awareness and user adoption.\n\nWe appreciate your involvement and look forward to your contributions!\n\n## License\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. By contributing to this project, you agree that your contributions will also be licensed under the same MIT License.\n\n## Fun Fact\nThe README above is written with gpt4o.nvim πŸ˜„\n![awesome-face](https://142857.red/book/img/favicon.ico)\n\nUsage showcase:\n```markdown\nMay also instead invoke `:GPT4` to allow gpt4o editing +- 4 lines of code around the cursor.\n```\nAnd I type `:GPT make this +- the real +- symbol` and gpt4o automatically fix that for me 😎\n```markdown\nMay also instead invoke `:GPT4` to allow gpt4o editing Β± 4 lines of code around the cursor.\n```\nSo emojis in the 'Features' section are added by gpt4o too... I can finally uninstall my emoji input method πŸ’” Have fun!\n"}, "6c7006bf7e600433abb35c8c63ca2e111ba1f6b8": {"t": 1785767192.4194505, "n": 6303, "h": "641dd8ac180697cd", "c": "# gpt4o.nvim\n\nBlazing fast πŸš€ code assistant in NeoVim powered by πŸ€– GPT-4o, offering intelligent code completion and editing to elevate developer productivity.\n\n## Features\n- Context-aware suggestions 🌍\n- Real-time code completion ⚑\n- Incremental streaming result ⏳\n- Edit existing code bases πŸ› οΈ\n- Recognizing terminal errors ⚠️\n- Fix your code in place πŸ“\n- Multi-language support 🌐\n- Customizable settings βš™οΈ\n- Lightweight and efficient πŸ’¨\n\n## Installation\nTo install gpt4o.nvim, first make sure you have python3 support on your NeoVim.\n\nYou may do this by running:\n\n```bash\npython3 -m pip install neovim openai\n```\n\nSo far so good, you should see `OK` in the python3 support when running `:checkhealth`.\n\nNow add the following to your `~/.config/nvim/init.vim`, with your plugin manager, [vim-plug](https://github.com/junegunn/vim-plug) for example:\n\n```vim\nPlug 'archibate/gpt4o.nvim'\n```\n\nThen, run `:PlugInstall` (or whatever your plugin manager name it) in NeoVim.\n\nWe are almost done! The only thing remain is to find an LLM provider.\n\n## LLM providers\n\n### OpenAI (gpt4o)\nGoto [OpenAI platform](https://platform.openai.com/api-keys), create a new API key. You want to register an OpenAI account if you haven't yet.\n\nThere is a free trial of $5 budget if I recall correctly. Each invocation will consume this budget, and if the free trial has been exhausted, you'll need to set up a payment method (e.g. VISA) to continue using the service.\n\n> The API key will look like this: `sk-xxxxxxxxxxxxx`, do not share it with other people.\n\nThen, append a line to your `~/.bashrc` (`~/.zshrc` for Zsh users):\n```bash\nexport OPENAI_API_KEY=\"sk-xxxxxxxxxxxxx\"\n```\n\nRestart your shell, enter NeoVim and try run `:GPT` and have fun!\n\n> The plugin will invoke `https://api.openai.com` in the background for you for code completion 😎\n\n### DeepSeek (deepseek-coder)\nDeepSeek is a Chinese company that specializes in AI-driven programming tools and code assistance solutions. Their slogan is:\n\n> Unravel the mystery of AGI with curiosity. Answer the essential question with long-termism 😎\n\nDeepSeek conveniently provides an OpenAI compatible API at `https://api.deepseek.com`. As you may have already guessed, goto [DeepSeek Platform](https://platform.deepseek.com/api_keys) to obtain an API key. Register an DeepSeek account if you haven't one yet.\n\n> They provide Β₯20 free trial for every new customer too; but make sure you use it within 1 month! Otherwise, it seems to become expired and no longer usable. ☹️\n\nAnyway, append these lines to your `~/.bashrc` (`~/.zshrc` for Zsh users):\n```bash\nexport OPENAI_BASE_URL=\"https://api.deepseek.com\"\nexport OPENAI_API_KEY=\"sk-xxxxxxxxxxxxx\"\n```\n\n> Note that `OPENAI_BASE_URL` is required for overriding the default OpenAI API into an OpenAI-compatible API (`https://api.deepseek.com` in this case).\n\n## Usage\nOnce installed and configured, enter VISUAL mode by selecting the region of code you want to edit. Then invoke gpt4o by typing `:GPT `, where `` is your question or instruction to ask gpt4o to help, for example, `:GPT refactor this code` or `:GPT extract chunk_size into variable`. The assistant will edit the selected section of code to fulfill your instruction, the context of your code around are considered.\n\nIf no `` provided, gpt4o will try to complete and fix possible mistakes in the editing code.\n\nIf you invoke `:GPT` with no selection, i.e. not in VISUAL mode, gpt4o will only edit the current line of code where cursor located at, a single line.\n\nMay also instead invoke `:GPT4` to allow gpt4o editing Β± 4 lines of code around the cursor, which is usually the small fraction of code you'd like to edit.\n\n> πŸ˜‚ In case you missed my laughing point: GPT4 = GPT4o with Β± 4 lines editing ability πŸ€£πŸŽ‰ Hope you find this fun...\n\n## Configuration\nYou can customize the behavior of gpt4o by adding the following to your `init.vim` or `init.lua`:\n\n```vim\n:GPTSetup {\n \\ \"terminal_history_lines\": 100,\n \\ \"look_back_lines\": 180,\n \\ \"look_ahead_lines\": 80,\n \\ \"limit_attach_lines\": 400,\n \\ \"extra_range_lines\": 4,\n \\ \"api_key\": v:null,\n \\ \"base_url\": v:null,\n \\ \"organization\": v:null,\n \\ \"project\": v:null,\n \\ \"model\": \"auto\",\n \\ \"max_tokens\": v:null,\n \\ \"temperature\": v:null,\n \\ \"frequency_penalty\": v:null,\n \\ \"presence_penalty\": v:null,\n \\ \"include_usage\": v:true,\n \\ \"include_time\": v:true,\n \\ \"timeout\": v:null,\n\\ }\n```\n\n## Contributing\nContributions are welcome! If you'd like to help improve gpt4o.nvim, please open a pull request or issue on the repository. Here are some ways you can contribute:\n- Report bugs or suggest new features to help us enhance functionality.\n- Submit code contributions to fix bugs or add new features, following the project's coding standards.\n- Improve documentation by submitting edits or examples to assist other users in using gpt4o.nvim effectively.\n- Share your experiences and best practices in the community forums to foster collaboration and knowledge sharing.\n- Engage with other developers by participating in discussions or providing feedback on proposed changes.\n- Create tutorials or guides that showcase how to leverage gpt4o.nvim for various use cases and programming languages.\n- Test updates and new features thoroughly to ensure they perform as expected and report any issues encountered during testing.\n- Promote gpt4o.nvim in relevant developer communities to increase awareness and user adoption.\n\nWe appreciate your involvement and look forward to your contributions!\n\n## License\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. By contributing to this project, you agree that your contributions will also be licensed under the same MIT License.\n\n## Fun Fact\nThe README above is written with gpt4o.nvim πŸ˜„\n![awesome-face](https://142857.red/book/img/favicon.ico)\n\nUsage showcase:\n```markdown\nMay also instead invoke `:GPT4` to allow gpt4o editing +- 4 lines of code around the cursor.\n```\nAnd I type `:GPT make this +- the real +- symbol` and gpt4o automatically fix that for me 😎\n```markdown\nMay also instead invoke `:GPT4` to allow gpt4o editing Β± 4 lines of code around the cursor.\n```\nSo emojis in the 'Features' section are added by gpt4o too... I can finally uninstall my emoji input method πŸ’” Have fun!\n"}}}}