Add css-mode hydra
This commit is contained in:
parent
22e8fdafa0
commit
4524ea0ed6
1 changed files with 6 additions and 2 deletions
|
@ -25,6 +25,7 @@
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(require 'css-mode)
|
(require 'css-mode)
|
||||||
|
(require 'hydra)
|
||||||
(eval-when-compile (require 'compile))
|
(eval-when-compile (require 'compile))
|
||||||
|
|
||||||
(defun oni:css-property-important-p ()
|
(defun oni:css-property-important-p ()
|
||||||
|
@ -51,7 +52,7 @@
|
||||||
(when (re-search-backward " !important" (line-beginning-position) :noerror)
|
(when (re-search-backward " !important" (line-beginning-position) :noerror)
|
||||||
(replace-match "")))))
|
(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."
|
"Toggle the important flag on the property on the current line."
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (oni:css-property-important-p)
|
(if (oni:css-property-important-p)
|
||||||
|
@ -74,7 +75,10 @@
|
||||||
(add-to-list 'compilation-error-regexp-alist
|
(add-to-list 'compilation-error-regexp-alist
|
||||||
(list oni:scss-error-regexp 2 1 nil 2 2)))
|
(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)
|
(provide 'oni-css-mode-init)
|
||||||
;;; oni-css-mode-init.el ends here
|
;;; oni-css-mode-init.el ends here
|
||||||
|
|
Loading…
Reference in a new issue