summary refs log tree commit diff
path: root/emacs/custom/my-edit.el
blob: eecd5579a2bd3b5ff0a8dff429e0122dd376490c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
;;; my-edit.el --- Configure parts related to editing
;;; 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))

(global-set-key (kbd "M-j") 'join-line)

;; don't assume that sentences should have two spaces after period.
(setq sentence-end-double-space nil)

;; switch to view-mode whenever you are in a read-only buffer (e.g.
;; switched to it using C-x C-q).
(setq view-read-only t)

(provide 'my-edit)
;;; my-edit.el ends here