From 564a0136e1581b4aa386ed3485ef2e1dbf0c6991 Mon Sep 17 00:00:00 2001 From: Yan Lin Date: Fri, 24 Oct 2025 10:07:40 +0200 Subject: [PATCH] add auto complete dictionary to nixos hosts --- modules/nvim.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/nvim.nix b/modules/nvim.nix index 98372ce..f4b7803 100644 --- a/modules/nvim.nix +++ b/modules/nvim.nix @@ -13,7 +13,8 @@ in defaultEditor = true; # Ensure jupytext is available for the jupytext.nvim plugin - extraPackages = [ pythonWithJupytext ]; + # scowl provides English word lists for completion on NixOS + extraPackages = [ pythonWithJupytext pkgs.scowl ]; # Global settings globals.mapleader = " "; @@ -296,7 +297,7 @@ in }, }) - -- Dictionary completion setup (macOS only) + -- Dictionary completion setup ${lib.optionalString pkgs.stdenv.isDarwin '' require("cmp_dictionary").setup({ paths = { "/usr/share/dict/words" }, -- Standard dictionary path on macOS @@ -304,6 +305,13 @@ in first_case_insensitive = true, -- Case insensitive matching }) ''} + ${lib.optionalString (!pkgs.stdenv.isDarwin) '' + require("cmp_dictionary").setup({ + paths = { "${pkgs.scowl}/share/dict/wamerican.txt" }, -- Nix-provided dictionary on NixOS + exact_length = 2, -- Minimum length before completion + first_case_insensitive = true, -- Case insensitive matching + }) + ''} -- Jupytext setup for Jupyter notebook viewing require("jupytext").setup({