https://github.com/ficcdaf/academic.nvim
Academic English dictionary for Neovim
https://github.com/ficcdaf/academic.nvim
neovim-plugin
Last synced: 3 months ago
JSON representation
Academic English dictionary for Neovim
- Host: GitHub
- URL: https://github.com/ficcdaf/academic.nvim
- Owner: ficcdaf
- License: mit
- Created: 2024-12-19T21:45:25.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-01-30T01:49:16.000Z (6 months ago)
- Last Synced: 2025-03-23T23:14:29.673Z (4 months ago)
- Topics: neovim-plugin
- Language: Lua
- Homepage:
- Size: 70.3 KB
- Stars: 16
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- my-neovim-pluginlist - ficcdaf/academic.nvim - commit/ficcdaf/academic.nvim)  (Other Standard Feature Enhancement / Dictionary)
README
# academic.nvim
This plugin installs and initializes an
[Academic English](https://github.com/emareg/acamedic) dictionary for Neovim. It
configures the dictionary as the `en-academic` language, automatically adding it
to Neovim's `spelllang` table.# Features
- Generates Neovim compatible `.spl` dictionary format from the
[Acamedic](https://github.com/emareg/acamedic) hunspell dictionary.
- Optional: Automatically re-generates `.spl` binaries when needed.
- Optional: Supports directly downloading and building dictionary from Acamedic
source (requires [dependencies](#optional-dependencies)).# Installation
You can install `academic` with your favourite plugin manager. For example, with
`lazy.nvim`:```lua
{
"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
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:
```lua
-- default settings
{
auto_install = true,
auto_rebuild = false,
}
```## Auto Install
> 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.## Auto Rebuild
> 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](#installation) section.## Optional Dependencies
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.**# Usage
The following commands are provided:
| User Command | Lua API | Requires Dependencies |
| ---------------- | ------------------------------------------ | --------------------- |
| `AcademicUpdate` | `require("academic").update()` | Yes |
| `AcademicBuild` | `require("academic").generate_spellfile()` | No |