Neovim 101 — Coding Assistant
In this article, we will integrate the
so command-line tool, which is a terminal interface for Stack Overflow written in Rust.
This article is part of the Neovim 101 series.
The Neovim configuration files are available in this repository.
As developers, we need to learn and code constantly. As Neovim users we want to do it all from within Neovim.
so — A Terminal Interface for Stack Overflow
so utility provides an interface to the Stack Exchange network. Using this command-line tool, we can simultaneously search any number of sites in the Stack Exchange network.
so is developed in Rust, and available for Linux, Windows, and macOS.
Integration using a Lua Module
lua/utils/cht.lua file, we add the functions to launch this tool.
- We use the
vim.ui.inputAPI to request input.
- We create a vertical split and open a terminal.
- From the terminal, we launch the
- We set the file type of the buffer to
after/plugin/autocmds.lua file, we create an auto command to make it easy to exit the cheatsheet window (line 22) by pressing