-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmy-macros.el
47 lines (34 loc) · 916 Bytes
/
my-macros.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
;;;;;;;;;;;;;;;;;;;;; MACROS ;;;;;;;;;;;;;;;;;;;;;
(fset 'ack-js-regex
"--type=js ")
(define-key minibuffer-local-map (kbd "C-c j") 'ack-js-regex)
(defun untabify-and-indent-buffer ()
(interactive)
(progn
(untabify (point-min) (point-max))
(indent-region (point-min) (point-max))
)
)
(defun tabify-and-indent-buffer ()
(interactive)
(progn
(tabify (point-min) (point-max))
(indent-region (point-min) (point-max))
)
)
(defun open-line-and-indent ()
(interactive)
(progn
(newline-and-indent)
(previous-line)
(end-of-line)
(indent-according-to-mode)
))
(global-set-key (kbd "C-o") 'open-line-and-indent)
(defun pbcopy ()
(interactive)
(call-process-region (point) (mark) "pbcopy")
(setq deactivate-mark t))
(defun pbpaste ()
(interactive)
(call-process-region (point) (if mark-active (mark) (point)) "pbpaste" t t))