1
0
Fork 0

nvim: use easier keys for spell

This commit is contained in:
tastytea 2022-12-31 23:41:43 +01:00
parent bef34649f5
commit df1f8ece8f
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
1 changed files with 9 additions and 2 deletions

View File

@ -91,7 +91,7 @@ map('v', '<Leader>f', 'gq', 'Reformat text')
map('n', '<C-D>', ':bdelete<CR>', 'Close buffer')
-- use ui.select for spelling suggestions so dressing can make it look nice
map('n', 'z=', function()
local function spellsugg_select()
local word = vim.fn.expand('<cword>')
local suggestions = vim.fn.spellsuggest(word)
vim.ui.select(suggestions, {}, vim.schedule_wrap(function(selected)
@ -102,4 +102,11 @@ map('n', 'z=', function()
'n', true)
end
end))
end)
end
map('n', 'z=', spellsugg_select)
-- use easier keys for spell
map('n', '<F17>', '[s', 'Previous misspelled word') -- <S-F5>
map('n', '<F18>', ']s', 'Next misspelled word') -- <S-F6>
map('n', '<F19>', spellsugg_select, 'Spelling suggestions') -- <S-F7>