blob: a229ac23ff44e94e09c0dad34717f009bafb0308 (
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
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
|
(use-package wgrep
:ensure t
:bind
(:map wgrep-mode-map
("C-x C-s" . wgrep-save-all-buffers)
("C-x C-q" . wgrep-change-to-wgrep-mode)
("C-c C-c" . wgrep-finish-edit))
:bind
(:map grep-mode-map
("e" . wgrep-change-to-wgrep-mode)))
(use-package multiple-cursors
:ensure t
:config
(setq mc/always-run-for-all t)
:bind
(("C-S-c C-S-c" . mc/edit-lines)
("C->" . mc/mark-next-like-this)
("C-<" . mc/mark-previous-like-this)
("C-c C" . mc/mark-all-like-this)
("C-\"". mc/skip-to-next-like-this)
("C-;" . mc/skip-to-previous-like-this)))
(use-package expand-region
:ensure t
:bind ("C-=" . er/expand-region))
(use-package substitute
:ensure t
:bind
(("C-c s b" . substitute-target-below-point)
("C-c s a" . substitute-target-above-point)
("C-c s d" . substitute-target-in-defun)
("C-c s s" . substitute-target-in-buffer)))
(use-package move-text
:ensure t
:bind
(:map prog-mode-map
("M-p" . move-text-up)
("M-n" . move-text-down)))
;; Desktop mode/session saving
(setq desktop-path '("~/.emacs.d/desktop")
desktop-dirname "~/.emacs.d/desktop/"
desktop-base-file-name "emacs-desktop"
desktop-save t
desktop-restore-eager t
desktop-restore-=frams t
desktop-restory-in-current-display t
desktop-files-not-to-save "\(^$\\|\\*scratch\\*\\|\\*Messages\\*\\|\\*dashboard\\*\\|\\*Async-native-compile-log\\*|\\*Music\\*)")
;; (desktop-save-mode t)
(global-set-key (kbd "C-z s") 'desktop-save-in-desktop-dir)
(global-set-key (kbd "C-z r") 'desktop-read)
;; Text Scratch buffers
(defun bard/new-org-buffer ()
(interactive)
(let ((xbuf (generate-new-buffer "*org*")))
(switch-to-buffer xbuf)
(funcall (quote org-mode))
(text-scale-increase 1.5)
xbuf))
(define-key global-map (kbd "M-=") #'bard/new-org-buffer)
(defun bard/new-plain-buffer ()
(interactive)
(let ((xbuf (generate-new-buffer "*plain*")))
(switch-to-buffer xbuf)
(text-scale-increase 1.5)
xbuf))
(define-key global-map (kbd "M--") #'bard/new-plain-buffer)
;; elisp scratch buffer
(defun bard/new-elisp-buffer ()
(interactive)
(let ((xbuf (generate-new-buffer "*elisp*")))
(switch-to-buffer xbuf)
(funcall (quote emacs-lisp-mode))
(text-scale-increase 1.5)
xbuf))
(defun bard/open-terminal-in-current-directory ()
"Open a terminal in the current working directory."
(interactive)
(let ((default-directory default-directory))
(term "/usr/bin/env bash")))
;; (define-key global-map (kbd "C-t") #'bard/open-terminal-in-current-directory)
(define-key global-map (kbd "C-z t") #'bard/open-terminal-in-current-directory)
(defun bard/open-terminal-emulator ()
"Open a terminal in the current working directory."
(interactive)
(let ((default-directory default-directory))
(start-process "st terminal" nil "st")))
(define-key global-map (kbd "C-z C-t") 'bard/open-terminal-emulator)
(define-key global-map (kbd "C-z C-s") #'bard/new-elisp-buffer)
;; Modeline
(setq display-time-format "%Y-%m-%d (%a) %H:%M")
(setq display-time-interval 60)
(setq display-time-default-load-average nil)
(setq display-time-mail-directory nil)
(setq display-time-mail-function nil)
(setq display-time-use-mail-icon nil)
(setq display-time-mail-string nil)
(setq display-time-mail-face nil)
(setq display-time-string-forms
'((propertize
(format-time-string display-time-format now)
'face 'display-time-date-and-time
'help-echo (format-time-string "%a %b %e, %Y" now))
" "))
(display-time-mode 1)
;; world clock
(setq world-clock-list
'(("America/New_York" "New York")
("Europe/Moscow" "Moscow")
("Europe/London" "London")
("Asia/Tokyo" "Tokyo")))
(setq world-clock-time-format "%Y-%m-%d %B (%A) %R %Z")
;; timer package
(use-package tmr
:ensure t
:config
(setq tmr-notification-urgency 'normal)
(setq tmr-sound-file nil)
(setq tmr-timer-finished-functions '(tmr-notification-notify
tmr-print-message-for-finished-timer
tmr-acknowledge-minibuffer))
(setq tmr-descriptions-list 'tmr-description-history)
(define-key global-map (kbd "C-c t l") 'tmr-tabulated-view)
(define-key global-map (kbd "C-c t t") #'tmr)
(define-key global-map (kbd "C-c t T") #'tmr-with-description)
(define-key global-map (kbd "C-c t l") #'tmr-tabulated-view)
(define-key global-map (kbd "C-c t c") #'tmr-clone)
(define-key global-map (kbd "C-c t k") #'tmr-cancel)
(define-key global-map (kbd "C-c t s") #'tmr-reschedule)
(define-key global-map (kbd "C-c t e") #'tmr-edit-description)
(define-key global-map (kbd "C-c t r") #'tmr-remove)
(define-key global-map (kbd "C-c t R") #'tmr-remove-finished))
(use-package bookmarks
:ensure nil
:hook
(bookmark-bmenu-mode-hook . hl-line-mode)
:config
(setq bookmark-fringe-mark nil)
(setq bookmark-save-flag 1))
(require 'server)
(setq server-client-instructions nil)
(unless (server-running-p)
(server-start))
(provide 'bard-emacs-essentials)
|