summaryrefslogtreecommitdiffstats
path: root/files/.emacs.d/jd/jd-keys.el
blob: 8c1c4cbdb6112517087c2497fb40267d3bdd2928 (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
;;; Dotfiles --- Jakub Dlugosz emacs config
;;; Commentary:
;; Custom keysets used in my emacs
;;; Code:

(use-package multiple-cursors
  :guix-package "emacs-multiple-cursors"
  :config
  (global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines)
  (global-set-key (kbd "C->") 'mc/mark-next-like-this)
  (global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
  (global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this))

(use-package hydra
  :guix-package "emacs-hydra"
  ;; :defer t
  :config
  (defun jd/text-scale-increase ()
    (interactive)
    (let ((old-face-attribute (face-attribute 'default :height)))
      (set-face-attribute 'default nil :height (+ old-face-attribute 10))))

  (defun jd/text-scale-decrease ()
    (interactive)
    (let ((old-face-attribute (face-attribute 'default :height)))
      (set-face-attribute 'default nil :height (- old-face-attribute 10))))

  (defhydra hydra-text-scale-global (:timeout 4)
    "scale text"
    ("j" jd/text-scale-increase "in")
    ("k" jd/text-scale-decrease "out")
    ("q" nil "finished" :exit t)) ;; TODO not working

  (defhydra hydra-text-scale (:timeout 4)
    "scale text"
    ("j" text-scale-increase "in")
    ("k" text-scale-decrease "out")
    ("q" nil "finished" :exit t)))

(use-package undo-tree
  :guix-package "emacs-undo-tree"
  :diminish
  :config
  (setq undo-tree-auto-save-history nil)
  (global-undo-tree-mode 1))

(provide 'jd-keys)

;;; jd-keys.el ends here