From 23434d06cfb8f9f28c5b40a52db04bf7aba7d81e Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Wed, 18 Dec 2019 02:01:43 -0500 Subject: [PATCH] emacs: alloy-mode: rebind TAB to indent-for-tab-command --- .emacs.d/init.el | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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)) -- 2.20.1