summaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lua/conf/binds.lua18
1 files changed, 8 insertions, 10 deletions
diff --git a/lua/conf/binds.lua b/lua/conf/binds.lua
index 2031852..34ad3ee 100644
--- a/lua/conf/binds.lua
+++ b/lua/conf/binds.lua
@@ -41,20 +41,18 @@ map('n', ']]', '<cmd>tabn<CR>')
-- good spell suggestion ui
-- (stolen from https://github.com/neovim/neovim/pull/25833)
-local spell_on_choice = vim.schedule_wrap(function(_, idx)
- if type(idx) == 'number' then
- vim.cmd('normal! ' .. idx .. 'z=')
- end
-end)
+vim.keymap.set('n', 'z=', function()
+ local spell_on_choice = vim.schedule_wrap(function(_, idx)
+ if type(idx) == 'number' then
+ vim.cmd('normal! '..idx..'z=')
+ end
+ end)
-local spellsuggest_select = function()
if vim.v.count > 0 then
spell_on_choice(nil, vim.v.count)
return
end
local cword = vim.fn.expand('<cword>')
- local prompt = 'Change ' .. vim.inspect(cword) .. ' to:'
+ local prompt = 'Change '..vim.inspect(cword)..' to:'
vim.ui.select(vim.fn.spellsuggest(cword, vim.o.lines), { prompt = prompt }, spell_on_choice)
-end
-
-vim.keymap.set('n', 'z=', spellsuggest_select, { desc = 'Shows spelling suggestions' })
+end, { desc = 'Shows spelling suggestions' })