GitXplorerGitXplorer
d

old-kak-spell

public
7 stars
0 forks
3 issues

Commits

List of commits on branch main.
Unverified
51e66ebc259d1e35b4731130c301739e5b153fef

Update README.md

ddmerejkowsky committed 4 years ago
Unverified
75fe1a17240146525eb422af71d9045be5a668df

Simplify kak-spell kak script

ddmerejkowsky committed 4 years ago
Unverified
09d176dd72dd5fe32835f1d7ec73d15f2d714ef9

cosmetic change

ddmerejkowsky committed 4 years ago
Unverified
325a318cddaa4263a7e49db86c8a0b8271949fbc

Bump to 0.3.1

ddmerejkowsky committed 4 years ago
Unverified
f7e8c1584bd899bebde50bb5d2e0a058440d7743

Add a nice help message when using kak-spell-list

ddmerejkowsky committed 4 years ago
Unverified
e90cebbf1acaca39ddeb261368b9c4053e06327d

tbump: add github_url

ddmerejkowsky committed 4 years ago

README

The README file for this repository.

kak-spell

PyEnchant wrapper for Kakoune.

Deprecation

This is an old version in Python. I'm now using a more advanced (and faster!) version written in Rust with more features.

Check out: https://git.sr.ht/~dmerej/kak-spell instead

Installation

  1. Install the C Enchant library, and the required dictionaries. See PyEnchant documentation for details.

  2. Install the kak-spell script, for instance with pipx:

pipx install kak-spell
  1. Install plug.kak and add the following lines in your kakrc:
plug "dmerejkowsky/kak-spell"
  1. (optional): declare a user mode and some mappings:
plug "dmerejkowsky/kak-spell" config %{
  declare-user-mode kak-spell
  map global user s ': enter-user-mode -lock kak-spell<ret>' -docstring 'enter spell user mode'
  map global kak-spell a ': kak-spell-add<ret>' -docstring 'add the selection to the user dict'
  map global kak-spell d ': kak-spell-disable<ret>' -docstring 'clear spelling highlighters'
  map global kak-spell e ': kak-spell-enable en_US<ret> :kak-spell <ret>' -docstring 'enable spell check in English'
  map global kak-spell f ': kak-spell-enable fr_FR<ret> :kak-spell <ret>' -docstring 'run spell check in French'
  map global kak-spell l ': kak-spell-list <ret>' -docstring 'list spelling errors in a buffer'
  map global kak-spell n ': kak-spell-next<ret>' -docstring 'go to next spell error'
  map global kak-spell p ': kak-spell-previous<ret>' -docstring 'go to next spell error'
  map global kak-spell r ': kak-spell-replace<ret>' -docstring 'suggest a list of replacements'
  map global kak-spell x ': kak-spell-remove<ret>' -docstring 'remove the selection from the user dict'
}

Note that kak-spell-enable does several things:

  • Set a buffer scoped option kak_spell_lang that is used by other commands
  • Add a highlighter so that spelling errors are colored with the Error face
  • Adds a BufWritePost hook to spell check the buffer each time it gets written

The command kak-spell-disable undoes all of the above.

For now, there's no option to disable the hook, or to have it run in response to other events. Please open an issue if this bothers you.

Discuss

You can discuss features of this plugin on discuss.kakoune.com.

I'd like to thank all the people who contributed code and ideas to make usage of this plugin easier.