summary refs log tree commit diff
path: root/emacs/custom/my-edit.el
blob: fc148cc84f411ba71ac47e6930611d7337914b82 (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
;;; my-edit.el --- Configure parts related to editing -*- lexical-binding: t -*-

;;; Commentary:

;;; Code:

(customize-set-variable 'global-auto-revert-non-file-buffers t)
(customize-set-variable '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)

;; 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