2023-09-11 20:23:04 +02:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
2019-11-17 23:13:50 +01:00
|
|
|
with lib;
|
2023-09-11 20:23:04 +02:00
|
|
|
mkIf (elem "emacs::flyspell" config.machine.pkgs) {
|
|
|
|
programs.emacs.init.usePackage.flyspell = {
|
|
|
|
enable = true;
|
|
|
|
package = epkgs: null;
|
|
|
|
diminish = ["flyspell-mode"];
|
|
|
|
command = ["flyspell-mode" "flyspell-prog-mode"];
|
|
|
|
hook = [];
|
|
|
|
bind = {
|
|
|
|
"C-M-<tab>" = "flyspell-switch-dictionary";
|
|
|
|
"C-c f" = "ispell-word";
|
|
|
|
};
|
|
|
|
config = ''
|
|
|
|
;; Make flyspell less verbose and disable annoying keybind
|
|
|
|
(setq flyspell-issue-message-flag nil
|
|
|
|
flyspell-issue-welcome-flag nil
|
|
|
|
flyspell-use-meta-tab nil)
|
2019-11-17 23:13:50 +01:00
|
|
|
|
2023-09-11 20:23:04 +02:00
|
|
|
(defun flyspell-switch-dictionary ()
|
|
|
|
(interactive)
|
|
|
|
(let* ((dic ispell-current-dictionary)
|
|
|
|
(change (if (string= dic "deutsch8") "english" "deutsch8")))
|
|
|
|
(ispell-change-dictionary change)
|
|
|
|
(message "Dictionary switched to %s" change)
|
|
|
|
))
|
|
|
|
'';
|
2019-11-11 18:41:30 +01:00
|
|
|
};
|
2023-09-11 20:23:04 +02:00
|
|
|
}
|