2019-11-17 23:13:50 +01:00
|
|
|
{ config, lib, ... }:
|
2019-11-11 18:41:30 +01:00
|
|
|
|
2019-11-17 23:13:50 +01:00
|
|
|
with lib;
|
|
|
|
|
|
|
|
mkIf (elem "emacs::flyspell" config.machine.pkgs) {
|
2019-11-11 18:41:30 +01:00
|
|
|
programs.emacs.init.usePackage.flyspell = {
|
|
|
|
enable = true;
|
|
|
|
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)
|
|
|
|
|
|
|
|
(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)
|
|
|
|
))
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|