From f12ae20f05da4f6dbd638ead4e1139ba004a827c Mon Sep 17 00:00:00 2001 From: Yan Lin Date: Wed, 30 Jul 2025 18:57:50 +0200 Subject: [PATCH] Add dictionary autocompletion to neovim without spell checking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add cmp-dictionary plugin to extraPlugins for English word completion - Configure dictionary source in nvim-cmp with keyword_length = 2 - Set up dictionary paths pointing to /usr/share/dict/words - Enable case-insensitive matching for better user experience - Completion triggers after 2+ characters for performance optimization This provides English word autocompletion without enabling vim's spell checking features, keeping the interface clean without visual indicators. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- modules/nvim.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/nvim.nix b/modules/nvim.nix index 1f0e7cf..9d5aea1 100644 --- a/modules/nvim.nix +++ b/modules/nvim.nix @@ -97,6 +97,7 @@ sources = [ { name = "buffer"; } # Words from open buffers { name = "path"; } # File system paths + { name = "dictionary"; keyword_length = 2; } # English dictionary words ]; mapping = { @@ -113,6 +114,7 @@ # Extra plugins that don't have dedicated modules extraPlugins = with pkgs.vimPlugins; [ vim-fugitive + cmp-dictionary ]; # Keymaps @@ -221,6 +223,13 @@ }, }) + -- Dictionary completion setup + require("cmp_dictionary").setup({ + paths = { "/usr/share/dict/words" }, -- Standard dictionary path + exact_length = 2, -- Minimum length before completion + first_case_insensitive = true, -- Case insensitive matching + }) + -- Unicode-safe file operations for macOS function open_file_with_system_app() local filepath = vim.fn.expand('%:p')