Hi all,
Longform post inbound. Thoughts and opinions are my own.
I’ve been thinking a lot about accessibility (to newcomers) in Neovim. Simultaneously, I think there is growing frustration from a portion of the userbase about the state of plugin documentation in the neovim ecosystem. There are several axes on which we can discuss this, so let’s jump right in.
Priors
Plugins usually can have, at most, a single visible readme. This readme, in a way, is the face and entrypoint of the project. It may include images, GIFs, video, in addition to both “Quick Start” and detailed dissections of the various configuration options for a given project. Occasionally, information is also contained in a wiki (often hosted on github) referenced by the readme. In the case of vim, there is often the vimdoc
, which can be semi-automatically generated from the readme via various plugins.
Who is the target userbase for neovim? How does this affect documentation?
Given that there is a single chance to get a readme “right”, it’s important to consider the target audience because this affects how we should think about documentation. I’d like to take a brief digression to describe two types of users:
-
User class A: This user maintains their own vim configuration. They use (neo)vim, find a pattern they repeatedly execute during the course of their work, and install plugins to address this repetition. The user goes on discourse/google/reddit to find references to the “latest” plugins to improve this aspect of their workflow. This user may maintain plugins themselves and is familiar (to some degree) with the internals of vim. This user reads the manual, and perhaps even the source code, when they install a new plugin. This user is easy for plugin authors to write documentation for, because most often plugin authors fall into user class A.
-
User class B: This user may maintain their own vim configuration, or use a larger framework (LunarVim, NvChad, etc.). They may have predominantly used vscode in the past, and be used to a declarative GUI driven configuration schema. Instead of seeking out a particular enhancement to their workflow by adding a particular plugin, they instead are concerned about the holistic experience for their language of choice (How do I configure neovim as a Typescript IDE?). This user often expects tight cohesion across many plugins, and often times wants to slot these plugins into their configuration framework of choice. This user is most likely to view the readme as the final source of truth for configuring their plugin.
Most plugin authors, I would wager find it easier to communicate with User class A, however, as the neovim ecosystem grows, I think it is critical we find ways to communicate better with user class B.
General guidelines for a good readme
Before delving in on how we can better accommodate user class B, lets discuss what makes a good readme. I’m codifying this here for the community’s sake as much as my own, as I’ve historically struggled to write good documentation as well. Here are some things I believe to be true (some may be patently obvious):
- Motivate the plugin immediately – a user should know roughly what your plugin does in the first few lines
- Include a getting started guide after the motivation – a user should be able to get started using your plugin in less than 30 seconds, if possible
- Grammatically correct – this is often hard to do, especially if you are a single plugin developer. ltex-ls, vale, and
:help spell
can be invaluable here - Avoid jargon if possible
- Include the most common pitfalls of your plugin with a small troubleshooting section (if application)
- Link to the wiki, contributing guide, and other useful resources
- Link to a support forum, or matrix room where users can ask questions
- You should have 2-3 potential users proof your readme, try to use your plugin, and provide feedback. Ask on #neovim:matrix.org or here on discourse if you cannot find anyone.
While I think the above are universally true, the following are opinions, which I would love to hear community feedback on:
- The readme should generally not be exhaustive, especially in length. Historically, I’ve found that even having a long readme signals some level of unapproachability that turns off user class B. I would say generally 500 lines is a good limit.
- The readme should be limited in scope to your plugin, integrations with other plugins should be referenced/documented in the wiki.
- Generally, the plugin author is both the best and worst person to write the documentation for a plugin. They are generally the “best” in the sense that they probably have the most comprehensive knowledge of the plugin. They are generally the “worst” in the sense that they are likely A) a proficient vim user, B) capable of reading the source code to understand available options/configuration, and C) not a new user of the plugin, and have a large body of prior knowledge.
An aside on youtube tutorials and blog posts
One thing that I think is especially problematic is the rise of youtube tutorials and blog posts as the primary source of truth for configuring plugin sets.
Unlike a project’s wiki, which is somewhat central and maintained by presumably at least the project’s authors, youtube tutorials grow stale and authors rarely take down and reupload videos with new information. I understand there are practical considerations here, viewership numbers, video monetization, and accessibility (some users do not like reading documentation) are all compelling reasons to prefer video format.
Worse still, blog/reddit posts often contain “snippets” that can be copy/pasted by users. This creates a game of telephone, with snippets often suffering from bitrot. Users rarely, if ever, update old comments.
Catering to user class B in documentation
I think the points I made generally speaking about writing readmes apply here. The readme should be short, to the point, include a quickstart guide, and include various debugging steps and troubleshooting resources. Steps which may seem obvious (installing or requiring system packages, managing system environmental variables, writing small bits of code as configuration) are likely points of failure.
I’ll use the built-in client as an example here.
A worked example: the lspconfig readme
Let’s take the lspconfig readme as it was 1 year ago and go through the issues:
- It’s unclear what LSP is and why users should care about it
- There’s no quickstart guide
- installation is 20+ lines into the readme
- there’s implemenation details/degenerate solutions to overriding server configuration
- the readme is extremely long, because it includes auto-generated details for configuration each language server in the main body
- there’s no recommended configuration (keymaps, avialable functions, etc)
- there’s implementation details (function signature of setup {}) immediatley exposed to the user
Let’s compare this to the current readme. Of course, improvements (as PRs) welcome.
- Both the plugin and the utility of LSP is explained immediately.
- Installation instructions are provided
- A quickstart guide with the exact commands to have a working language server installed are included
- Keybindings/recommended settings are illustrated
- There’s a wiki, with a complete example configuration
- references to external plugins that provide expected user functionality (autocompletion, snippets) are provided in the wiki and linked in the readme
- it’s short
- common debugging steps are included
Provide multiple steps/resources for user debugging
Some things I’ve found helpful:
- providing a minimal vim configuration that self-bootstraps, provides messages that indicate to the user the steps required for debugging
- providing a more full featured configuration that shows how your plugin integrates with other plugins
- providing a containerized environment that allows users to rapidly see what your plugin “should” perform like, eliminating any issues in their configuration. Try, for example,
podman run --rm -it quay.io/nvim-lsp/try.nvim:nightly-c
to run lspconfig in a container using thekickstart.nvim
configuration (open a c file in the repo with neovim). - using github forms that link to support forums for user questions (hence why I created this discourse)
Workflow documentation, or the need for cookbooks
One thing this does not directly address is the need for system level views as to how various plugins work together. Often times user class B wants to understand how various plugins come together to replicate functionality they may be used to, perhaps it includes snippets, autocompletion, auto-imports, a specific UX around diagnostics, their linter of choice, etc.
A new class of documentation, language guides
I think it would be great to create a set of language guides that could receive community contribution, centering around a set of workflows, demonstrating how plugins associated with a language work together.
- The primary difference between this and reddit/youtube guides would be that I would like to find a way to loop in plugin authors, and have them directly contribute/update the portions of the guide that pertain to their plugin.
- I would love to ship these along with containerized test environments like try.nvim that include the neovim configuration along with the language tooling and an example repo of choice.
- I created a new github organization for this purpose: nvim-language-guides · GitHub, reach out to me if you’re interested in the guide/providing a test container to go along with it.
What can you do about it?
I think now would be a great time to pick your favorite neovim plugin, reach out to the author asking if they would welcome documentation updates, and then file a PR suggesting some changes.
More projects should start offering “cookbooks” in the wiki which collate user experience into digestible snippets. It’s important to keep these up to date, make sure users are actively involved beyond the project maintainer, and reach out to plugins for which you provide integrations such that those contributors might also update your respective wiki entries.
Finally, I think it would be great to push forward on these language specific guides in a community maintained organization. I’m happy to organize this. These should, of course, be kept in sync with any cookbooks, standardized/edited for quality to some degree, and should be constructed in collaboration with plugin authors.
Closing
Thanks for listening, happy to discuss what we can do to improve the documentation situation in the neovim ecosystem. Please remember to be kind to the people whose software you depend on, especially keeping in mind that many do not speak the same language that you do, so be cognizant of that when criticizing the quality of documentation.