diff options
Diffstat (limited to 'emacs')
-rw-r--r-- | emacs/custom/my-edit.el | 62 |
1 files changed, 27 insertions, 35 deletions
diff --git a/emacs/custom/my-edit.el b/emacs/custom/my-edit.el index eecd557..84b4085 100644 --- a/emacs/custom/my-edit.el +++ b/emacs/custom/my-edit.el @@ -1,41 +1,33 @@ -;;; my-edit.el --- Configure parts related to editing +;;; my-edit.el --- Configure parts related to editing -*- lexical-binding: t -*- + ;;; Commentary: + ;;; Code: -(require 'use-package) - -(use-package autorevert - :custom - (global-auto-revert-non-file-buffers t) - (auto-revert-verbose nil) - :config - (global-auto-revert-mode t)) - -(use-package whitespace - :preface - (defun my/whitespace-setup () - (setq show-trailing-whitespace t)) - :hook ((prog-mode . my/whitespace-setup) - (conf-mode . my/whitespace-setup) - (outline-mode . my/whitespace-setup) - (yaml-mode . my/whitespace-setup)) - :custom - (whitespace-style '(face)) - (show-trailing-whitespace nil)) - -(use-package electric-pair-mode - :commands electric-pair-mode - :hook (prog-mode . electric-pair-mode)) - -(use-package paren - :ensure t - :custom - (show-paren-delay 0) - (show-paren-highlight-openparen t) - (show-paren-when-point-inside-paren t) - (show-paren-when-point-in-periphery t) - :config - (show-paren-mode 1)) +(require 'autorevert) +(require 'whitespace) + +(setq global-auto-revert-non-file-buffers t + auto-revert-verbose nil) +(global-auto-revert-mode t) + +(defun my/whitespace-setup () + "Configure whitespace mode." + (setq-local show-trailing-whitespace t)) + +;; turn on my configuration for white spaces on a few modes +(dolist (hook '(prog-mode-hook text-mode-hook conf-mode-hook outline-mode-hook)) + (add-hook hook 'my/whitespace-setup)) + +;; turn on `electric-pair-mode' on `prog-mode' and `conf-mode-hook' +(dolist (hook '(prog-mode-hook conf-mode-hook)) + (add-hook hook 'electric-pair-mode)) + +(setq show-paren-delay 0 + show-paren-highlight-openparen t + show-paren-when-point-inside-paren t + show-paren-when-point-in-periphery t) +(show-paren-mode 1) (global-set-key (kbd "M-j") 'join-line) |