This repository has been archived on 2023-10-17. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/.config/vis/plugins/vis-spellcheck
diego castillo salazar e9e2f75fa2 Uploading config dotfiles 2022-11-01 13:12:15 -05:00
..
tools Uploading config dotfiles 2022-11-01 13:12:15 -05:00
.editorconfig Uploading config dotfiles 2022-11-01 13:12:15 -05:00
.gitlab-ci.yml Uploading config dotfiles 2022-11-01 13:12:15 -05:00
.lua-format Uploading config dotfiles 2022-11-01 13:12:15 -05:00
LICENSE Uploading config dotfiles 2022-11-01 13:12:15 -05:00
Makefile Uploading config dotfiles 2022-11-01 13:12:15 -05:00
Readme.md Uploading config dotfiles 2022-11-01 13:12:15 -05:00
init.lua Uploading config dotfiles 2022-11-01 13:12:15 -05:00
spellcheck.lua Uploading config dotfiles 2022-11-01 13:12:15 -05:00

Readme.md

vis-spellcheck

A spellchecking lua plugin for the vis editor.

Installation

  1. Download spellcheck.lua or clone this repository into your plugin directory
  2. Load the plugin in your visrc.lua with require('plugins/vis-spellcheck')

Usage

  • To enable highlighting of misspelled words press <Ctrl-w>e in normal mode.
  • To disable highlighting press <Ctrl-w>d in normal mode.
  • To toggle highlighting press <F7> in normal mode.
  • To correct the word under the cursor press <Ctrl+w>w in normal mode.
  • To ignore the word under the cursor press <Ctrl+w>i in normal mode.

Configuration

The module table returned from require(...) has some configuration options:

  • cmd: cmd that is passed to popen() and must return word corrections in Ispell format.
    • default: enchant -d %s
  • list_cmd: cmd that is passed to popen() and must output a list of misspelled words.
    • default: enchant -l -d %s
  • default_lang: The name of the used dictionary if the opened file does not specify one. The selected language is inserted in the cmd-strings at %s.
    • default: $LANG or en_US
  • typo_style: The style string with which misspellings should be highlighted when using the full viewport method
    • default: fore:red
  • check_tokens: A table mapping all token names we consider for spellchecking to true
    • default: {[vis.lexers.STRING]=true, [vis.lexers.COMMENT]=true, [vis.lexers.DEFAULT]=true}
  • disable_syntax_awareness: Disable the syntax aware spellchecking and use always full viewport
    • default: false

A possible configuration could look like this:

spellcheck = require(...)
spellcheck.cmd = "aspell -l %s -a"
spellcheck.list_cmd = "aspell list -l %s -a"
spellcheck.default_lang = "de_DE"

Changing language during runtime:

:set spelllang en_US