From: Amin Bandali Date: Wed, 18 Dec 2019 07:01:43 +0000 (-0500) Subject: emacs: alloy-mode: rebind TAB to indent-for-tab-command X-Git-Url: https://git.shemshak.org/~bandali/configs/commitdiff_plain/23434d06cfb8f9f28c5b40a52db04bf7aba7d81e?ds=sidebyside emacs: alloy-mode: rebind TAB to indent-for-tab-command --- diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 24d622f..57a8f74 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -1416,7 +1416,21 @@ This function is intended for use with `ivy-ignore-buffers'." (use-package alloy-mode :straight (:host github :repo "dwwmmn/alloy-mode") :mode "\\.als\\'" - :config (setq alloy-basic-offset 2) + :config + (setq alloy-basic-offset 2) + ;; (defun b/alloy-simple-indent (start end) + ;; (interactive "r") + ;; ;; (if (region-active-p) + ;; ;; (indent-rigidly start end alloy-basic-offset) + ;; ;; (if (bolp) + ;; ;; (indent-rigidly (line-beginning-position) + ;; ;; (line-end-position) + ;; ;; alloy-basic-offset))) + ;; (indent-to (+ (current-column) alloy-basic-offset))) + :bind (:map alloy-mode-map + ("RET" . electric-newline-and-maybe-indent) + ;; ("TAB" . b/alloy-simple-indent) + ("TAB" . indent-for-tab-command)) :hook (alloy-mode . (lambda () (setq-local indent-tabs-mode nil)))) (eval-when-compile (defvar lean-mode-map))