summary refs log tree commit diff
path: root/emacs.d/lib/settings.el
blob: 58c29370bd1f3782287b5d6cf069bb832a49ee9c (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
;; I don't want a startup screen
(setq inhibit-startup-screen t)

;; disable tool bar and the scroll bar
(dolist (mode '(tool-bar-mode scroll-bar-mode))
  (when (fboundp mode) (funcall mode -1)))

;; auto close bracket insertion
(electric-pair-mode 1)

;; show trailing white space for prog modes
;; FIXME this should probably be moved somewhere else. I need
;; to revisit the various prog-mode-hook.
(add-hook 'prog-mode-hook
          (lambda () (setq show-trailing-whitespace t)))

;; this makes emacs slow to work with source
;; FIXME revisit this variable and see if it should be moved to magit
;; FIXME I'm still not sure how the VC mode is actually useful
(delete 'Git vc-handled-backends)

;; alias yes-or-no to y-or-n
(fset 'yes-or-no-p 'y-or-n-p)

;; set utf-8 as the default encoding
(prefer-coding-system 'utf-8-unix)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)

;; reload the buffer when a file changes
(global-auto-revert-mode 1)

;; show column number in the mode line
(setq column-number-mode t)

;; when saving the file, ensure a newline exists at the end of the file
(setq require-final-newline t)

;; no initial message in the scratch buffer
(setq initial-scratch-message nil)

;; follow symlinks
(setq vc-follow-symlinks t)

;; scroll 5 lines at a time
(setq next-screen-context-lines 5)

;; when using TAB, always indent
(setq tab-always-indent 'complete)

;; don't auto save files
(setq auto-save-default nil)

;; I really don't want backup files
(setq auto-save-list-file-prefix nil
      make-backup-files nil)

;; How long to display an echo-area message when the minibuffer is active.
(setq minibuffer-message-timeout 0.5)

;; don't use a lock file
(setq-default create-lockfiles nil)

;; show parenthesis
(show-paren-mode +1)

;; no blinking cursor
(blink-cursor-mode -1)

;; I don't want a frindge on the right
(fringe-mode '(4 . 0))

;; frame title
(setq frame-title-format '( "%b" " [" (:eval mode-name) "]"))

;; Set default font. Large font for the main window, but small font for the modeline
(set-face-attribute 'default nil :family "Go Mono" :height 160 :weight 'normal :width 'normal)
(set-face-attribute 'mode-line nil  :height 110)

;; where to save custom settings
(setq custom-file (expand-file-name "var/emacs-custom.el" user-emacs-directory))

(provide 'settings)