Skip to content

Commit

Permalink
feat: try cmp_dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
louib-bitgo committed May 3, 2024
1 parent baa1f5e commit 659f22d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
4 changes: 3 additions & 1 deletion flakes/nvim/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
inherit taplo-lsp;

inherit ripgrep;
inherit wordnet;
};
# FIXME this should probably be ported over to nixpkgs
copilotchat-nvim = pkgs.vimUtils.buildVimPlugin {
Expand Down Expand Up @@ -83,8 +84,9 @@
cmp-buffer
cmp-path
cmp-cmdline
cmp-dictionary

# Required by copilotchat-nvim
# Required by copilotchat-nvim, cmp-dictionary, and potentially other plugins.
plenary-nvim

copilotchat-nvim
Expand Down
14 changes: 14 additions & 0 deletions flakes/nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,10 @@ local function configure_auto_completion()
['<CR>'] = cmp.mapping.confirm({ select = false }),
}),
sources = cmp.config.sources({
{
name = 'dictionary',
keyword_length = 2,
},
{ name = 'nvim_lsp' },
{ name = 'vsnip' },
{ name = 'copilot', group_index = 2 },
Expand Down Expand Up @@ -516,6 +520,16 @@ local function configure_auto_completion()

-- vim.o.completeopt = 'menu,menuone,noselect'
vim.o.completeopt = 'menu,menuone,noselect,preview'

require('cmp_dictionary').setup({
paths = { '/usr/share/dict/words' },
exact_length = 2,
first_case_insensitive = true,
document = {
enable = true,
command = { 'wn', '${label}', '-over' },
},
})
end

local function configure_status_bar()
Expand Down

0 comments on commit 659f22d

Please sign in to comment.