diff options
Diffstat (limited to 'emacs.org')
-rwxr-xr-x | emacs.org | 147 |
1 files changed, 71 insertions, 76 deletions
@@ -1,3 +1,4 @@ + #+TITLE: Emacs Configuration #+AUTHOR: Thanos Apollo #+PROPERTY: header-args :tangle ~/.emacs.d/init.el :mkdirp yes @@ -42,15 +43,12 @@ Define essential keybindings ** Paths #+begin_src emacs-lisp - ;; (add-to-list 'load-path "/usr/share/emacs/site-lisp/elpa/mu4e-1.8.14") - (when is-zeus - (guix-emacs-autoload-packages)) + (add-to-list 'load-path "/usr/share/emacs/site-lisp/elpa/mu4e-1.8.14") #+end_src - * Setting Up Packages ** List of required packages Request the following packages: -#+begin_src emacs-lisp +#+begin_src emacs-lisp (defvar thanos/packages '(emms tree-sitter org-snooze org-drill all-the-icons all-the-icons-dired all-the-icons-ivy-rich toc-org emojify @@ -66,8 +64,7 @@ Request the following packages: org-superstar pdf-tools org-auto-tangle sly org-download eshell-git-prompt eshell-vterm hackernews circe gptel beacon ement mu4e-alert - pass eat - )) + pass eat nov)) #+end_src ** Installation & activation Set ~package-archives~, and install packages @@ -78,9 +75,9 @@ Set ~package-archives~, and install packages ;; Activate all the packages (package-initialize) ;; Install the missing packages - ;; (dolist (package thanos/packages) - ;; (unless (package-installed-p package) - ;; (package-install package))) + (dolist (package thanos/packages) + (unless (package-installed-p package) + (package-install package))) ;; Set and load custom.el (setq custom-file (concat user-emacs-directory "custom.el")) @@ -205,7 +202,7 @@ Fonts and basic appearance settings for each device (setq counsel-describe-function-function #'helpful-callable) (setq counsel-describe-variable-function #'helpful-variable) #+end_src -* Navigation +** Navigation #+begin_src emacs-lisp (global-set-key (kbd "C-x r d") 'bookmark-delete) (global-set-key (kbd "C-x r C-r") 'bookmark-rename) @@ -282,16 +279,12 @@ Generate a random password between 20 and 40 characters (internal-border-width . 10) (width . 80) (height . 11))) - (if is-zeus - (progn - (load-file "~/Developer/emacs-app-launcher/app-launcher.el") - (app-launcher-run-app)) - (counsel-linux-app)) + (counsel-linux-app) (delete-frame))))) #+end_src * VM Manager #+begin_src emacs-lisp - (defvar vm-directory "~/VirtualMachines/") + (defvar vm-directory "~/virtual-machines/") (defun vm-create-image () "Create qcow2 image." @@ -312,9 +305,9 @@ Generate a random password between 20 and 40 characters (read-file-name "ISO: ") nil))) (async-shell-command - (format "qemu-system-x86_64 -enable-kvm -m %s -smp %s -hda %s -vga qxl -device virtio-serial-pci -spice port=5930,disable-ticketing=on -display spice-app %s " + (format "qemu-system-x86_64 -enable-kvm -m %s -smp %s -hda %s -vga qxl -device virtio-serial-pci -spice port=5784,disable-ticketing -display spice-app %s " memory cores image (if iso (concat "-cdrom " iso) ""))))) -#+end_src +#+end_src * Dired ** Functions #+begin_src emacs-lisp @@ -351,6 +344,7 @@ Generate a random password between 20 and 40 characters (define-key dired-mode-map (kbd "v") 'dired-watch-video) (define-key dired-mode-map (kbd "z") 'wdired-change-to-wdired-mode) (define-key dired-mode-map (kbd "C-c w") 'dired-set-wallpaper) + (define-key global-map (kbd "C-c d") 'delete-files-except) #+end_src ** All-the-icons #+begin_src emacs-lisp @@ -616,8 +610,8 @@ Generate a random password between 20 and 40 characters #+end_src * Memorize #+begin_src emacs-lisp - (when is-zeus - (load-file "~/Developer/memorize/memorize.el")) + ;; (when is-zeus + ;; (load-file "~/Developer/memorize/memorize.el")) #+end_src * Markdown ** Theme @@ -635,7 +629,7 @@ Generate a random password between 20 and 40 characters (add-to-list 'auto-mode-alist '("\\.md\\'" . gfm-mode)) (setq markdown-command "multimarkdown") #+end_src -* Programming +* DevTools ** Essentials #+begin_src emacs-lisp (electric-pair-mode 1) @@ -832,16 +826,6 @@ Create function to watch videos using ~mpv~ (elfeed-goodies/setup) #+end_src -* PDF -#+begin_src emacs-lisp - (require 'pdf-tools) - (pdf-tools-install) - ;;Add pdf-isearch-minor-mode hook, otherwise isearch will be buggy - ;;Darkmode hook, cause I don't want color or light in my life, I'm a vampire. - (add-hook 'pdf-view-mode-hook 'pdf-isearch-minor-mode) - (add-hook 'pdf-view-mode-hook 'pdf-view-midnight-minor-mode) - (add-to-list 'auto-mode-alist '("\\.pdf\\'" . 'pdf-view-mode)) -#+end_src * mu4e ** Setting up mail #+begin_src emacs-lisp @@ -884,8 +868,7 @@ Create function to watch videos using ~mpv~ '(("/Public/Inbox" . ?I) ("/Inbox" . ?i) ("/Sent" . ?s) - ("/Guix/patches" . ?g) - )) + ("/Guix" . ?g))) (setq mu4e-contexts (list @@ -952,28 +935,13 @@ Create function to watch videos using ~mpv~ #+begin_src emacs-lisp (require 'mu4e-alert) (mu4e-alert-enable-mode-line-display) - (mu4e-alert-enable-notifications) #+end_src ** Keybindings #+begin_src emacs-lisp (define-key thanos/applications-map (kbd "m") 'mu4e) #+end_src -* EMMS -#+begin_src emacs-lisp - (require 'emms) - (emms-all) - (setq emms-player-list '(emms-player-mpv) - emms-player-mpv-parameters '("--no-video") - emms-info-functions '(emms-info-native) - emms-playlist-buffer-name "*Music*" - emms-source-file-default-directory "~/Music/jazz") -#+end_src -** Keybindings -#+begin_src emacs-lisp - (define-key 'thanos/applications-map (kbd "e") 'emms) - (define-key emms-playlist-mode-map (kbd "A") 'emms-add-directory-tree) -#+end_src -* Eshell +* Shells +** Eshell ** Configuration with Eat #+begin_src emacs-lisp (setq eshell-visual-commands '()) @@ -1258,7 +1226,7 @@ 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 +** Vterm #+begin_src emacs-lisp (defvar thanos/vterm-map (make-sparse-keymap)) (define-prefix-command 'thanos/vterm-map) @@ -1268,24 +1236,6 @@ Set aliases for emacs functions and ~PATH~ (define-key thanos/vterm-map (kbd "d") 'multi-vterm-dedicated-open) (define-key thanos/vterm-map (kbd "o") 'multi-vterm) #+end_src -* ERC -#+begin_src emacs-lisp - ;;; Code: - (require 'erc) - - (setq erc-modules - '(sasl netsplit fill button match track completion readonly - networks ring autojoin noncommands irccontrols move-to-prompt stamp - menu list)) - - (defun erc-libera () - (interactive) - "Login to liberachat with erc." - (erc-tls :server "irc.libera.chat" :port 6697 - :nick "thanosapollo" - :user "thanosapollo" - :password (password-store-get "liberachat/thanos_apollo"))) -#+end_src ** Keybindings #+begin_src emacs-lisp (define-key thanos/applications-map (kbd "i") 'erc-libera) @@ -1297,7 +1247,8 @@ Set aliases for emacs functions and ~PATH~ (setq gptel-api-key (password-store-get "chatgpt/api") gptel-model 'gpt-4-32k) #+end_src -* YeeTube +* Multimedia +** YeeTube #+begin_src emacs-lisp (when is-zeus (load-file "~/Developer/yeetube.el/yeetube.el")) @@ -1317,7 +1268,9 @@ Set aliases for emacs functions and ~PATH~ (define-key yeetube-mode-map (kbd "c") 'yeetube-switch-mpv) #+end_src -** download via ffmpeg + ++ Use ~ffmpeg~ to download videos + #+begin_src emacs-lisp (defun yeetube-download-videos-ffmpeg () "Download one or multiple videos using yt-dlp. @@ -1349,7 +1302,20 @@ Set aliases for emacs functions and ~PATH~ url (shell-quote-argument name))))))) #+end_src -* Ement +** EMMS +#+begin_src emacs-lisp + (require 'emms) + (emms-all) + (setq emms-player-list '(emms-player-mpv) + emms-player-mpv-parameters '("--no-video") + emms-info-functions '(emms-info-native) + emms-playlist-buffer-name "*Music*" + emms-source-file-default-directory "~/Music/jazz") + (define-key 'thanos/applications-map (kbd "e") 'emms) + (define-key emms-playlist-mode-map (kbd "A") 'emms-add-directory-tree) +#+end_src +* Chat +** Ement #+begin_src emacs-lisp (defun ement-login () (interactive) @@ -1360,11 +1326,39 @@ Set aliases for emacs functions and ~PATH~ (define-key thanos/applications-map (kbd "M-e") 'ement-login) #+end_src -* StumpWM +** ERC +#+begin_src emacs-lisp + ;;; Code: + (require 'erc) + + (setq erc-modules + '(sasl netsplit fill button match track completion readonly + networks ring autojoin noncommands irccontrols move-to-prompt stamp + menu list)) + + (defun erc-libera () + (interactive) + "Login to liberachat with erc." + (erc-tls :server "irc.libera.chat" :port 6697 + :nick "thanosapollo" + :user "thanosapollo" + :password (password-store-get "liberachat/thanos_apollo"))) +#+end_src +* Extras +** StumpWM #+begin_src emacs-lisp (setq stumpwm-shell-program "~/.stumpwm.d/modules/util/stumpish/stumpish") #+end_src -* Misc +** pdf-tools +#+begin_src emacs-lisp + (require 'pdf-tools) + (pdf-tools-install) + ;;Add pdf-isearch-minor-mode hook, otherwise isearch will be buggy + ;;Darkmode hook, cause I don't want color or light in my life, I'm a vampire. + (add-hook 'pdf-view-mode-hook 'pdf-isearch-minor-mode) + (add-hook 'pdf-view-mode-hook 'pdf-view-midnight-minor-mode) + (add-to-list 'auto-mode-alist '("\\.pdf\\'" . 'pdf-view-mode)) +#+end_src ** Random functions #+begin_src emacs-lisp (defun thanos/center-buffer () @@ -1448,7 +1442,8 @@ Set aliases for emacs functions and ~PATH~ "create a scratch buffer" (interactive) (switch-to-buffer (get-buffer-create "*Text Scratch*")) - (org-mode)) + (markdown-mode) + (gptel-mode)) (define-key Create (kbd "t") 'create-text-scratch) |