nixos/pkgsets/emacs/flyspell.nix
derped ad76922338
Move pkgsets folder into project root to conform with option naming.
Add simple package filter to auto remove broken packages.
2020-03-27 13:41:24 +01:00

31 lines
919 B
Nix

{ config, lib, ... }:
with lib;
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)
(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)
))
'';
};
}