nixos/pkgsets/emacs/flyspell.nix

34 lines
971 B
Nix
Raw Normal View History

2023-09-11 20:23:04 +02:00
{
config,
lib,
...
}:
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)
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)
))
'';
};
2023-09-11 20:23:04 +02:00
}