forked from rejeep/emacs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrejeep-misc.el
142 lines (107 loc) · 3.41 KB
/
rejeep-misc.el
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
;;; rejeep-misc.el --- Miscellaneous settings
;; Do not pause on redisplay
(setq redisplay-dont-pause t)
;; Do not make any backup files
(setq make-backup-files nil)
;; Kill whole line
(setq kill-whole-line t)
;; Do not show startup message
(setq inhibit-startup-message t)
;; Show keystrokes in minibuffer early
(setq echo-keystrokes 0.1)
;; Set default browser
(setq browse-url-browser-function 'browse-url-generic)
(setq browse-url-generic-program "google-chrome")
;; Initial major mode is Emacs Lisp mode
(setq initial-major-mode 'emacs-lisp-mode)
;; Indent with spaces instead of tabs
(setq-default indent-tabs-mode nil)
;; Truncate lines
(set-default 'truncate-lines t)
;; Show matching parenthesis
(show-paren-mode 1)
;; Do not blink cursor
(blink-cursor-mode -1)
;; Do not show any tooltips
(tooltip-mode -1)
;; Remove selected region if typing
(pending-delete-mode 1)
;; Shift + arrow key move cursor to buffer in arrow direction
(windmove-default-keybindings 'shift)
;; Allow some commands
(dolist (command '(narrow-to-region downcase-region upcase-region))
(put command 'disabled nil))
;; CUA rectangle mode
(setq cua-enable-cua-keys nil)
(setq cua-toggle-set-mark nil)
(cua-mode 1)
;; Prefer utf8
(setq locale-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-selection-coding-system 'utf-8)
(prefer-coding-system 'utf-8)
;; Set font size
(set-face-attribute 'default nil :height 140)
;; Smooth scrolling
(require 'smooth-scrolling)
(setq mouse-wheel-scroll-amount '(1 ((shift) . 1)))
(setq mouse-wheel-progressive-speed nil)
(setq mouse-wheel-follow-mouse 't)
(setq scroll-step 1)
;; Do not ask for confirmation
(setq confirm-nonexistent-file-or-buffer nil)
(setq kill-buffer-query-functions
(remq 'process-kill-buffer-query-function
kill-buffer-query-functions))
;; Add parts of each file's directory to the buffer name if not unique
(require 'uniquify)
(setq uniquify-buffer-name-style 'forward)
;; Save cursor position
(require 'saveplace)
(setq-default save-place t)
;; Color theme
(require 'color-theme)
(require 'color-theme-subdued)
(color-theme-subdued)
;; Highlight symbol at point
(add-hook 'find-file-hook 'idle-highlight)
;; Wrap Region
(require 'wrap-region)
(wrap-region-global-mode 1)
(wrap-region-add-wrappers
'(("`" "'" nil 'emacs-lisp-mode)
("$" "$" nil 'latex-mode)
("{-" "-}" "#" 'haskell-mode)
("/" "/" nil 'ruby-mode)
("/* " " */" "#" '(java-mode javascript-mode css-mode))
("`" "`" nil '(markdown-mode ruby-mode))
("``" "''" "\"" 'latex-mode)))
;; Drag Stuff
(require 'drag-stuff)
(add-to-list 'drag-stuff-except-modes 'org-mode)
(drag-stuff-global-mode 1)
(defalias 'dtw 'delete-trailing-whitespace)
(defalias 'yes-or-no-p 'y-or-n-p)
;; Projectile
(projectile-global-mode)
(setq projectile-enable-caching t)
;; Popwin
(require 'popwin)
(setq display-buffer-function 'popwin:display-buffer)
;; Ack
(autoload 'ack-and-a-half-same "ack-and-a-half" nil t)
(autoload 'ack-and-a-half "ack-and-a-half" nil t)
(autoload 'ack-and-a-half-find-file-same "ack-and-a-half" nil t)
(autoload 'ack-and-a-half-find-file "ack-and-a-half" nil t)
(defalias 'ack 'ack-and-a-half)
(defalias 'ack-same 'ack-and-a-half-same)
(defalias 'ack-find-file 'ack-and-a-half-find-file)
(defalias 'ack-find-file-same 'ack-and-a-half-find-file-same)
;; Powerline
(require 'powerline)
(powerline-default)
;; Smex
(require 'smex)
(smex-initialize)
(provide 'rejeep-misc)