X-Git-Url: https://git.shemshak.org/~bandali/configs/blobdiff_plain/39c1c07363abeeca1c13f257fdacf0eb0851ac1f..5361eed6d248cc54103b3992d8fdb68a829d4a0b:/init.el diff --git a/init.el b/init.el index 24765c8..409beab 100644 --- a/init.el +++ b/init.el @@ -239,6 +239,17 @@ For disabling the behaviour for certain buffers and/or modes." (interactive) (kill-buffer (current-buffer))) +(defun b/move-indentation-or-beginning-of-line (arg) + "Move to the indentation or to the beginning of line." + (interactive "^p") + ;; (if (bolp) + ;; (back-to-indentation) + ;; (move-beginning-of-line arg)) + (if (= (point) + (progn (back-to-indentation) + (point))) + (move-beginning-of-line arg))) + ;;; Defaults @@ -490,6 +501,7 @@ For disabling the behaviour for certain buffers and/or modes." ;;; General bindings (bind-keys + ("C-a" . b/move-indentation-or-beginning-of-line) ("C-c a i" . ielm) ("C-c e b" . eval-buffer) @@ -656,14 +668,16 @@ For disabling the behaviour for certain buffers and/or modes." ;;; Editing -(comment + ;; highlight uncommitted changes in the left fringe (use-package diff-hl :defer 0.6 :config (setq diff-hl-draw-borders nil) (global-diff-hl-mode) - :hook (magit-post-refresh . diff-hl-magit-post-refresh)) + :hook + ((magit-pre-refresh . diff-hl-magit-pre-refresh) + (magit-post-refresh . diff-hl-magit-post-refresh))) ;; display Lisp objects at point in the echo area (use-package eldoc @@ -714,8 +728,8 @@ For disabling the behaviour for certain buffers and/or modes." (use-package conf-mode :mode "\\.*rc$") -(use-package sh-mode - :mode "\\.bashrc$") +(use-package sh-script + :mode ("\\.bashrc$" . sh-mode)) (use-package company :disabled @@ -736,6 +750,7 @@ For disabling the behaviour for certain buffers and/or modes." ) (use-package flycheck + :disabled :defer 0.6 :hook (prog-mode . flycheck-mode) :bind @@ -750,10 +765,11 @@ For disabling the behaviour for certain buffers and/or modes." (setq flycheck-check-syntax-automatically '(mode-enabled save)) :custom (flycheck-mode-line-prefix "flyc")) -(use-package flyspell) +;; (use-package flyspell) ;; http://endlessparentheses.com/ispell-and-apostrophes.html (use-package ispell + :disabled :defer 0.6 :config ;; ’ can be part of a word @@ -794,28 +810,28 @@ For disabling the behaviour for certain buffers and/or modes." (use-package reveal :hook (emacs-lisp-mode . reveal-mode)) -(use-package elisp-mode) - -;; (use-package alloy-mode -;; :straight (:host github :repo "dwwmmn/alloy-mode") -;; :mode "\\.\\(als\\|dsh\\)\\'" -;; :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)))) +;; (use-package elisp-mode) + +(use-package alloy-mode + :mode "\\.\\(als\\|dsh\\)\\'" + :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)))) +(comment (eval-when-compile (defvar lean-mode-map)) (use-package lean-mode :defer 0.4 @@ -830,7 +846,7 @@ For disabling the behaviour for certain buffers and/or modes." lean-input-user-translations '(("/" "/"))) (lean-input-setup)) -(use-package mhtml-mode) +;; (use-package mhtml-mode) (use-package sgml-mode :config