/
.emacs
108 lines (84 loc) · 2.76 KB
/
.emacs
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
;;; Emacs configuration file.
;;;
;;; This configuration is mainly used for regular txt files.
;; Settings
(set-frame-font "Monoid Nerd Font Mono Retina 15" t)
(setq diary-file "~/Dropbox/My/diary")
(when (window-system)
(set-frame-size (selected-frame) 100 40)
(set-frame-position (selected-frame) 300 90))
(setq inhibit-splash-screen t)
(setq inhibit-startup-message t)
(menu-bar-mode 1)
(scroll-bar-mode -1)
(tool-bar-mode -1)
(fido-vertical-mode t)
;; In case no theme is used
(set-foreground-color "#222222")
(set-background-color "#f5f5f5")
(set-face-attribute 'region nil :background "#f5ebe0" :foreground "#d14d72")
(set-cursor-color "#bbbbbb")
(prefer-coding-system 'utf-8)
(setq exec-path (append exec-path '("/opt/homebrew/bin")))
(setenv "PATH" (concant (getenv "PATH") ":/opt/homebrew/bin"))
(setq visible-bell nil)
(setq ring-bell-function 'ignore)
;; Functions
(defun kbd/insert-emdash ()
(interactive)
(insert-char 8212))
(defun hooks/text-mode-hook ()
(interactive)
(setq buffer-face-mode-face '(:family "georgia" :height 200))
(setq cursor-type 'bar)
(buffer-face-mode)
(visual-line-mode)
(auto-save-visited-mode 1))
(defun hooks/ruby-mode-hook ()
(interactive)
(display-line-numbers-mode t))
(defun focus ()
(interactive)
(darkroom-tentative-mode))
;; Bindings
(add-hook 'text-mode-hook 'hooks/text-mode-hook)
(add-hook 'diary-mode-hook 'hooks/text-mode-hook)
(add-hook 'ruby-mode-hook 'hooks/ruby-mode-hook)
(global-set-key (kbd "C-c -") 'kbd/insert-emdash)
(global-set-key (kbd "C-у") 'move-end-of-line)
(global-set-key (kbd "C-ф") 'move-beginning-of-line)
;; Packages
(setq use-package-always-ensure t)
(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t)
(package-initialize)
(use-package mood-line
;; Enable mood-line
:config
(mood-line-mode)
(setq mood-line-glyph-alist mood-line-glyphs-fira-code))
(use-package smartscan
:init
(smartscan-mode 1))
(use-package darkroom)
(use-package enh-ruby-mode)
(use-package typescript-mode)
(use-package markdown-mode)
(use-package magit
:config
(defalias 'b 'magit-blame-addition))
;; Startup windows
(calendar)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(package-selected-packages
'(markdown-mode typescript-mode mood-line enh-ruby-mode magit smartscan darkroom)))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
(put 'downcase-region 'disabled nil)