aboutsummaryrefslogtreecommitdiffstats
path: root/spellcheck.lua
diff options
context:
space:
mode:
Diffstat (limited to 'spellcheck.lua')
-rw-r--r--spellcheck.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/spellcheck.lua b/spellcheck.lua
index 21f4344..9f57c26 100644
--- a/spellcheck.lua
+++ b/spellcheck.lua
@@ -74,6 +74,19 @@ vis:map(vis.modes.NORMAL, "<C-w>d", function(keys)
return 0
end, "Disable spellchecking in the current window")
+-- toggle spellchecking on <F7>
+-- <F7> is used by some word processors (LibreOffice) for spellchecking
+-- Thanks to @leorosa for the hint.
+vis:map(vis.modes.NORMAL, "<F7>", function(keys)
+ if not spellcheck.enabled[vis.win] then
+ spellcheck.enabled[vis.win] = true
+ else
+ spellcheck.enabled[vis.win] = nil
+ vis.win:draw()
+ end
+ return 0
+end, "Toggle spellchecking in the current window")
+
vis:map(vis.modes.NORMAL, "<C-w>w", function(keys)
local win = vis.win
local file = win.file