Neovim for Beginners — User Interface
Neovim provides the Lua UI APIs (:h lua-ui
) for user interaction. However, the default interface is very primitive. In this article, we will explore the Lua UI APIs and also the plugins to enhance the user interface.
This article is part of the Neovim for Beginners series.
The Neovim configuration files can be found in this repository.
The Basics
In Neovim we have these Lua APIs.
vim.ui.input
(:h vim.ui.input()
) to prompt the user for input. This is similar to the Vimscriptinput
(:h input()
) function.vim.ui.select
(:h vim.ui.select()
) to prompt the user to pick a single item from a collection of entries. This is similar to the Vimscriptconfirm
(:h confirm()
) function.
vim.ui.input
Let’s start with the vim.ui.input
API.
- We create the
lua/utils/ui.lua
file with the following code snippet.