This plugin installs and initializes an
Academic English dictionary for Neovim. It
configures the dictionary as the en-academic language, automatically adding it
to Neovim's spelllang table.
- Generates Neovim compatible
.spldictionary format from the Acamedic hunspell dictionary. - Optional: Automatically re-generates
.splbinaries when needed. - Optional: Supports directly downloading and building dictionary from Acamedic source (requires dependencies).
You can install academic with your favourite plugin manager. For example, with
lazy.nvim:
{
"ficcdaf/academic.nvim",
-- recommended: rebuild on plugin update
build = ":AcademicBuild"
-- ONLY uncomment this if you want to change the defaults!
-- you do NOT need to set opts for Academic to load!
-- opts = {
-- -- change settings here
-- }
}academic.nvim loads automatically. There is no need to call setup unless you
wish to change the default options. The build option of the lazy.nvim plugin
spec is recommended -- otherwise, you will need to run :AcademicBuild when you
first install the plugin, and on subsequent updates.
Configuration is entirely optional. You can pass a table to the setup
function, or set the opts field in the Lazy plugin spec.
The following options are available:
-- default settings
{
auto_install = true,
auto_rebuild = false,
}Recommended: true
The auto_install feature will check the Neovim spellfile directory for an
existing Academic spellfile. If none is found, it will automatically generate
and install the spellfile.
It is recommended to keep this setting on because it has a negligible effect
on startup performance, and eliminates the need to manually run the
AcademicBuild command when installing the plugin for the first time.
Recommended: false
The auto_rebuild feature checks the creation date of the compiled Academic
spellfile against the source dictionary in the plugin source. If outdated, the
spellfile is automatically re-built using AcademicBuild.
It is recommended to keep this setting off because it may significantly
increase startup time on some systems. I was able to save around 1 ms on my
machine by disabling the setting.
If you're using lazy.nvim you can leverage the build option to automatically
rebuild the spellfile only when the plugin is updated. This is the recommended
approach, please see the installation section.
If you wish to build your dictionary directly from Acamedic with the update
function, you must have bash, curl, and unmunch available on your $PATH.
unmunch is installed alongside hunspell on most systems. This functionality
is optional. A reasonably up-to-date version of the dictionary is included
with this plugin.
The following commands are provided:
| User Command | Lua API | Requires Dependencies |
|---|---|---|
AcademicUpdate |
require("academic").update() |
Yes |
AcademicBuild |
require("academic").generate_spellfile() |
No |