summaryrefslogtreecommitdiffstats
path: root/ravi-init-appearance.el
blob: 75f76b074ab552bd16850d0e2d2035f9d5a92681 (plain)
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
;;; ravi-init-appearance.el --- Emacs appearance

;; Copyright (C) 2013

;; Author:  <ravi@nero.lan>
;; Keywords:

;; 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
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <http://www.gnu.org/licenses/>.

;;; Commentary:

;; Customization of emacs appearance

;;; Code:

;; No splash screen please
(setq inhibit-startup-message t)

;; Allow pasting selection outside of Emacs
(setq x-select-enable-clipboard t)

;; Show keystrokes in progress
(setq echo-keystrokes 0.1)

;; Real emacs knights don't use shift to mark things
(setq shift-select-mode nil)

;; Enable syntax highlighting for older Emacsen that have it off
(global-font-lock-mode t)
(setq font-lock-maximum-decoration t)

;; Sounds.
;; Turn off sound.
(setq bell-volume 0)
(setq sound-alist nil)

(set-face-background 'cursor "LightSteelBlue1")

;; Answering just 'y' or 'n' will do
(defalias 'yes-or-no-p 'y-or-n-p)

;; Customization of modeline.
(line-number-mode 1)
(column-number-mode 1)
(display-time)

;; Change the way the buffer name is displayed in the modeline.
(setq-default mode-line-buffer-identification '("%17b"))

;; Undo/redo window configuration with C-c <left>/<right>
(winner-mode 1)

;; Never insert tabs
(set-default 'indent-tabs-mode nil)

;; Show me empty lines after buffer end (replaced, see below)
;(set-default 'indicate-empty-lines t)

(use-package whitespace
  :init
  (setq whitespace-style '(face trailing indentation tabs))
  :config
  (progn
    (global-whitespace-mode 1)
    (add-hook 'before-save-hook 'whitespace-cleanup)
    )
  ; No need for 'ensure: t' since whitespace mode is built in
  :diminish global-whitespace-mode
  )

;; Handling end of files.
(setq require-final-newline t)
;; Prevent addition of lines at end of file when down arrow is pressed.
(setq next-line-add-newlines nil)

;; Easily navigate sillycased words
(global-subword-mode 1)

;; Keep cursor away from edges when scrolling up/down
(use-package smooth-scrolling
  :ensure t
  )

;; Represent undo-history as an actual tree (visualize with C-x u)
(use-package undo-tree
  :init
  (setq undo-tree-mode-lighter "")
  :config
  (progn
    (global-undo-tree-mode)
    (setq undo-tree-auto-save-history t)
    (setq undo-tree-history-directory-alist
	  `(("." . ,(expand-file-name "undotree/" (ravi/emacs-file "past")))))
    )
  :ensure t
  )

(provide 'ravi-init-appearance)
;;; ravi-init-appearance.el ends here