X-Git-Url: https://git.shemshak.org/~bandali/configs/blobdiff_plain/5b99021902255e23769e5982b92338a73974d2b2..46b0569f717f7e5fa9cc43355bd5d8a544521453:/init.el diff --git a/init.el b/init.el index 23158a1..01ee10a 100644 --- a/init.el +++ b/init.el @@ -1,6 +1,6 @@ ;;; init.el --- bandali's emacs configuration -*- lexical-binding: t -*- -;; Copyright (C) 2018-2019 Amin Bandali +;; Copyright (C) 2018-2020 Amin Bandali ;; 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 @@ -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) @@ -654,6 +666,11 @@ For disabling the behaviour for certain buffers and/or modes." ;; IRC (with ERC and ZNC) (require 'bandali-erc) +(use-package scpaste + :config + (setq scpaste-http-destination "https://p.bndl.org" + scpaste-scp-destination "p:~")) + ;;; Editing @@ -737,8 +754,8 @@ For disabling the behaviour for certain buffers and/or modes." ;; (global-company-mode t) ) -(comment (use-package flycheck + :disabled :defer 0.6 :hook (prog-mode . flycheck-mode) :bind @@ -753,10 +770,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 @@ -797,31 +815,31 @@ 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)))) - -(eval-when-compile (defvar lean-mode-map)) +;; (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)))) + (use-package lean-mode + :disabled :defer 0.4 + :init (eval-when-compile (defvar lean-mode-map)) :bind (:map lean-mode-map ("S-SPC" . company-complete)) :config @@ -833,7 +851,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 @@ -852,23 +870,27 @@ For disabling the behaviour for certain buffers and/or modes." (setq emmet-move-cursor-between-quotes t) :hook (css-mode html-mode sgml-mode)) -(use-package geiser) +(use-package geiser + :disabled) (use-package geiser-guile + :disabled :config (setq geiser-guile-load-path "~/src/git/guix")) -(use-package guix) +(use-package guix + :disabled) -(comment - (use-package auctex - :custom - (font-latex-fontify-sectioning 'color))) +(use-package auctex + :disabled + :custom + (font-latex-fontify-sectioning 'color)) (use-package go-mode :disabled) (use-package po-mode + :disabled :hook (po-mode . (lambda () (run-with-timer 0.1 nil 'View-exit)))) @@ -887,6 +909,7 @@ For disabling the behaviour for certain buffers and/or modes." ;;; Theme +(comment (add-to-list 'custom-theme-load-path (expand-file-name (convert-standard-filename "lisp") user-emacs-directory)) @@ -1264,12 +1287,7 @@ For disabling the behaviour for certain buffers and/or modes." (use-package window :bind - (("C-c w e" . (lambda () - (interactive) - (split-window-right) - (other-window 1) - (erc-switch-to-buffer))) - ("C-c w s l" . (lambda () + (("C-c w s l" . (lambda () (interactive) (split-window-right) (other-window 1))) @@ -1360,12 +1378,6 @@ For disabling the behaviour for certain buffers and/or modes." :config (eosd-start)) -(use-package scpaste - :disabled - :config - (setq scpaste-http-destination "https://p.bndl.org" - scpaste-scp-destination "nix:/var/www/p.bndl.org")) - (use-package eww :bind ("C-c a e w" . eww) :custom