diff options
author | Florian Fischer <muhq@muhq.space> | 2017-05-14 18:01:32 +0200 |
---|---|---|
committer | Florian Fischer <muhq@muhq.space> | 2017-05-14 18:01:32 +0200 |
commit | 629088aeb9b38d6710995e8abd51df7d4706b025 (patch) | |
tree | b6d9f8dacc775d1e2965355fc22b2142104e8b78 /spellcheck.lua | |
parent | 1d1dc0226e154110bec8d53d466de6e6b772708b (diff) | |
download | vis-spellcheck-629088aeb9b38d6710995e8abd51df7d4706b025.tar.gz |
add aspell and hunspell as default spellcheckers
Diffstat (limited to 'spellcheck.lua')
-rw-r--r-- | spellcheck.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spellcheck.lua b/spellcheck.lua index 4e0b13f..71023de 100644 --- a/spellcheck.lua +++ b/spellcheck.lua @@ -4,7 +4,15 @@ local module = {} module.lang = os.getenv("LANG"):sub(0,5) or "en_US" -- TODO use more spellcheckers (aspell/hunspell) -module.cmd = "enchant -d %s -a" +if os.execute("type enchant &>/dev/null") then + module.cmd = "enchant -d %s -a" +elseif os.execute("type aspell &>/dev/null") then + module.cmd = "aspell -l %s -a" +elseif os.execute("type hunspell &>/dev/null") then + module.cmd = "hunspell -d %s" +else + return nil +end function spellcheck(file, range) local cmd = module.cmd:format(module.lang) |