-
Notifications
You must be signed in to change notification settings - Fork 1
/
rgr-utils.el
62 lines (54 loc) · 1.71 KB
/
rgr-utils.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
(use-package gif-screencast
:custom
(gif-screencast-program "grim")
(gif-screencast-screenshot-directory "~/tmp")
(gif-screencast-output-directory "~/tmp"))
(defun rgr/toggle-buffer(n)
"jump to or from buffer named n else default to *Messages*"
(interactive "bbuffer:")
(let ((n (or n
"*Messages*")))
(switch-to-buffer (if (string= (buffer-name) n)
(other-buffer) n))))
(defun rgr/elisp-write-var (f v)
(with-temp-file f
(prin1 v (current-buffer))))
(defun rgr/elisp-read-var (f)
(with-temp-buffer
(insert-file-contents f)
(cl-assert (eq (point) (point-min)))
(read (current-buffer))))
(use-package emacs
:init
(setq rgr/complete-line-function 'rgr/newline-below)
:config
(defun rgr/complete-c-line()
(interactive)
(end-of-line)
(delete-trailing-whitespace)
(unless (eql ?\; (char-before (point-at-eol)))
(progn (insert ";")))
(if current-prefix-arg
(newline-and-indent)
(progn
(next-line)
(beginning-of-visual-line))))
(defun rgr/insert-previous-line()
(interactive)
(previous-line)
(end-of-line)
(newline-and-indent)
(insert (string-trim (current-kill 0))))
(defun rgr/newline-below()
(interactive)
(end-of-line)
(newline-and-indent))
:bind
("<C-return>" . (lambda()(interactive)(funcall rgr/complete-line-function))))
(use-package lazy-lang-learn
:straight (lazy-lang-learn :local-repo "~/development/projects/emacs/lazy-lang-learn" :type git :host github :repo "rileyrg/lazy-lang-learn" )
:bind
("C-c L" . lazy-lang-learn-mode)
("<f12>" . lazy-lang-learn-translate)
("S-<f12>" . lazy-lang-learn-translate-from-history))
(provide 'rgr/utils)