summaryrefslogtreecommitdiff
path: root/emacs.org
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-06-04 06:40:24 +0300
committerThanos Apollo <[email protected]>2023-06-04 06:40:24 +0300
commit1b4b6efd6f786bf2708798dceb47181231e59e96 (patch)
treea3562693914b4f6031d0fc7776e2db827ebb32f7 /emacs.org
parentc03f85213813fb54324b73402bf0608207e2fd04 (diff)
emacs: restructure keybindings
Remove Misc Keybindings and add them under each respective category
Diffstat (limited to 'emacs.org')
-rwxr-xr-xemacs.org120
1 files changed, 45 insertions, 75 deletions
diff --git a/emacs.org b/emacs.org
index aeba0f3..a109755 100755
--- a/emacs.org
+++ b/emacs.org
@@ -20,6 +20,16 @@ Set backup fails at ~~/Trash~
#+begin_src emacs-lisp
(setq backup-directory-alist '((".*" . "~/.Trash")))
#+end_src
+Define essential keybindings
+#+begin_src emacs-lisp
+ (define-prefix-command 'thanos/applications-map)
+ (global-set-key (kbd "C-c a") 'thanos/applications-map)
+
+ (define-prefix-command 'Create)
+ (define-key thanos/applications-map (kbd "C-c") 'Create)
+
+ (global-set-key (kbd "<escape>") 'keyboard-escape-quit)
+#+end_src
* Setting up Packages
** List of required packages
Request the following packages:
@@ -188,7 +198,6 @@ Fonts and basic appearance settings for each device
(ivy-mode 1)
;(setq ivy-use-virtual-buffers t)
;(setq enable-recursive-minibuffers t)
- ;; keybindings
(global-set-key (kbd "C-s") 'swiper)
(define-key ivy-minibuffer-map (kbd "TAB") 'ivy-alt-done)
(global-set-key "\C-s" 'swiper)
@@ -213,6 +222,9 @@ Fonts and basic appearance settings for each device
(all-the-icons-ivy-rich-mode 1)
(setq ivy-use-selectable-prompt t)
+
+ (global-set-key (kbd "C-c m") 'consult-imenu)
+ (define-key thanos/applications-map (kbd "t") 'counsel-load-theme)
#+end_src
** Helpful
#+begin_src emacs-lisp
@@ -228,6 +240,13 @@ Fonts and basic appearance settings for each device
(setq counsel-describe-function-function #'helpful-callable)
(setq counsel-describe-variable-function #'helpful-variable)
#+end_src
+* Pass
+** Keybindings
+#+begin_src emacs-lisp
+ (global-set-key (kbd "C-c p i") 'password-store-insert)
+ (global-set-key (kbd "C-c p e") 'password-store-edit)
+ (global-set-key (kbd "C-c p g") 'password-store-generate)
+#+end_src
* Dired
** Functions
#+begin_src emacs-lisp
@@ -517,6 +536,7 @@ Fonts and basic appearance settings for each device
(electric-pair-mode 1)
(global-flycheck-mode)
(global-set-key (kbd "M-.") 'xref-find-definitions)
+ (global-set-key (kbd "C-c l") 'display-line-numbers-mode)
(require 'company)
(add-hook 'after-init-hook 'global-company-mode)
@@ -659,6 +679,7 @@ Create function to watch videos using ~mpv~
#+begin_src emacs-lisp
(define-key elfeed-search-mode-map (kbd "v") 'elfeed-view-mpv)
(define-key elfeed-search-mode-map (kbd "U") 'elfeed-update)
+ (define-key thanos/applications-map (kbd "f") 'elfeed)
(setq elfeed-goodies/entry-pane-size 0.55)
(elfeed-goodies/setup)
@@ -726,7 +747,6 @@ Create function to watch videos using ~mpv~
(setq message-send-mail-function 'smtpmail-send-it
smtpmail-stream-type 'ssl))
#+end_src
-
** Actions
#+begin_src emacs-lisp
(setq mu4e-view-actions
@@ -739,6 +759,10 @@ Create function to watch videos using ~mpv~
("crun checkpatch script" . my-mu4e-action-run-check-patch)
("MCheck if merged" . my-mu4e-action-check-if-merged)))))
#+end_src
+** Keybindings
+#+begin_src emacs-lisp
+ (define-key thanos/applications-map (kbd "m") 'mu4e)
+#+end_src
* EMMS
#+begin_src emacs-lisp
(emms-all)
@@ -750,7 +774,7 @@ Create function to watch videos using ~mpv~
#+end_src
** Keybindings
#+begin_src emacs-lisp
- (global-set-key (kbd "C-c e") 'emms)
+ (define-key 'thanos/applications-map (kbd "e") 'emms)
#+end_src
* Eshell
First let's set ~eshell-visual-commands~
@@ -1029,8 +1053,19 @@ Set aliases for emacs functions and ~PATH~
(define-key thanos/eshell-map (kbd "o") 'multi-eshell)
(define-key thanos/eshell-map (kbd "n") 'multi-eshell-switch)
#+end_src
+* Vterm
+#+begin_src emacs-lisp
+ (defvar thanos/vterm-map (make-sparse-keymap))
+ (define-prefix-command 'thanos/vterm-map)
+ (define-key global-map (kbd "C-c v") 'thanos/vterm-map)
+ (define-key thanos/vterm-map (kbd "n") 'multi-vterm-next)
+ (define-key thanos/vterm-map (kbd "p") 'multi-vterm-prev)
+ (define-key thanos/vterm-map (kbd "d") 'multi-vterm-dedicated-open)
+ (define-key thanos/vterm-map (kbd "o") 'multi-vterm)
+#+end_src
* Circe
#+begin_src emacs-lisp
+ (require 'circe)
(setq circe-network-options
`(("Libera Chat"
:tls t
@@ -1041,32 +1076,13 @@ Set aliases for emacs functions and ~PATH~
"#emacs"
"#systemcrafters"))))
#+end_src
+** Keybindings
+#+begin_src emacs-lisp
+ (define-key thanos/applications-map (kbd "i") 'circe)
+#+end_src
* Misc
** Random functions
#+begin_src emacs-lisp
- (defun thanos/html-boostrap-boilerplate ()
- "Insert html boilerplate with boostrap link."
- (interactive)
- (insert
- "<!DOCTYPE html>
- <html lang=\"en\">
- <head>
- <meta charset=\"UTF-8\">
- <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
- <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">
- <title>My Title</title>
- <link rel=\"stylesheet\" href=\"./style.css\">
- <link href=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi\" crossorigin=\"anonymous\">
- p </head>
- <body>
- <main>
- <h1>Starting point</h1>
- </main>
- <script src=\"index.js\"></script>
- </body>
- </html>" ))
-
-
(defun thanos/center-buffer ()
"Centers/Uncenters selected buffer"
(interactive)
@@ -1150,60 +1166,14 @@ Set aliases for emacs functions and ~PATH~
(switch-to-buffer (get-buffer-create "*Text Scratch*"))
(text-mode))
+ (define-key Create (kbd "t") 'create-text-scratch)
+
(defun create-scratch ()
(interactive)
(switch-to-buffer (get-buffer-create "*scratch*"))
(emacs-lisp-mode))
- (defun get-mail-pass ()
- (interactive)
- ;; Get fastmail API Key
- (insert
- (password-store-get-field "fastmail.com/thanosapollo.com" "API")))
-
- (global-set-key (kbd "C-c p m") 'get-mail-pass)
-
- ;;
-#+end_src
-** Chatgpt
-#+begin_src emacs-lisp
- (setq openai-key (password-store-get "chatgpt/api"))
-#+end_src
-** Keybindings
-#+begin_src emacs-lisp
- (global-set-key (kbd "<escape>") 'keyboard-escape-quit)
-
- ;; Pass
- (global-set-key (kbd "C-c p i") 'password-store-insert)
- (global-set-key (kbd "C-c p e") 'password-store-edit)
- (global-set-key (kbd "C-c p g") 'password-store-generate)
-
- ;; Imenu
- (global-set-key (kbd "C-c m") 'consult-imenu)
-
- ;; Line numbers
- (global-set-key (kbd "C-c l") 'display-line-numbers-mode)
-
- (define-prefix-command 'thanos/applications-map)
- (define-key thanos/applications-map (kbd "q") 'chatgpt-query)
- (define-key thanos/applications-map (kbd "m") 'mu4e)
- (define-key thanos/applications-map (kbd "t") 'counsel-load-theme)
- (define-key thanos/applications-map (kbd "f") 'elfeed)
- (define-key thanos/applications-map (kbd "i") 'circe)
- (global-set-key (kbd "C-c a") 'thanos/applications-map)
-
- (define-prefix-command 'Create)
- (define-key thanos/applications-map (kbd "C-c") 'Create)
- (define-key Create (kbd "t") 'create-text-scratch)
-
-
- (defvar thanos/vterm-map (make-sparse-keymap))
- (define-prefix-command 'thanos/vterm-map)
- (define-key global-map (kbd "C-c v") 'thanos/vterm-map)
- (define-key thanos/vterm-map (kbd "n") 'multi-vterm-next)
- (define-key thanos/vterm-map (kbd "p") 'multi-vterm-prev)
- (define-key thanos/vterm-map (kbd "d") 'multi-vterm-dedicated-open)
- (define-key thanos/vterm-map (kbd "o") 'multi-vterm)
+ (define-key Create (kbd "e") 'create-scratch)
#+end_src