Everyone uses AI these days, with Claude, Copilot, Gemini, etc. Personally, I don't like it when AI is shoved down my throat in my editor. VS Code is slowly becoming bloated with AI, and I can't stand it when my cursor keeps jumping because of inline CoPilot suggestions.
However, as a programmer, it is useful to get help from AI. That's why I've added the OpenCode plugin to my Neovim config, so I can call it up whenever I want, because help from AI works best for me when the scope is small and focused, with me still in control. I write the code and use AI when I need some help or want to learn. The opencode.nvim plugin from Nick van Dyke is a nice solution for me by providing the context and connection between Neovim and OpenCode.
Instead of being fully integrated into the editor, opencode.nvim uses OpenCode's existing TUI and API through standard Neovim interfaces. This means I can keep using my own Neovim setup and workflow, with auto-suggestions from the LSP by default and OpenCode available with a key combination.
With my setup, I can easily select a block of Python code using the key combination vaf (select outer function). And with the installed nvim-treesitter-textobjects plugin, Neovim understands the structure of Python functions, so I can select the entire function and then ask OpenCode questions about the code with Ctrl+x.
In the end, have fun with Neovim
In the end, by creating my own config from scratch, Neovim becomes my own tool, built around exactly the way I like to work. An extension of my workflow. Once the keymaps became muscle memory and everything started to feel natural, I stopped thinking about the editor and could just focus on the code. It takes some time to get there, but that's also part of the fun for me.