aboutsummaryrefslogtreecommitdiff
path: root/bard-emacs-modules/bard-emacs-keyboard.el
blob: 95a7b30c6db3c2235a7ced3fc79b01e5b612e755 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
;;; Vim Bindings
(use-package evil
  :ensure t
  :demand t
  :bind (("<escape>" . keyboard-escape-quit))
  :init
  ;; allows for using cgn
  ;; (setq evil-search-module 'evil-search)
  (setq evil-want-keybinding nil)
  ;; no vim insert bindings
  (setq evil-undo-system 'undo-fu)
  (setq evil-respect-visual-line-mode t)
  :config
  (evil-mode 1))

;;; Vim Bindings Everywhere else
(use-package evil-collection
  :ensure t
  :after evil
  :config
  (setq evil-want-integration t)
  (evil-collection-init))

(use-package undo-fu
  :ensure t)

(use-package general
  :ensure t
  :after evil
  :config
  (general-create-definer bard/leader-keys
    :states '(normal insert visual emacs)
    :prefix "SPC"
    :global-prefix "C-S-SPC")

  (bard/leader-keys

    ;; files
    "f"  '(:ignore t :which-key "files")
    "ff" '(find-file :which-key "find file")

    ;; buffers
    "b"  '(:ignore t :which-key "buffers")
    "bb" '(consult-buffer :which-key "switch buffer")
    "bk" '(kill-buffer :which-key "kill buffer")
    "bs" '(save-buffer :which-key "save buffer")

    ;; windows
    "w"  '(:ignore t :which-key "windows")
    "ws" '(split-window-below :which-key "split below")
    "wv" '(split-window-right :which-key "split right")
    "wo" '(other-window :which-key "other window")
    ;; "w0" '(delete-window :which-key "delete window")

    ;; projects
    "p" '(:ignore t :which-key "project")
    "pp" '(project-switch-project :which-key "project switch project")
    "pf" '(project-find-file :which-key "project find file")

    ;; notes
    "n" '(:ignore t :which-key "notes")
    "nn" '(denote :which-key "denote note")
    "nd" '(denote-sort-dired :which-key "denote dired")
    "nr" '(denote-rename-file-using-front-matter :which-key "denote rename")
    "nk" '(denote-rename-file-keywords :which-key "denote keywords")
    "nf" '(bard/find-notes-file :which-key "find notes")
    "ng" '(bard/search-notes-directory :which-key "search notes")
    "nN" '(denote-sequence :which-key "sequence note")
    "nD" '(denote-sequence-dired :which-key "sequence dired")
    "ni" '(org-roam-node-insert :which-key "insert link")
    "nl" '(org-roam-buffer-toggle :which-key "org roam buffer")
    "nu" '(org-roam-ui-open :which-key "org roam ui")

    ;; open
    "o" '(:ignore t :which-key "open")
    "oa" '(bard/default-agenda :which-key "agenda")
    "or" '(elfeed :which-key "RSS")
    "ow" '(eww :which-key "web browser")
    "op" '(bard/play-youtube-video :which-key "play video")
    "oi" '(bard/image-browser :which-key "images")
    "oc" '(org-capture :which-key "capture")
    "om" '(notmuch :which-key "email")
    "ob" '(consult-bookmark :which-key "bookmarks")
    "od" '(dired :which-key "new frame")
    "of" '(dired-jump :which-key "dired")

    ;; search
    "s" '(:ignore t :which-key "search")
    "sb" '(consult-line :which-key "search buffer")
    "sf" '(consult-find :which-key "search files")
    "sg" '(consult-grep :which-key "search grep")
    "so" '(consult-outline :which-key "search outline")

    ;; toggle
    "t" '(:ignore t :which-key "toggle")
    "tf" '(toggle-frame-fullscreen :which-key "fullscreen")
    "tf" '(toggle-frame-fullscreen :which-key "fullscreen")

    ;; help
    "h" '(:ignore t :which-key "help")
    "hr" '(info-emacs-manual :which-key "emacs manual")
    "hR" '(info-display-manual :which-key "emacs search manual")
    "hi" '(info :which-key "info")
    )
  

  )
(provide 'bard-emacs-keyboard)