summaryrefslogtreecommitdiffstats
path: root/.emacs.d/jd/jd-keys.el
diff options
context:
space:
mode:
Diffstat (limited to '.emacs.d/jd/jd-keys.el')
-rwxr-xr-x.emacs.d/jd/jd-keys.el115
1 files changed, 115 insertions, 0 deletions
diff --git a/.emacs.d/jd/jd-keys.el b/.emacs.d/jd/jd-keys.el
new file mode 100755
index 0000000..7c0d6b2
--- /dev/null
+++ b/.emacs.d/jd/jd-keys.el
@@ -0,0 +1,115 @@
1;;; Dotfiles --- Jakub Dlugosz emacs config
2;;; Commentary:
3
4;;; Code:
5
6;; (jd/use-package evil "emacs-evil"
7;; :init
8;; (setq evil-want-integration t)
9;; (setq evil-want-keybinding nil)
10;; (setq evil-want-C-u-scroll t)
11;; (setq evil-want-Y-yank-to-eol t)
12;; (setq evil-want-C-i-jump nil)
13;; (setq evil-undo-system 'undo-tree)
14;; (setq evil-kill-on-visual-paste nil)
15;; :config
16;; (evil-set-initial-state 'exwm-mode 'emacs)
17;; (evil-mode 1))
18
19(jd/use-package general "emacs-general"
20 :config
21 (general-create-definer jd/leader-key-def
22 :keymaps '(normal insert visual emacs)
23 :prefix "SPC"
24 :global-prefix "C-z")
25
26 (general-create-definer jd/ctrl-c-keys
27 :prefix "C-c")
28
29 ;; (jd/leader-key-def
30 ;; "w" 'evil-window-map
31 ;; "wr" '(hydra-resize-window/body :which-key "Rezize window")
32 ;; "wd" '(evil-window-delete :which-key "Window delete"))
33
34 (jd/leader-key-def
35 "ou" '(undo-tree-visualize :which-key "Open"))
36
37 ;; remove . key
38 ;; (define-key evil-normal-state-map (kbd ".") '())
39 (jd/leader-key-def
40 "f" '(:ignore t :which-key "Files")
41 "fs" '(save-buffer :which-key "File save")
42 "." '(find-file :which-key "Find file")
43 "ff" '(find-file :which-key "Find file"))
44
45 (jd/leader-key-def
46 "e" '(:ignore t :which-key "Eval")
47 "eb" '(eval-buffer :which-key "Eval buffer")
48 "ee" '(eval-defun :which-key "Eval defun"))
49
50 (jd/leader-key-def
51 :keymaps '(visual)
52 "er" '(eval-region :which-key "Eval region"))
53
54 (defun jd/kill-other-buffers ()
55 (interactive)
56 (mapc 'kill-buffer (cdr (buffer-list (current-buffer)))))
57
58 (jd/leader-key-def
59 "bK" '(jd/kill-other-buffers :which-key "Kill other buffers")
60 "bk" '(kill-current-buffer :which-key "Kill buffer")
61 "bB" '(ibuffer :which-key "Open ibuffer")))
62
63
64(jd/use-package hydra "emacs-hydra"
65 ;; :defer t
66 :config
67 (defun jd/text-scale-increase ()
68 (interactive)
69 (let ((old-face-attribute (face-attribute 'default :height)))
70 (set-face-attribute 'default nil :height (+ old-face-attribute 10))))
71
72 (defun jd/text-scale-decrease ()
73 (interactive)
74 (let ((old-face-attribute (face-attribute 'default :height)))
75 (set-face-attribute 'default nil :height (- old-face-attribute 10))))
76
77 ;; (defhydra hydra-resize-window (:timeout 4)
78 ;; ("h" evil-window-decrease-width "<")
79 ;; ("l" evil-window-increase-width ">")
80 ;; ("k" evil-window-decrease-height "^")
81 ;; ("j" evil-window-increase-height "v")
82 ;; ("q" nil "finished" :exit t))
83
84 (defhydra hydra-text-scale-global (:timeout 4)
85 "scale text"
86 ("j" jd/text-scale-increase "in")
87 ("k" jd/text-scale-decrease "out")
88 ("q" nil "finished" :exit t))
89
90 (defhydra hydra-text-scale (:timeout 4)
91 "scale text"
92 ("j" text-scale-increase "in")
93 ("k" text-scale-decrease "out")
94 ("q" nil "finished" :exit t))
95
96 (jd/leader-key-def
97 "tS" '(hydra-text-scale-global/body :which-key "Scale text")
98 "ts" '(hydra-text-scale/body :which-key "Scale text")))
99
100
101(jd/use-package undo-tree "emacs-undo-tree"
102 :diminish
103 :config
104 (setq undo-tree-auto-save-history nil)
105 (global-undo-tree-mode 1))
106
107;; (jd/use-package evil-collection "emacs-evil-collection"
108;; :after evil
109;; :config
110;; (evil-collection-init))
111
112
113(provide 'jd-keys)
114
115;;; jd-keys.el ends here