feat(emcas): remote server optionation

This commit is contained in:
Pavel Korytov 2021-09-18 11:45:13 +03:00
parent 4f0dbc0529
commit 0fb670bf08
2 changed files with 138 additions and 83 deletions

View file

@ -25,6 +25,21 @@
(eval-when-compile (require 'use-package)) (eval-when-compile (require 'use-package))
;; (setq use-package-verbose t) ;; (setq use-package-verbose t)
(setq my/lowpower (string= (system-name) "azure"))
(setq my/slow-ssh
(or
(string= (getenv "IS_TRAMP") "true")
(string= (system-name) "dev-digital")))
(setq my/remote-server
(or (string= (getenv "IS_REMOTE") "true")
(string= (system-name) "dev-digital")))
(setq my/is-termux (string-match-p (rx (* nonl) "com.termux" (* nonl)) (getenv "HOME")))
(setenv "IS_EMACS" "true")
(setq gc-cons-threshold 80000000) (setq gc-cons-threshold 80000000)
(setq read-process-output-max (* 1024 1024)) (setq read-process-output-max (* 1024 1024))
@ -37,12 +52,6 @@
(garbage-collect)))) (garbage-collect))))
(add-hook 'after-focus-change-function 'garbage-collect)))) (add-hook 'after-focus-change-function 'garbage-collect))))
(setq my/lowpower (string= (system-name) "azure"))
(setq my/slow-ssh (string= (getenv "IS_TRAMP") "true"))
(setq my/is-termux (string-match-p (rx (* nonl) "com.termux" (* nonl)) (getenv "HOME")))
(when my/lowpower (when my/lowpower
(setq comp-async-jobs-number 1)) (setq comp-async-jobs-number 1))
@ -59,8 +68,6 @@
(unless (getenv "CONDA_DEFAULT_ENV") (unless (getenv "CONDA_DEFAULT_ENV")
(conda-env-activate "general"))) (conda-env-activate "general")))
(setenv "IS_EMACS" "true")
(setq custom-file (concat user-emacs-directory "custom.el")) (setq custom-file (concat user-emacs-directory "custom.el"))
(load custom-file 'noerror) (load custom-file 'noerror)
@ -615,7 +622,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(use-package company-box (use-package company-box
:straight t :straight t
:if (not my/lowpower) :if (and (display-graphic-p) (not my/lowpower))
:after (company) :after (company)
:hook (company-mode . company-box-mode)) :hook (company-mode . company-box-mode))
@ -672,7 +679,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(use-package wakatime-mode (use-package wakatime-mode
:straight (:host github :repo "SqrtMinusOne/wakatime-mode") :straight (:host github :repo "SqrtMinusOne/wakatime-mode")
:if (not my/is-termux) :if (not (or my/is-termux my/remote-server))
:config :config
(setq wakatime-ignore-exit-codes '(0 1 102)) (setq wakatime-ignore-exit-codes '(0 1 102))
(advice-add 'wakatime-init :after (lambda () (setq wakatime-cli-path "/home/pavel/bin/wakatime-cli"))) (advice-add 'wakatime-init :after (lambda () (setq wakatime-cli-path "/home/pavel/bin/wakatime-cli")))
@ -684,7 +691,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(use-package activity-watch-mode (use-package activity-watch-mode
:straight t :straight t
:if (not my/is-termux) :if (not (or my/is-termux my/remote-server))
:config :config
(global-activity-watch-mode)) (global-activity-watch-mode))
@ -870,12 +877,12 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(use-package emojify (use-package emojify
:straight t :straight t
:if (not (or my/lowpower my/is-termux)) :if (and (display-graphic-p) (not (or my/lowpower my/is-termux)))
:hook (after-init . global-emojify-mode)) :hook (after-init . global-emojify-mode))
(use-package ligature (use-package ligature
:straight (:host github :repo "mickeynp/ligature.el") :straight (:host github :repo "mickeynp/ligature.el")
:if (not my/is-termux) :if (display-graphic-p)
:config :config
(ligature-set-ligatures (ligature-set-ligatures
'( '(
@ -910,6 +917,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(global-ligature-mode t)) (global-ligature-mode t))
(use-package all-the-icons (use-package all-the-icons
:if (display-graphic-p)
:straight t) :straight t)
(use-package hl-todo (use-package hl-todo
@ -992,7 +1000,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(use-package all-the-icons-dired (use-package all-the-icons-dired
:straight t :straight t
:if (not (or my/lowpower my/slow-ssh)) :if (not (or my/lowpower my/slow-ssh (not (display-graphic-p))))
:hook (dired-mode . (lambda () :hook (dired-mode . (lambda ()
(unless (string-match-p "/gnu/store" default-directory) (unless (string-match-p "/gnu/store" default-directory)
(all-the-icons-dired-mode)))) (all-the-icons-dired-mode))))
@ -1151,6 +1159,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(kill-buffer (current-buffer)) (kill-buffer (current-buffer))
(select-window vterm-window)) (select-window vterm-window))
(vterm-other-window "vterm-subterminal")))) (vterm-other-window "vterm-subterminal"))))
(unless my/slow-ssh (unless my/slow-ssh
(general-nmap "`" 'my/toggle-vterm-subteminal) (general-nmap "`" 'my/toggle-vterm-subteminal)
(general-nmap "~" 'vterm)) (general-nmap "~" 'vterm))
@ -1229,6 +1238,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(use-package org (use-package org
:straight t :straight t
:if (not my/remote-server)
:defer t :defer t
:config :config
(setq org-startup-indented t) (setq org-startup-indented t)
@ -1357,22 +1367,13 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(setq org-directory (expand-file-name "~/Documents/org-mode")) (setq org-directory (expand-file-name "~/Documents/org-mode"))
(setq org-agenda-files '("inbox.org" "projects.org" "work.org" "sem-11.org" "life.org")) (setq org-agenda-files '("inbox.org" "projects.org" "work.org" "sem-11.org" "life.org"))
;; (setq org-default-notes-file (concat org-directory "/notes.org")) ;; (setq org-default-notes-file (concat org-directory "/notes.org"))
(setq org-capture-templates
`(("i" "Inbox" entry (file "inbox.org")
,(concat "* TODO %?\n"
"/Entered on/ %U"))
("e" "email" entry (file "inbox.org")
,(concat "* TODO %:from %:subject \n"
"/Entered on/ %U\n"
"/Received on/ %:date-timestamp-inactive\n"
"%a\n"))
("f" "elfeed" entry (file "inbox.org")
,(concat "* TODO %:elfeed-entry-title\n"
"/Entered on/ %U\n"
"%a\n"))))
(add-to-list 'org-global-properties (add-to-list 'org-global-properties
'("Effort_ALL" . "0 0:05 0:10 0:15 0:30 0:45 1:00 2:00 4:00")) '("Effort_ALL" . "0 0:05 0:10 0:15 0:30 0:45 1:00 2:00 4:00"))
(setq org-log-done 'time)) (setq org-log-done 'time)
(use-package org-ql
:straight (:fetcher github
:repo "alphapapa/org-ql"
:files (:defaults (:exclude "helm-org-ql.el")))))
(require 'org-crypt) (require 'org-crypt)
(org-crypt-use-before-save-magic) (org-crypt-use-before-save-magic)
@ -1548,6 +1549,20 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(setq org-refile-use-outline-path 'file) (setq org-refile-use-outline-path 'file)
(setq org-outline-path-complete-in-steps nil) (setq org-outline-path-complete-in-steps nil)
(setq org-capture-templates
`(("i" "Inbox" entry (file "inbox.org")
,(concat "* TODO %?\n"
"/Entered on/ %U"))
("e" "email" entry (file "inbox.org")
,(concat "* TODO %:from %:subject \n"
"/Entered on/ %U\n"
"/Received on/ %:date-timestamp-inactive\n"
"%a\n"))
("f" "elfeed" entry (file "inbox.org")
,(concat "* TODO %:elfeed-entry-title\n"
"/Entered on/ %U\n"
"%a\n"))))
(defun my/org-scheduled-get-time () (defun my/org-scheduled-get-time ()
(let ((scheduled (org-get-scheduled-time (point)))) (let ((scheduled (org-get-scheduled-time (point))))
(if scheduled (if scheduled
@ -1572,11 +1587,6 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
((tags-todo "personal" ((tags-todo "personal"
((org-agenda-prefix-format " %i %-12:c [%e] "))))))) ((org-agenda-prefix-format " %i %-12:c [%e] ")))))))
(use-package org-ql
:straight (:fetcher github
:repo "alphapapa/org-ql"
:files (:defaults (:exclude "helm-org-ql.el"))))
(setq my/git-diff-status (setq my/git-diff-status
'(("A" . added) '(("A" . added)
("C" . copied) ("C" . copied)
@ -1756,6 +1766,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(use-package org-journal (use-package org-journal
:straight t :straight t
:if (not my/remote-server)
:after org :after org
:config :config
(setq org-journal-dir (concat org-directory "/journal")) (setq org-journal-dir (concat org-directory "/journal"))
@ -1802,7 +1813,8 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(use-package org-roam (use-package org-roam
:straight (:host github :repo "org-roam/org-roam" :straight (:host github :repo "org-roam/org-roam"
:files (:defaults "extensions/*.el")) :files (:defaults "extensions/*.el"))
:if (not my/remote-server)
:after org :after org
:init :init
(setq org-roam-directory (concat org-directory "/roam")) (setq org-roam-directory (concat org-directory "/roam"))
@ -1846,6 +1858,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(use-package org-ref (use-package org-ref
:straight (:files (:defaults (:exclude "*helm*"))) :straight (:files (:defaults (:exclude "*helm*")))
:if (not my/remote-server)
:init :init
(setq org-ref-completion-library 'org-ref-ivy-cite) (setq org-ref-completion-library 'org-ref-ivy-cite)
(setq bibtex-dialect 'biblatex) (setq bibtex-dialect 'biblatex)
@ -1984,6 +1997,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(use-package org-present (use-package org-present
:straight (:host github :repo "rlister/org-present") :straight (:host github :repo "rlister/org-present")
:if (not my/remote-server)
:commands (org-present) :commands (org-present)
:config :config
(general-define-key (general-define-key
@ -2017,6 +2031,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(use-package org-make-toc (use-package org-make-toc
:after (org) :after (org)
:if (not my/remote-server)
:commands :commands
(org-make-toc (org-make-toc
org-make-toc-insert org-make-toc-insert
@ -2094,7 +2109,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(use-package lsp-mode (use-package lsp-mode
:straight t :straight t
:if (not (or my/slow-ssh my/is-termux)) :if (not (or my/slow-ssh my/is-termux my/remote-server))
:hook ( :hook (
(typescript-mode . lsp) (typescript-mode . lsp)
(vue-mode . lsp) (vue-mode . lsp)
@ -2138,6 +2153,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
;; (add-hook 'lsp-after-open-hook #'lsp-origami-try-enable)) ;; (add-hook 'lsp-after-open-hook #'lsp-origami-try-enable))
(use-package lsp-treemacs (use-package lsp-treemacs
:after (lsp)
:straight t :straight t
:commands lsp-treemacs-errors-list) :commands lsp-treemacs-errors-list)
@ -2178,6 +2194,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(use-package tree-sitter (use-package tree-sitter
:straight t :straight t
:if (not my/remote-server)
:hook ((typescript-mode . my/tree-sitter-if-not-mmm) :hook ((typescript-mode . my/tree-sitter-if-not-mmm)
(js-mode . my/tree-sitter-if-not-mmm) (js-mode . my/tree-sitter-if-not-mmm)
(python-mode . tree-sitter-mode) (python-mode . tree-sitter-mode)
@ -3122,11 +3139,12 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(general-define-key "C-c f" 'my/open-yadm-file) (general-define-key "C-c f" 'my/open-yadm-file)
(my-leader-def "cf" 'my/open-yadm-file) (my-leader-def "cf" 'my/open-yadm-file)
(unless my/is-termux (unless (or my/is-termux my/remote-server)
(load-file (expand-file-name "mail.el" user-emacs-directory))) (load-file (expand-file-name "mail.el" user-emacs-directory)))
(use-package elfeed (use-package elfeed
:straight (:repo "SqrtMinusOne/elfeed" :host github) :straight (:repo "SqrtMinusOne/elfeed" :host github)
:if (not my/remote-server)
:commands (elfeed) :commands (elfeed)
:init :init
(my-leader-def "ae" 'elfeed) (my-leader-def "ae" 'elfeed)
@ -3208,6 +3226,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(use-package emms (use-package emms
:straight t :straight t
:if (not my/remote-server)
:commands (emms-smart-browse :commands (emms-smart-browse
emms-browser emms-browser
emms-add-url emms-add-url
@ -3245,7 +3264,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(emms-player-simple-regexp (emms-player-simple-regexp
"m3u" "ogg" "flac" "mp3" "wav" "mod" "au" "aiff")) "m3u" "ogg" "flac" "mp3" "wav" "mod" "au" "aiff"))
;; MPV setup ;; MPV setup
(add-to-list 'emms-player-list 'emms-player-mpv t) (add-to-list 'emms-player-list 'emms-player-mpv)
(emms-player-set emms-player-mpv (emms-player-set emms-player-mpv
'regex 'regex
(rx (or (: "https://" (* nonl) "youtube.com" (* nonl)) (rx (or (: "https://" (* nonl) "youtube.com" (* nonl))
@ -3271,10 +3290,10 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(my/set-emms-mpd-youtube-quality (car my/youtube-dl-quality-list)) (my/set-emms-mpd-youtube-quality (car my/youtube-dl-quality-list))
;; evil-lion and evil-commentary shadow some gX bindings ;; evil-lion and evil-commentary shadow some gX bindings
;; (add-hook 'emms-browser-mode-hook ;; (add-hook 'emms-browser-mode-hook
;; (lambda () ;; (lambda ()
;; (evil-lion-mode -1) ;; (evil-lion-mode -1)
;; (evil-commentary-mode -1) ;; (evil-commentary-mode -1)
;; )) ;; ))
;; I have everything I need in polybar ;; I have everything I need in polybar
(emms-mode-line-mode -1) (emms-mode-line-mode -1)
(emms-playing-time-display-mode -1) (emms-playing-time-display-mode -1)
@ -3569,6 +3588,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(use-package screenshot (use-package screenshot
:straight (:repo "tecosaur/screenshot" :host github :files ("screenshot.el")) :straight (:repo "tecosaur/screenshot" :host github :files ("screenshot.el"))
:if (display-graphic-p)
:commands (screenshot) :commands (screenshot)
:init :init
(my-leader-def "S" 'screenshot)) (my-leader-def "S" 'screenshot))
@ -3617,7 +3637,8 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
:if (and (or :if (and (or
(string= (system-name) "indigo") (string= (system-name) "indigo")
(string= (system-name) "eminence")) (string= (system-name) "eminence"))
(not my/slow-ssh)) (not my/slow-ssh)
(not my/remote-server))
:config :config
(elcord-mode) (elcord-mode)
(add-to-list 'elcord-boring-buffers-regexp-list (add-to-list 'elcord-boring-buffers-regexp-list

116
Emacs.org
View file

@ -291,7 +291,7 @@ The following is a straight.el bootstrap script.
References: References:
- [[https://github.com/raxod502/straight.el][straight.el repo]] - [[https://github.com/raxod502/straight.el][straight.el repo]]
#+begin_src emacs-lisp #+begin_src emacs-lisp :noweb-ref minimal
(defvar bootstrap-version) (defvar bootstrap-version)
(let ((bootstrap-file (let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
@ -313,11 +313,51 @@ Set ~use-package-verbose~ to ~t~ to print out individual package loading time.
References: References:
- [[https://github.com/jwiegley/use-package][use-package repo]] - [[https://github.com/jwiegley/use-package][use-package repo]]
#+begin_src emacs-lisp #+begin_src emacs-lisp :noweb-ref minimal
(straight-use-package 'use-package) (straight-use-package 'use-package)
(eval-when-compile (require 'use-package)) (eval-when-compile (require 'use-package))
;; (setq use-package-verbose t) ;; (setq use-package-verbose t)
#+end_src #+end_src
** config variants & environment
The following variable is true when my machine is not powerful enough for some resource-heavy packages.
#+begin_src emacs-lisp
(setq my/lowpower (string= (system-name) "azure"))
#+end_src
The following is true if Emacs is meant to be used with TRAMP over slow ssh.
#+begin_src emacs-lisp
(setq my/slow-ssh
(or
(string= (getenv "IS_TRAMP") "true")
(string= (system-name) "dev-digital")))
#+end_src
The following is true is Emacs is ran on a remote server where I don't need stuff like my org workflow
#+begin_src emacs-lisp
(setq my/remote-server
(or (string= (getenv "IS_REMOTE") "true")
(string= (system-name) "dev-digital")))
#+end_src
And the following is true if Emacs is run from termux on Android.
#+begin_src emacs-lisp
(setq my/is-termux (string-match-p (rx (* nonl) "com.termux" (* nonl)) (getenv "HOME")))
#+end_src
Also, I sometimes need to know if a program is running inside Emacs (say, inside a terminal emulator). To do that, I set the following environment variable:
#+begin_src emacs-lisp
(setenv "IS_EMACS" "true")
#+end_src
Finally, I want to have a minimal Emacs config for debugging purposes. This has just straight.el, use-packages and evil.
#+begin_src emacs-lisp :tangle ~/.emacs.d/init-minimal.el :noweb yes
<<minimal>>
#+end_src
To launch Emacs with this config, run
#+begin_src bash :eval no :tangle no
emacs -q -l ~/.emacs.d/init-minimal.el
#+end_src
** Performance ** Performance
*** Garbage collection *** Garbage collection
Just setting ~gc-cons-treshold~ to a larger value. Just setting ~gc-cons-treshold~ to a larger value.
@ -341,28 +381,13 @@ Some time has passed, and I still don't know if there is any quantifiable advant
(garbage-collect)))) (garbage-collect))))
(add-hook 'after-focus-change-function 'garbage-collect)))) (add-hook 'after-focus-change-function 'garbage-collect))))
#+end_src #+end_src
*** Misc
The following variable is true when my machine is not powerful enough for some resource-heavy packages.
#+begin_src emacs-lisp
(setq my/lowpower (string= (system-name) "azure"))
#+end_src
The following is true if Emacs is meant to be used with TRAMP over slow ssh.
#+begin_src emacs-lisp
(setq my/slow-ssh (string= (getenv "IS_TRAMP") "true"))
#+end_src
And the following is true if Emacs is run from termux on Android.
#+begin_src emacs-lisp
(setq my/is-termux (string-match-p (rx (* nonl) "com.termux" (* nonl)) (getenv "HOME")))
#+end_src
*** Native compilation *** Native compilation
Set number of jobs to 1 on low-power machines Set number of jobs to 1 on low-power machines
#+begin_src emacs-lisp #+begin_src emacs-lisp
(when my/lowpower (when my/lowpower
(setq comp-async-jobs-number 1)) (setq comp-async-jobs-number 1))
#+end_src #+end_src
** Anaconda & environment ** Anaconda
[[https://www.anaconda.com/][Anaconda]] is a free package and environment manager. I currently use it to manage multiple versions of Python and Node.js [[https://www.anaconda.com/][Anaconda]] is a free package and environment manager. I currently use it to manage multiple versions of Python and Node.js
The following code uses the conda package to activate the base environment on startup if Emacs is launched outside the environment. The following code uses the conda package to activate the base environment on startup if Emacs is launched outside the environment.
@ -387,11 +412,6 @@ References:
(unless (getenv "CONDA_DEFAULT_ENV") (unless (getenv "CONDA_DEFAULT_ENV")
(conda-env-activate "general"))) (conda-env-activate "general")))
#+end_src #+end_src
Also, I sometimes need to know if a program is running inside Emacs (say, inside a terminal emulator). To do that, I set the following environment variable:
#+begin_src emacs-lisp
(setenv "IS_EMACS" "true")
#+end_src
** Custom file location ** Custom file location
By default, custom writes stuff to =init.el=, which is somewhat annoying. The following makes a separate file =custom.el= By default, custom writes stuff to =init.el=, which is somewhat annoying. The following makes a separate file =custom.el=
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -489,7 +509,7 @@ References:
*** evil *** evil
Basic evil configuration. Basic evil configuration.
#+begin_src emacs-lisp #+begin_src emacs-lisp :noweb-ref minimal
(use-package evil (use-package evil
:straight t :straight t
:init :init
@ -572,7 +592,7 @@ Basic evil configuration.
I don't enable the entire package, just the modes I need. I don't enable the entire package, just the modes I need.
#+begin_src emacs-lisp #+begin_src emacs-lisp :noweb-ref minimal
(use-package evil-collection (use-package evil-collection
:straight t :straight t
:after evil :after evil
@ -1227,7 +1247,7 @@ A company frontend with nice icons.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package company-box (use-package company-box
:straight t :straight t
:if (not my/lowpower) :if (and (display-graphic-p) (not my/lowpower))
:after (company) :after (company)
:hook (company-mode . company-box-mode)) :hook (company-mode . company-box-mode))
#+end_src #+end_src
@ -1325,7 +1345,7 @@ Before I figure out how to package this for Guix:
#+begin_src emacs-lisp :noweb yes #+begin_src emacs-lisp :noweb yes
(use-package wakatime-mode (use-package wakatime-mode
:straight (:host github :repo "SqrtMinusOne/wakatime-mode") :straight (:host github :repo "SqrtMinusOne/wakatime-mode")
:if (not my/is-termux) :if (not (or my/is-termux my/remote-server))
:config :config
(setq wakatime-ignore-exit-codes '(0 1 102)) (setq wakatime-ignore-exit-codes '(0 1 102))
(advice-add 'wakatime-init :after (lambda () (setq wakatime-cli-path "/home/pavel/bin/wakatime-cli"))) (advice-add 'wakatime-init :after (lambda () (setq wakatime-cli-path "/home/pavel/bin/wakatime-cli")))
@ -1340,7 +1360,7 @@ Before I figure out how to package this for Guix:
(use-package activity-watch-mode (use-package activity-watch-mode
:straight t :straight t
:if (not my/is-termux) :if (not (or my/is-termux my/remote-server))
:config :config
(global-activity-watch-mode)) (global-activity-watch-mode))
#+end_src #+end_src
@ -1653,7 +1673,7 @@ References:
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package emojify (use-package emojify
:straight t :straight t
:if (not (or my/lowpower my/is-termux)) :if (and (display-graphic-p) (not (or my/lowpower my/is-termux)))
:hook (after-init . global-emojify-mode)) :hook (after-init . global-emojify-mode))
#+end_src #+end_src
*** Ligatures *** Ligatures
@ -1661,7 +1681,7 @@ Ligature setup for the JetBrainsMono font.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package ligature (use-package ligature
:straight (:host github :repo "mickeynp/ligature.el") :straight (:host github :repo "mickeynp/ligature.el")
:if (not my/is-termux) :if (display-graphic-p)
:config :config
(ligature-set-ligatures (ligature-set-ligatures
'( '(
@ -1698,6 +1718,7 @@ Ligature setup for the JetBrainsMono font.
*** Icons *** Icons
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package all-the-icons (use-package all-the-icons
:if (display-graphic-p)
:straight t) :straight t)
#+end_src #+end_src
*** Highlight todo *** Highlight todo
@ -1812,7 +1833,7 @@ Display icons for files.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package all-the-icons-dired (use-package all-the-icons-dired
:straight t :straight t
:if (not (or my/lowpower my/slow-ssh)) :if (not (or my/lowpower my/slow-ssh (not (display-graphic-p))))
:hook (dired-mode . (lambda () :hook (dired-mode . (lambda ()
(unless (string-match-p "/gnu/store" default-directory) (unless (string-match-p "/gnu/store" default-directory)
(all-the-icons-dired-mode)))) (all-the-icons-dired-mode))))
@ -2037,6 +2058,7 @@ Open a terminal in the lower third of the frame with the =`= key.
(kill-buffer (current-buffer)) (kill-buffer (current-buffer))
(select-window vterm-window)) (select-window vterm-window))
(vterm-other-window "vterm-subterminal")))) (vterm-other-window "vterm-subterminal"))))
(unless my/slow-ssh (unless my/slow-ssh
(general-nmap "`" 'my/toggle-vterm-subteminal) (general-nmap "`" 'my/toggle-vterm-subteminal)
(general-nmap "~" 'vterm)) (general-nmap "~" 'vterm))
@ -2141,6 +2163,7 @@ Use the built-in org mode.
#+begin_src emacs-lisp :noweb yes #+begin_src emacs-lisp :noweb yes
(use-package org (use-package org
:straight t :straight t
:if (not my/remote-server)
:defer t :defer t
:config :config
(setq org-startup-indented t) (setq org-startup-indented t)
@ -2488,7 +2511,7 @@ Refile targets
*** Capture templates & various settings *** Capture templates & various settings
Settings for Org capture mode. The goal here is to have a non-disruptive process to capture various ideas. Settings for Org capture mode. The goal here is to have a non-disruptive process to capture various ideas.
#+begin_src emacs-lisp :tangle no :noweb-ref org-productivity-setup #+begin_src emacs-lisp
(setq org-capture-templates (setq org-capture-templates
`(("i" "Inbox" entry (file "inbox.org") `(("i" "Inbox" entry (file "inbox.org")
,(concat "* TODO %?\n" ,(concat "* TODO %?\n"
@ -2543,7 +2566,7 @@ Log DONE time
*** org-ql *** org-ql
[[https://github.com/alphapapa/org-ql][org-ql]] is a package to query the org files. I'm using it in my review workflow, perhaps later I'll find another usecases. [[https://github.com/alphapapa/org-ql][org-ql]] is a package to query the org files. I'm using it in my review workflow, perhaps later I'll find another usecases.
#+begin_src emacs-lisp #+begin_src emacs-lisp :tangle no :noweb-ref org-productivity-setup
(use-package org-ql (use-package org-ql
:straight (:fetcher github :straight (:fetcher github
:repo "alphapapa/org-ql" :repo "alphapapa/org-ql"
@ -2777,6 +2800,7 @@ A template looks like this:
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package org-journal (use-package org-journal
:straight t :straight t
:if (not my/remote-server)
:after org :after org
:config :config
(setq org-journal-dir (concat org-directory "/journal")) (setq org-journal-dir (concat org-directory "/journal"))
@ -2840,7 +2864,8 @@ References:
(use-package org-roam (use-package org-roam
:straight (:host github :repo "org-roam/org-roam" :straight (:host github :repo "org-roam/org-roam"
:files (:defaults "extensions/*.el")) :files (:defaults "extensions/*.el"))
:if (not my/remote-server)
:after org :after org
:init :init
(setq org-roam-directory (concat org-directory "/roam")) (setq org-roam-directory (concat org-directory "/roam"))
@ -2916,6 +2941,7 @@ As of now, this package loads Helm on start. To avoid this, I have to exclude He
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package org-ref (use-package org-ref
:straight (:files (:defaults (:exclude "*helm*"))) :straight (:files (:defaults (:exclude "*helm*")))
:if (not my/remote-server)
:init :init
(setq org-ref-completion-library 'org-ref-ivy-cite) (setq org-ref-completion-library 'org-ref-ivy-cite)
(setq bibtex-dialect 'biblatex) (setq bibtex-dialect 'biblatex)
@ -3173,6 +3199,7 @@ Doing presentations with [[https://github.com/rlister/org-present][org-present]]
(use-package org-present (use-package org-present
:straight (:host github :repo "rlister/org-present") :straight (:host github :repo "rlister/org-present")
:if (not my/remote-server)
:commands (org-present) :commands (org-present)
:config :config
(general-define-key (general-define-key
@ -3213,6 +3240,7 @@ References:
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package org-make-toc (use-package org-make-toc
:after (org) :after (org)
:if (not my/remote-server)
:commands :commands
(org-make-toc (org-make-toc
org-make-toc-insert org-make-toc-insert
@ -3379,7 +3407,7 @@ References:
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package lsp-mode (use-package lsp-mode
:straight t :straight t
:if (not (or my/slow-ssh my/is-termux)) :if (not (or my/slow-ssh my/is-termux my/remote-server))
:hook ( :hook (
(typescript-mode . lsp) (typescript-mode . lsp)
(vue-mode . lsp) (vue-mode . lsp)
@ -3428,6 +3456,7 @@ Origami should've leveraged LSP folding, but it was too unstable at the moment I
;; (add-hook 'lsp-after-open-hook #'lsp-origami-try-enable)) ;; (add-hook 'lsp-after-open-hook #'lsp-origami-try-enable))
(use-package lsp-treemacs (use-package lsp-treemacs
:after (lsp)
:straight t :straight t
:commands lsp-treemacs-errors-list) :commands lsp-treemacs-errors-list)
#+end_src #+end_src
@ -3489,6 +3518,7 @@ References:
(use-package tree-sitter (use-package tree-sitter
:straight t :straight t
:if (not my/remote-server)
:hook ((typescript-mode . my/tree-sitter-if-not-mmm) :hook ((typescript-mode . my/tree-sitter-if-not-mmm)
(js-mode . my/tree-sitter-if-not-mmm) (js-mode . my/tree-sitter-if-not-mmm)
(python-mode . tree-sitter-mode) (python-mode . tree-sitter-mode)
@ -4683,7 +4713,7 @@ Open a file managed by yadm.
My notmuch config now resides in [[file:Mail.org][Mail.org]]. My notmuch config now resides in [[file:Mail.org][Mail.org]].
#+begin_src emacs-lisp #+begin_src emacs-lisp
(unless my/is-termux (unless (or my/is-termux my/remote-server)
(load-file (expand-file-name "mail.el" user-emacs-directory))) (load-file (expand-file-name "mail.el" user-emacs-directory)))
#+end_src #+end_src
*** Elfeed *** Elfeed
@ -4696,6 +4726,7 @@ Using my own fork until the modifications are merged into master.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package elfeed (use-package elfeed
:straight (:repo "SqrtMinusOne/elfeed" :host github) :straight (:repo "SqrtMinusOne/elfeed" :host github)
:if (not my/remote-server)
:commands (elfeed) :commands (elfeed)
:init :init
(my-leader-def "ae" 'elfeed) (my-leader-def "ae" 'elfeed)
@ -4803,6 +4834,7 @@ References:
#+begin_src emacs-lisp :noweb yes #+begin_src emacs-lisp :noweb yes
(use-package emms (use-package emms
:straight t :straight t
:if (not my/remote-server)
:commands (emms-smart-browse :commands (emms-smart-browse
emms-browser emms-browser
emms-add-url emms-add-url
@ -4832,10 +4864,10 @@ References:
<<emms-mpv-setup>> <<emms-mpv-setup>>
;; evil-lion and evil-commentary shadow some gX bindings ;; evil-lion and evil-commentary shadow some gX bindings
;; (add-hook 'emms-browser-mode-hook ;; (add-hook 'emms-browser-mode-hook
;; (lambda () ;; (lambda ()
;; (evil-lion-mode -1) ;; (evil-lion-mode -1)
;; (evil-commentary-mode -1) ;; (evil-commentary-mode -1)
;; )) ;; ))
;; I have everything I need in polybar ;; I have everything I need in polybar
(emms-mode-line-mode -1) (emms-mode-line-mode -1)
(emms-playing-time-display-mode -1) (emms-playing-time-display-mode -1)
@ -5334,6 +5366,7 @@ Tecosaur's plugin to make beautiful code screenshots.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package screenshot (use-package screenshot
:straight (:repo "tecosaur/screenshot" :host github :files ("screenshot.el")) :straight (:repo "tecosaur/screenshot" :host github :files ("screenshot.el"))
:if (display-graphic-p)
:commands (screenshot) :commands (screenshot)
:init :init
(my-leader-def "S" 'screenshot)) (my-leader-def "S" 'screenshot))
@ -5405,7 +5438,8 @@ In order for this to work in Guix, a service is necessary - [[file:Desktop.org::
:if (and (or :if (and (or
(string= (system-name) "indigo") (string= (system-name) "indigo")
(string= (system-name) "eminence")) (string= (system-name) "eminence"))
(not my/slow-ssh)) (not my/slow-ssh)
(not my/remote-server))
:config :config
(elcord-mode) (elcord-mode)
(add-to-list 'elcord-boring-buffers-regexp-list (add-to-list 'elcord-boring-buffers-regexp-list