mirror of
https://github.com/SqrtMinusOne/dotfiles.git
synced 2025-12-11 19:45:25 +03:00
emacs: move to violet
This commit is contained in:
parent
6562efaebb
commit
19e54a894d
3 changed files with 90 additions and 50 deletions
|
|
@ -23,7 +23,6 @@
|
||||||
(setq my/remote-server
|
(setq my/remote-server
|
||||||
(or (string= (getenv "IS_REMOTE") "true")
|
(or (string= (getenv "IS_REMOTE") "true")
|
||||||
(string= (system-name) "dev-digital")
|
(string= (system-name) "dev-digital")
|
||||||
(string= (system-name) "violet")
|
|
||||||
(string= (system-name) "viridian")))
|
(string= (system-name) "viridian")))
|
||||||
|
|
||||||
(setq my/is-termux (string-match-p (rx (* nonl) "com.termux" (* nonl)) (getenv "HOME")))
|
(setq my/is-termux (string-match-p (rx (* nonl) "com.termux" (* nonl)) (getenv "HOME")))
|
||||||
|
|
@ -1537,21 +1536,24 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
||||||
:if (featurep 'treesit)
|
:if (featurep 'treesit)
|
||||||
:config
|
:config
|
||||||
(setq treesit-language-source-alist
|
(setq treesit-language-source-alist
|
||||||
'((bash "https://github.com/tree-sitter/tree-sitter-bash")
|
(mapcar
|
||||||
(cmake "https://github.com/uyha/tree-sitter-cmake")
|
(lambda (item)
|
||||||
(css "https://github.com/tree-sitter/tree-sitter-css")
|
`(,@item nil nil ,(executable-find "gcc") ,(executable-find "c++")))
|
||||||
(elisp "https://github.com/Wilfred/tree-sitter-elisp")
|
'((bash "https://github.com/tree-sitter/tree-sitter-bash")
|
||||||
(go "https://github.com/tree-sitter/tree-sitter-go")
|
(cmake "https://github.com/uyha/tree-sitter-cmake")
|
||||||
(html "https://github.com/tree-sitter/tree-sitter-html")
|
(css "https://github.com/tree-sitter/tree-sitter-css")
|
||||||
(javascript "https://github.com/tree-sitter/tree-sitter-javascript" "master" "src")
|
(elisp "https://github.com/Wilfred/tree-sitter-elisp")
|
||||||
(json "https://github.com/tree-sitter/tree-sitter-json")
|
(go "https://github.com/tree-sitter/tree-sitter-go")
|
||||||
(make "https://github.com/alemuller/tree-sitter-make")
|
(html "https://github.com/tree-sitter/tree-sitter-html")
|
||||||
(markdown "https://github.com/ikatyang/tree-sitter-markdown")
|
(javascript "https://github.com/tree-sitter/tree-sitter-javascript" "master" "src")
|
||||||
(python "https://github.com/tree-sitter/tree-sitter-python")
|
(json "https://github.com/tree-sitter/tree-sitter-json")
|
||||||
(toml "https://github.com/tree-sitter/tree-sitter-toml")
|
(make "https://github.com/alemuller/tree-sitter-make")
|
||||||
(tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src")
|
(markdown "https://github.com/ikatyang/tree-sitter-markdown")
|
||||||
(typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src")
|
(python "https://github.com/tree-sitter/tree-sitter-python")
|
||||||
(yaml "https://github.com/ikatyang/tree-sitter-yaml")))
|
(toml "https://github.com/tree-sitter/tree-sitter-toml")
|
||||||
|
(tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src")
|
||||||
|
(typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src")
|
||||||
|
(yaml "https://github.com/ikatyang/tree-sitter-yaml"))))
|
||||||
(setq treesit-font-lock-level 4)
|
(setq treesit-font-lock-level 4)
|
||||||
(setq major-mode-remap-alist
|
(setq major-mode-remap-alist
|
||||||
'((typescript-mode . typescript-ts-mode)
|
'((typescript-mode . typescript-ts-mode)
|
||||||
|
|
@ -2877,6 +2879,18 @@ Returns (<buffer> . <workspace-index>) or nil."
|
||||||
(setq org-tags-exclude-from-inheritance '("crypt"))
|
(setq org-tags-exclude-from-inheritance '("crypt"))
|
||||||
(setq org-crypt-key "C1EC867E478472439CC82410DE004F32AFA00205"))
|
(setq org-crypt-key "C1EC867E478472439CC82410DE004F32AFA00205"))
|
||||||
|
|
||||||
|
(with-eval-after-load 'epg
|
||||||
|
(setq epg-gpg-program "gpg")
|
||||||
|
(setq epg-config--program-alist
|
||||||
|
`((OpenPGP
|
||||||
|
epg-gpg-program
|
||||||
|
;; ("gpg2" . ,epg-gpg2-minimum-version)
|
||||||
|
("gpg" . ((,epg-gpg-minimum-version . "2.0")
|
||||||
|
,epg-gpg2-minimum-version)))
|
||||||
|
(CMS
|
||||||
|
epg-gpgsm-program
|
||||||
|
("gpgsm" . "2.0.4")))))
|
||||||
|
|
||||||
(defun my/epa--select-keys-around (fun prompt keys)
|
(defun my/epa--select-keys-around (fun prompt keys)
|
||||||
(if (= (seq-length keys) 1)
|
(if (= (seq-length keys) 1)
|
||||||
keys
|
keys
|
||||||
|
|
@ -5398,7 +5412,7 @@ KEYS is a list of cons cells like (<label> . <time>)."
|
||||||
(defvar-local my/eshell-last-command-start-time nil)
|
(defvar-local my/eshell-last-command-start-time nil)
|
||||||
|
|
||||||
(defun my/get-starship-prompt ()
|
(defun my/get-starship-prompt ()
|
||||||
(let ((cmd (format "TERM=xterm starship prompt --status=%d --cmd-duration=%d"
|
(let ((cmd (format "TERM=xterm starship prompt --status=%d --cmd-duration=%d --logical-path=%s"
|
||||||
eshell-last-command-status
|
eshell-last-command-status
|
||||||
(if my/eshell-last-command-start-time
|
(if my/eshell-last-command-start-time
|
||||||
(let ((delta (float-time
|
(let ((delta (float-time
|
||||||
|
|
@ -5407,7 +5421,8 @@ KEYS is a list of cons cells like (<label> . <time>)."
|
||||||
my/eshell-last-command-start-time))))
|
my/eshell-last-command-start-time))))
|
||||||
(setq my/eshell-last-command-start-time nil)
|
(setq my/eshell-last-command-start-time nil)
|
||||||
(round (* delta 1000)))
|
(round (* delta 1000)))
|
||||||
0))))
|
0)
|
||||||
|
(shell-quote-argument default-directory))))
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(call-process "bash" nil t nil "-c" cmd)
|
(call-process "bash" nil t nil "-c" cmd)
|
||||||
(thread-first "\n"
|
(thread-first "\n"
|
||||||
|
|
@ -5600,6 +5615,12 @@ KEYS is a list of cons cells like (<label> . <time>)."
|
||||||
(eshell/cd root)
|
(eshell/cd root)
|
||||||
(message "Not in a project")))
|
(message "Not in a project")))
|
||||||
|
|
||||||
|
(defun my/eshell-maybe-configure-for-tramp ()
|
||||||
|
(when (file-remote-p default-directory)
|
||||||
|
(setq-local company-idle-delay nil)))
|
||||||
|
|
||||||
|
(add-hook 'eshell-mode-hook #'my/eshell-maybe-configure-for-tramp)
|
||||||
|
|
||||||
(general-define-key
|
(general-define-key
|
||||||
:states '(normal)
|
:states '(normal)
|
||||||
"`" #'my/eshell-dedicated
|
"`" #'my/eshell-dedicated
|
||||||
|
|
@ -7302,7 +7323,7 @@ base toot."
|
||||||
(interactive)
|
(interactive)
|
||||||
(setq telega-server-libs-prefix
|
(setq telega-server-libs-prefix
|
||||||
(string-trim
|
(string-trim
|
||||||
(shell-command-to-string "guix build tdlib-1.8.16")))
|
(shell-command-to-string "guix build tdlib")))
|
||||||
(telega-server-build "CC=gcc"))
|
(telega-server-build "CC=gcc"))
|
||||||
|
|
||||||
(add-hook 'telega-load-hook #'telega-mode-line-mode)
|
(add-hook 'telega-load-hook #'telega-mode-line-mode)
|
||||||
|
|
@ -7525,8 +7546,9 @@ base toot."
|
||||||
|
|
||||||
(defvar my/index-root (concat (getenv "HOME") "/"))
|
(defvar my/index-root (concat (getenv "HOME") "/"))
|
||||||
|
|
||||||
(defvar my/index-file
|
(with-eval-after-load 'org
|
||||||
(concat org-directory "/misc/index.org"))
|
(defvar my/index-file
|
||||||
|
(concat org-directory "/misc/index.org")))
|
||||||
|
|
||||||
(defun my/index--tree-get-recursive (heading &optional path)
|
(defun my/index--tree-get-recursive (heading &optional path)
|
||||||
"Read the index tree recursively from HEADING.
|
"Read the index tree recursively from HEADING.
|
||||||
|
|
@ -8233,7 +8255,7 @@ to `dired' if used interactively."
|
||||||
(setenv "GPG_AGENT_INFO" nil) ;; use emacs pinentry
|
(setenv "GPG_AGENT_INFO" nil) ;; use emacs pinentry
|
||||||
(setq auth-source-debug t)
|
(setq auth-source-debug t)
|
||||||
|
|
||||||
(setq epg-gpg-program "gpg2") ;; not necessary
|
(setq epg-gpg-program "gpg") ;; not necessary
|
||||||
(require 'epa-file)
|
(require 'epa-file)
|
||||||
(epa-file-enable)
|
(epa-file-enable)
|
||||||
(setq epa-pinentry-mode 'loopback)
|
(setq epa-pinentry-mode 'loopback)
|
||||||
|
|
@ -8317,7 +8339,7 @@ to `dired' if used interactively."
|
||||||
(use-package elcord
|
(use-package elcord
|
||||||
:straight t
|
:straight t
|
||||||
:if (and (or
|
:if (and (or
|
||||||
(string= (system-name) "indigo")
|
(string= (system-name) "violet")
|
||||||
(string= (system-name) "eminence")
|
(string= (system-name) "eminence")
|
||||||
(string= (system-name) "iris"))
|
(string= (system-name) "iris"))
|
||||||
(not my/slow-ssh)
|
(not my/slow-ssh)
|
||||||
|
|
|
||||||
71
Emacs.org
71
Emacs.org
|
|
@ -126,7 +126,6 @@ The following is true is Emacs is run on a remote server where I don't need stuf
|
||||||
(setq my/remote-server
|
(setq my/remote-server
|
||||||
(or (string= (getenv "IS_REMOTE") "true")
|
(or (string= (getenv "IS_REMOTE") "true")
|
||||||
(string= (system-name) "dev-digital")
|
(string= (system-name) "dev-digital")
|
||||||
(string= (system-name) "violet")
|
|
||||||
(string= (system-name) "viridian")))
|
(string= (system-name) "viridian")))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
@ -2373,21 +2372,24 @@ References:
|
||||||
:if (featurep 'treesit)
|
:if (featurep 'treesit)
|
||||||
:config
|
:config
|
||||||
(setq treesit-language-source-alist
|
(setq treesit-language-source-alist
|
||||||
'((bash "https://github.com/tree-sitter/tree-sitter-bash")
|
(mapcar
|
||||||
(cmake "https://github.com/uyha/tree-sitter-cmake")
|
(lambda (item)
|
||||||
(css "https://github.com/tree-sitter/tree-sitter-css")
|
`(,@item nil nil ,(executable-find "gcc") ,(executable-find "c++")))
|
||||||
(elisp "https://github.com/Wilfred/tree-sitter-elisp")
|
'((bash "https://github.com/tree-sitter/tree-sitter-bash")
|
||||||
(go "https://github.com/tree-sitter/tree-sitter-go")
|
(cmake "https://github.com/uyha/tree-sitter-cmake")
|
||||||
(html "https://github.com/tree-sitter/tree-sitter-html")
|
(css "https://github.com/tree-sitter/tree-sitter-css")
|
||||||
(javascript "https://github.com/tree-sitter/tree-sitter-javascript" "master" "src")
|
(elisp "https://github.com/Wilfred/tree-sitter-elisp")
|
||||||
(json "https://github.com/tree-sitter/tree-sitter-json")
|
(go "https://github.com/tree-sitter/tree-sitter-go")
|
||||||
(make "https://github.com/alemuller/tree-sitter-make")
|
(html "https://github.com/tree-sitter/tree-sitter-html")
|
||||||
(markdown "https://github.com/ikatyang/tree-sitter-markdown")
|
(javascript "https://github.com/tree-sitter/tree-sitter-javascript" "master" "src")
|
||||||
(python "https://github.com/tree-sitter/tree-sitter-python")
|
(json "https://github.com/tree-sitter/tree-sitter-json")
|
||||||
(toml "https://github.com/tree-sitter/tree-sitter-toml")
|
(make "https://github.com/alemuller/tree-sitter-make")
|
||||||
(tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src")
|
(markdown "https://github.com/ikatyang/tree-sitter-markdown")
|
||||||
(typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src")
|
(python "https://github.com/tree-sitter/tree-sitter-python")
|
||||||
(yaml "https://github.com/ikatyang/tree-sitter-yaml")))
|
(toml "https://github.com/tree-sitter/tree-sitter-toml")
|
||||||
|
(tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src")
|
||||||
|
(typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src")
|
||||||
|
(yaml "https://github.com/ikatyang/tree-sitter-yaml"))))
|
||||||
(setq treesit-font-lock-level 4)
|
(setq treesit-font-lock-level 4)
|
||||||
(setq major-mode-remap-alist
|
(setq major-mode-remap-alist
|
||||||
'((typescript-mode . typescript-ts-mode)
|
'((typescript-mode . typescript-ts-mode)
|
||||||
|
|
@ -3989,6 +3991,20 @@ Setting up =org-crypt= to encrypt parts of file.
|
||||||
(setq org-crypt-key "C1EC867E478472439CC82410DE004F32AFA00205"))
|
(setq org-crypt-key "C1EC867E478472439CC82410DE004F32AFA00205"))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(with-eval-after-load 'epg
|
||||||
|
(setq epg-gpg-program "gpg")
|
||||||
|
(setq epg-config--program-alist
|
||||||
|
`((OpenPGP
|
||||||
|
epg-gpg-program
|
||||||
|
;; ("gpg2" . ,epg-gpg2-minimum-version)
|
||||||
|
("gpg" . ((,epg-gpg-minimum-version . "2.0")
|
||||||
|
,epg-gpg2-minimum-version)))
|
||||||
|
(CMS
|
||||||
|
epg-gpgsm-program
|
||||||
|
("gpgsm" . "2.0.4")))))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
This enables encryption for Org segments tagged =:crypt:=.
|
This enables encryption for Org segments tagged =:crypt:=.
|
||||||
|
|
||||||
Another way to encrypt Org files is to save them with the extension =.org.gpg=. However, by default [[https://www.gnu.org/software/emacs/manual/html_mono/epa.html][EPA]] always prompts for the key, which is not what I want when there is only one key to select. Hence the following advice:
|
Another way to encrypt Org files is to save them with the extension =.org.gpg=. However, by default [[https://www.gnu.org/software/emacs/manual/html_mono/epa.html][EPA]] always prompts for the key, which is not what I want when there is only one key to select. Hence the following advice:
|
||||||
|
|
@ -5818,10 +5834,10 @@ Some resources that helped me along the way (and still help):
|
||||||
- [[https://www.youtube.com/watch?v=-TpWahIzueg][System Crafters Live! - Can You Apply Zettelkasten in Emacs?]]
|
- [[https://www.youtube.com/watch?v=-TpWahIzueg][System Crafters Live! - Can You Apply Zettelkasten in Emacs?]]
|
||||||
|
|
||||||
**** Basic package configuration
|
**** Basic package configuration
|
||||||
| Guix dependency |
|
| Guix dependency | Disabled |
|
||||||
|-----------------------|
|
|-----------------------+----------|
|
||||||
| emacs-emacsql-sqlite3 |
|
| emacs-emacsql-sqlite3 | t |
|
||||||
| graphviz |
|
| graphviz | |
|
||||||
|
|
||||||
About installing the package on Guix (*CREDIT*: thanks @Ashraz on the SystemCrafters discord)
|
About installing the package on Guix (*CREDIT*: thanks @Ashraz on the SystemCrafters discord)
|
||||||
|
|
||||||
|
|
@ -7515,7 +7531,7 @@ The executable can print out the text of the prompt, but somehow it refuses when
|
||||||
(setq my/eshell-last-command-start-time nil)
|
(setq my/eshell-last-command-start-time nil)
|
||||||
(round (* delta 1000)))
|
(round (* delta 1000)))
|
||||||
0)
|
0)
|
||||||
default-directory)))
|
(shell-quote-argument default-directory))))
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(call-process "bash" nil t nil "-c" cmd)
|
(call-process "bash" nil t nil "-c" cmd)
|
||||||
(thread-first "\n"
|
(thread-first "\n"
|
||||||
|
|
@ -10061,7 +10077,7 @@ Building =telega-server= can create problems. It requires the latest version of
|
||||||
(interactive)
|
(interactive)
|
||||||
(setq telega-server-libs-prefix
|
(setq telega-server-libs-prefix
|
||||||
(string-trim
|
(string-trim
|
||||||
(shell-command-to-string "guix build tdlib-1.8.16")))
|
(shell-command-to-string "guix build tdlib")))
|
||||||
(telega-server-build "CC=gcc"))
|
(telega-server-build "CC=gcc"))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
@ -10428,8 +10444,9 @@ The root is my =$HOME= directory.
|
||||||
|
|
||||||
The org tree is located in my =org-mode= folder in a file called =index.org=:
|
The org tree is located in my =org-mode= folder in a file called =index.org=:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(defvar my/index-file
|
(with-eval-after-load 'org
|
||||||
(concat org-directory "/misc/index.org"))
|
(defvar my/index-file
|
||||||
|
(concat org-directory "/misc/index.org")))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Each "area" is an Org header with the =folder= tag; the Org hierarchy forms the file tree. A header can have the following properties:
|
Each "area" is an Org header with the =folder= tag; the Org hierarchy forms the file tree. A header can have the following properties:
|
||||||
|
|
@ -11350,7 +11367,7 @@ Emacs-based pinentry works great on Termux.
|
||||||
(setenv "GPG_AGENT_INFO" nil) ;; use emacs pinentry
|
(setenv "GPG_AGENT_INFO" nil) ;; use emacs pinentry
|
||||||
(setq auth-source-debug t)
|
(setq auth-source-debug t)
|
||||||
|
|
||||||
(setq epg-gpg-program "gpg2") ;; not necessary
|
(setq epg-gpg-program "gpg") ;; not necessary
|
||||||
(require 'epa-file)
|
(require 'epa-file)
|
||||||
(epa-file-enable)
|
(epa-file-enable)
|
||||||
(setq epa-pinentry-mode 'loopback)
|
(setq epa-pinentry-mode 'loopback)
|
||||||
|
|
@ -11510,7 +11527,7 @@ And the package configuration:
|
||||||
(use-package elcord
|
(use-package elcord
|
||||||
:straight t
|
:straight t
|
||||||
:if (and (or
|
:if (and (or
|
||||||
(string= (system-name) "indigo")
|
(string= (system-name) "violet")
|
||||||
(string= (system-name) "eminence")
|
(string= (system-name) "eminence")
|
||||||
(string= (system-name) "iris"))
|
(string= (system-name) "iris"))
|
||||||
(not my/slow-ssh)
|
(not my/slow-ssh)
|
||||||
|
|
@ -11872,6 +11889,6 @@ My text editor isn't old enough.
|
||||||
|
|
||||||
#+begin_src scheme :tangle .config/guix/manifests/emacs.scm :noweb yes
|
#+begin_src scheme :tangle .config/guix/manifests/emacs.scm :noweb yes
|
||||||
(specifications->manifest
|
(specifications->manifest
|
||||||
'("emacs-next-tree-sitter"
|
'("emacs"
|
||||||
<<packages()>>))
|
<<packages()>>))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
|
||||||
1
Guix.org
1
Guix.org
|
|
@ -557,6 +557,7 @@ Don't forget to install =JetBrainsMono Nerd Font=.
|
||||||
| system | tor-client | |
|
| system | tor-client | |
|
||||||
| system | torsocks | |
|
| system | torsocks | |
|
||||||
| system | vnstat | |
|
| system | vnstat | |
|
||||||
|
| system | nss-certs | |
|
||||||
|
|
||||||
** OpenVPN
|
** OpenVPN
|
||||||
| Category | Guix dependency |
|
| Category | Guix dependency |
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue