forked from prajwalit/emacs.d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
global.el
114 lines (81 loc) · 2.49 KB
/
global.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
(require 'yasnippet)
(require 'git-gutter)
(require 'smartparens-config)
(require 'rich-minority)
(require 'smooth-scroll)
(require 'window-number)
;; Load default auto-complete configs
(ac-config-default)
(setq ac-comphist-file (concat tmp-dir "ac-comphist.dat"))
;; Start smartparens mode
(smartparens-global-strict-mode)
;; Start undo-tree
(global-undo-tree-mode)
;; Set up ace-jump-mode
(autoload 'ace-jump-mode
"ace-jump-mode"
"Emacs quick move minor mode"
t)
(autoload 'ace-jump-mode-pop-mark
"ace-jump-mode"
"Ace jump back:-"
t)
;; y/n
(defalias 'yes-or-no-p 'y-or-n-p)
;; Tab fix
(setq-default tab-width 4
standard-indent 4
indent-tabs-mode nil
show-trailing-whitespace t)
;; Setup ido-mode
(ido-mode t)
(setq ido-enable-prefix nil
ido-enable-flex-matching t
ido-create-new-buffer 'always
ido-use-filename-at-point 'guess
ido-max-prospects 10)
;; Cleanup whitespace
(add-hook 'before-save-hook 'whitespace-cleanup)
;; Automatically save and restore sessions
(setq desktop-dirname tmp-dir
desktop-base-file-name "emacs.desktop"
desktop-base-lock-name "lock"
desktop-path (list desktop-dirname)
desktop-save t
desktop-files-not-to-save "^$" ;reload tramp paths
desktop-load-locked-desktop nil)
(desktop-save-mode 1)
;; Initialize yasnippets
(setq yas-snippet-dirs (concat root-dir "snippets"))
(yas-global-mode 1)
;; Initialize Git-gutter
(global-git-gutter-mode t)
(custom-set-variables
'(git-gutter:modified-sign "=")
'(git-gutter:added-sign "+")
'(git-gutter:deleted-sign "-"))
;; Set rich minority mode
;; (setq rm-blacklist '(" ARev"
;; " AC"
;; " GitGutter"
;; " Undo-Tree"
;; " SP/s"
;; " SScr"
;; " yas"))
;; (rich-minority-mode 1)
;; Start smooth-scrolling
(smooth-scroll-mode t)
(setq smooth-scroll/vscroll-step-size 6)
(setq mouse-wheel-progressive-speed nil)
(setq mouse-wheel-follow-mouse 't)
(setq scroll-step 1)
;; Mode-specific scratch buffers
(autoload 'scratch "scratch" nil t)
;; Select windows using M- and a number
(window-number-meta-mode 1)
;; Sort buffers in ibuffer alphabetically
(add-hook 'ibuffer-hook
(lambda ()
(ibuffer-vc-set-filter-groups-by-vc-root)
(unless (eq ibuffer-sorting-mode 'alphabetic)
(ibuffer-do-sort-by-alphabetic))))