{ lib, config, pkgs, ... }: lib.optionalAttrs (lib.elem "nvim::lsp::ltex" config.machine.pkgs) { ltex = { cmd = [ "${pkgs.ltex-ls}/bin/ltex-ls" ]; settings = { ltex = { language = "de-DE"; }; }; on_attach = _: # lua '' function(client, bufnr) vim.api.nvim_create_user_command( "LtexLang", "lua SetLtexLang()", { nargs = 1, desc = "Set ltex-ls language" } ) end''; }; }