diff options
author | Amin Bandali <bandali@kelar.org> | 2025-02-08 14:14:06 -0500 |
---|---|---|
committer | Amin Bandali <bandali@kelar.org> | 2025-02-08 14:14:06 -0500 |
commit | deba2c035794cdb0f129325487cd3d570301ebc4 (patch) | |
tree | 55434d2837839bbabc99b65c4db806cfbb6b2fdb /.emacs.d/lisp | |
parent | 7b718d276e1d9f01287baea7187baef618e6b947 (diff) | |
download | configs-deba2c035794cdb0f129325487cd3d570301ebc4.tar.gz configs-deba2c035794cdb0f129325487cd3d570301ebc4.tar.xz configs-deba2c035794cdb0f129325487cd3d570301ebc4.zip |
Update bandali-essentials and add bandali-prog
Diffstat (limited to '.emacs.d/lisp')
-rw-r--r-- | .emacs.d/lisp/bandali-essentials.el | 39 | ||||
-rw-r--r-- | .emacs.d/lisp/bandali-prog.el | 98 |
2 files changed, 136 insertions, 1 deletions
diff --git a/.emacs.d/lisp/bandali-essentials.el b/.emacs.d/lisp/bandali-essentials.el index a0ea5f1..c9927de 100644 --- a/.emacs.d/lisp/bandali-essentials.el +++ b/.emacs.d/lisp/bandali-essentials.el @@ -102,6 +102,10 @@ :background grey :inherit 'fixed-pitch))))) +(use-package delight + :ensure t + :defer 0.5) + (use-package minibuffer :custom (read-file-name-completion-ignore-case t)) @@ -129,6 +133,10 @@ ("C-c F m" . make-frame-command) ("C-c F d" . delete-frame)) +(use-package window + :custom + (split-width-threshold 140)) + (use-package text-mode :mode "\\(README.*\\|COMMIT_EDITMSG$\\)") @@ -348,6 +356,10 @@ (show-paren-mode 1)) (use-package simple + :delight + (auto-fill-function " f") + :hook + ((text-mode tex-mode) . auto-fill-mode) :custom ;; Save what I copy into clipboard from other applications into ;; Emacs' kill-ring, which would allow me to still be able to @@ -376,12 +388,37 @@ :custom (flyspell-mode-line-string " fly") :hook - (text-mode . flyspell-mode)) + ((text-mode tex-mode) . flyspell-mode)) (use-package abbrev + :delight :hook (text-mode . abbrev-mode)) +(use-package eww + :bind + ("C-c e w" . eww) + :custom + (eww-download-directory + (file-name-as-directory (getenv "XDG_DOWNLOAD_DIR")))) + +(use-package display-fill-column-indicator + :defer 0.2 + :config + (global-display-fill-column-indicator-mode 1)) + +(use-package completion-preview + ;; :if (package-installed-p 'completion-preview) + :if (version<= "30" emacs-version) + :bind + (:map + completion-preview-active-mode-map + ("M-n" . completion-preview-next-candidate) + ("M-p" . completion-preview-prev-candidate) + ("M-i" . completion-preview-insert)) + :hook + ((prog-mode text-mode comint-mode) . completion-preview-mode)) + (use-package version :bind ("C-c e v" . emacs-version)) diff --git a/.emacs.d/lisp/bandali-prog.el b/.emacs.d/lisp/bandali-prog.el new file mode 100644 index 0000000..66f2c3a --- /dev/null +++ b/.emacs.d/lisp/bandali-prog.el @@ -0,0 +1,98 @@ +;;; bandali-prog.el --- programming modes setup -*- lexical-binding: t; -*- + +;; Copyright (c) 2018-2025 Amin Bandali <bandali@gnu.org> + +;; Author: Amin Bandali <bandali@gnu.org> +;; Keywords: languages + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see <https://www.gnu.org/licenses/>. + +;;; Commentary: + +;; My customizations for various programming language modes. + +;;; Code: + +(use-package elisp-mode + :bind + ("C-c e e" . eval-last-sexp)) + +(use-package pp + :bind + ("C-c e m" . pp-macroexpand-last-sexp)) + +(use-package lisp-mode + :hook + (lisp-interaction-mode . (lambda () (setq-local indent-tabs-mode nil)))) + +(use-package alloy-mode + :disabled + :load-path "lisp/alloy-mode" + :mode "\\.\\(als\\|dsh\\)\\'" + :hook + (alloy-mode . (lambda nil (setq-local indent-tabs-mode nil))) + :init + (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 + (;; ("TAB" . b/alloy-simple-indent) + "RET" . electric-newline-and-maybe-indent)) + :custom + (alloy-basic-offset 2)) + +;; (eval-when-compile (defvar lean-mode-map)) +;; (run-with-idle-timer 0.4 nil #'require 'lean-mode) +;; (with-eval-after-load 'lean-mode +;; (require 'lean-input) +;; (setq default-input-method "Lean" +;; lean-input-tweak-all '(lean-input-compose +;; (lean-input-prepend "/") +;; (lean-input-nonempty)) +;; lean-input-user-translations '(("/" "/"))) +;; (lean-input-setup) +;; ;; local key bindings +;; (define-key lean-mode-map (kbd "S-SPC") #'company-complete)) + +(use-package sgml-mode + :custom + (sgml-basic-offset 0)) + +(use-package css-mode + :custom + (css-indent-offset 2)) + +(use-package cmake-mode + :mode + (("CMakeLists\\.txt\\'" . cmake-mode) + ("\\.cmake\\'" . cmake-mode))) + +(use-package cmake-font-lock + :after cmake-mode + :load-path "lisp/cmake-font-lock") + +(use-package reftex + :hook + (latex-mode . reftex-mode)) + +(provide 'bandali-prog) +;;; bandali-prog.el ends here |