diff options
Diffstat (limited to 'emacs')
-rw-r--r-- | emacs/.emacs.d/init/oni-css-mode-init.el | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/emacs/.emacs.d/init/oni-css-mode-init.el b/emacs/.emacs.d/init/oni-css-mode-init.el index 0a57104..f63aae3 100644 --- a/emacs/.emacs.d/init/oni-css-mode-init.el +++ b/emacs/.emacs.d/init/oni-css-mode-init.el @@ -25,6 +25,7 @@ ;;; Code: (require 'css-mode) +(require 'hydra) (eval-when-compile (require 'compile)) (defun oni:css-property-important-p () @@ -51,7 +52,7 @@ (when (re-search-backward " !important" (line-beginning-position) :noerror) (replace-match ""))))) -(defun oni:css-toggle-important () +(defun oni-css-mode-init--toggle-important () "Toggle the important flag on the property on the current line." (interactive) (if (oni:css-property-important-p) @@ -74,7 +75,10 @@ (add-to-list 'compilation-error-regexp-alist (list oni:scss-error-regexp 2 1 nil 2 2))) -(define-key css-mode-map (kbd "C-c !") #'oni:css-toggle-important) +(defhydra css-mode-hydra (:color blue) + ("!" oni-css-mode-init--toggle-important)) + +(define-key css-mode-map (kbd "C-c m") #'css-mode-hydra/body) (provide 'oni-css-mode-init) ;;; oni-css-mode-init.el ends here |