NEW: dictionary based completions

This commit is contained in:
Jean-Claude 2022-06-13 14:01:09 +02:00
parent 1cc09f5af5
commit 0f1869af26
Signed by: jeanclaude
GPG Key ID: 8A300F57CBB9F63E
7 changed files with 84715 additions and 3 deletions

View File

@ -23,13 +23,21 @@ packer.startup(function(use)
'onsails/lspkind-nvim',
--'onsails/lspkind-nvim',
--'hrsh7th/cmp-nvim-lsp-signature-help',
'f3fora/cmp-spell' -- TODO check if needed
'f3fora/cmp-spell',
'uga-rosa/cmp-dictionary',
},
config = function()
require('user.plugins.cmp')
end
}
use {
'uga-rosa/cmp-dictionary',
config = function ()
require('user.plugins.cmp-dictionary')
end
}
use {
'neovim/nvim-lspconfig',
requires = {

View File

@ -0,0 +1,12 @@
local cmp_dict = require('cmp_dictionary')
cmp_dict.setup({
dic = {
-- TODO set based on langq
['*'] = {'/home/jeanclaude/.local/share/dict/de_CH.dict'},
--spelllang = {
-- --en = '/home/jeanclaude/.local/share/dict/en_GB.dict'
-- de = '/home/jeanclaude/.local/share/dict/de_CH.dict'
--}
}
})

View File

@ -25,7 +25,8 @@ cmp.setup({
luasnip = '[Snip]',
path = '[Path]',
buffer = '[Buffer]',
spell = '[Dict]',
spell = '[Spell]',
dictionary = '[Dict]',
},
},
},
@ -66,6 +67,7 @@ cmp.setup({
{ name = 'luasnip' },
{ name = 'path' },
{ name = 'buffer' },
{ name = 'dictionary' },
{ name = 'spell' },
},
experimental = {

View File

@ -30,7 +30,7 @@ local function config(_config)
buf_keymap(bufnr, 'n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>')
buf_keymap(bufnr, 'n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>')
buf_keymap(bufnr, 'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>')
-- buf_keymap(bufnr, 'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>')
buf_keymap(bufnr, 'n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>')
buf_keymap(bufnr, 'n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>')
buf_keymap(bufnr, 'n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>')

3
language/dict/README.md Normal file
View File

@ -0,0 +1,3 @@
# Dictionaries
Based on aspell generated with: `aspell -d <lang> dump master | aspell -l <lang> expand > my.dict`

84684
language/dict/de_CH.dict Normal file

File diff suppressed because it is too large Load Diff

3
language/dict/genDict.sh Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/sh
aspell -d de_CH dump master | aspell -l de_CH expand | sed --expression='s/ß/ss/g' > de_CH.dict