aboutsummaryrefslogtreecommitdiff
path: root/.emacs.d/rul-lisp/packages/rul-bindings.el
blob: 48426b5f4731561a53250be5160a9f8c2a73ed2c (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
;; Global keybindings
(global-set-key (kbd "C-c R") 'revert-buffer)
(global-set-key (kbd "C-c w") 'whitespace-cleanup)

(defun help/insert-em-dash ()
  "Inserts an EM-DASH (not a HYPEN, not an N-DASH)"
  (interactive)
  (insert "—"))

(global-set-key (kbd "C--") #'help/insert-em-dash)

(use-package hydra
  :ensure t
  :defer 1)

;; tab-bar
(defhydra hydra-tab-bar (:color amaranth)
  "Tab Bar Operations"
  ("t" tab-new "Create a new tab" :column "Creation" :exit t)
  ("d" dired-other-tab "Open Dired in another tab")
  ("f" find-file-other-tab "Find file in another tab")
  ("x" tab-close "Close current tab")
  ("m" tab-move "Move current tab" :column "Management")
  ("r" tab-rename "Rename Tab")
  ("<return>" tab-bar-select-tab-by-name "Select tab by name" :column "Navigation")
  ("l" tab-next "Next Tab")
  ("j" tab-previous "Previous Tab")
  ("q" nil "Exit" :exit t))

(global-set-key (kbd "C-x t") 'hydra-tab-bar/body)

;; Zoom
(defhydra hydra-zoom ()
  "zoom"
  ("g" text-scale-increase "in")
  ("l" text-scale-decrease "out"))

(global-set-key (kbd "C-c z") 'hydra-zoom/body)

;; Go
(defhydra hydra-go ()
  "zoom"
  ("=" gofmt :exit t)
  ("c" go-coverage :exit t))

;; vterm
(defhydra hydra-vterm ()
  "zoom"
  ("t" multi-vterm "Open a terminal" :exit t)
  ("d" multi-vterm-dedicated-open "Dedicated" :exit t)
  ("p" multi-vterm-prev "Previous terminal")
  ("n" multi-vterm-next "Next terminal")
  ("r" multi-vterm-rename-buffer "Rename buffer" :exit t)
  )

(global-set-key (kbd "C-c t") 'hydra-vterm/body)
(global-set-key (kbd "C-c m") 'hydra-go/body)

(use-package which-key
  :ensure t
  :config
  (which-key-mode)
)

(provide 'rul-bindings)
nihil fit ex nihilo