Compare commits

..

12 Commits

Author SHA1 Message Date
6d563572d2 feat(emacs/programming): remove unused configuration 2026-05-03 16:23:26 +02:00
35a525e3fc feat(emacs/nix): enable LSP server for Nix files by default 2026-05-03 15:53:01 +02:00
39c311ba41 feat(emacs/direnv): enable Emacs to load direnv environment
Especially useful when using Nix develompent shells and when LSP
servers would otherwise not be available.
2026-05-03 15:51:25 +02:00
8f68f4ba04 feat(emacs/tree-sitter): remove unused packages 2026-05-03 15:51:05 +02:00
027761fc52 feat(emacs): remove Yadm config 2026-05-03 15:50:08 +02:00
c05329171d feat(emacs/evil-surround): add typographic delimiters 2026-05-03 15:49:42 +02:00
0a2b238e1e feat(emacs/projectile): ignore nix store 2026-05-03 15:49:03 +02:00
c8b7d1b899 docs(emacs): move Jujutsu section 2026-05-03 15:49:03 +02:00
aa793e0638 feat(emacs/langtool): change default language to GB English 2026-05-03 15:49:03 +02:00
af2f22aa4b feat(emacs): recreate my old hydra menu for writeroom with transient
Create a Transient menu to adapt on the fly the width of my buffers
when using writeroom-mode. This commit also adds two other functions:
- `my/writeroom-reset` which resets the width of the buffer to its
  default state
- `my/writeroom-fit-buffer` which sets the width of the buffer to be
  exactly what is needed to fit the longest line of the buffer
2026-05-03 15:49:03 +02:00
1ea379f907 docs(emacs): user user-lisp/ dir instead of plain lisp/ dir
Also precompile user-lisp content if the ELC files are older than
their original source file.
2026-05-03 15:48:58 +02:00
e42b591bd8 chore(devenv): update environment 2026-05-03 15:40:59 +02:00
18 changed files with 199 additions and 322 deletions

View File

@@ -3,10 +3,11 @@
"devenv": { "devenv": {
"locked": { "locked": {
"dir": "src/modules", "dir": "src/modules",
"lastModified": 1771852244, "lastModified": 1777679510,
"narHash": "sha256-uG8LPb1useAwa0cjO5sEkYhCSPjbWiCH3DyNxQLVSck=",
"owner": "cachix", "owner": "cachix",
"repo": "devenv", "repo": "devenv",
"rev": "c88c14a32d06173867e26b7d4f5daed38a3f6f1e", "rev": "bc8b21628907c726c74094cedc439c10a455cdb7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -16,71 +17,16 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1767039857,
"owner": "NixOS",
"repo": "flake-compat",
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "flake-compat",
"type": "github"
}
},
"git-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1771858127,
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "49bbbfc218bf3856dfa631cead3b052d78248b83",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1762808025,
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "cb5e3fdca1de58ccbc3ef53de65bd372b48f567c",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"inputs": { "inputs": {
"nixpkgs-src": "nixpkgs-src" "nixpkgs-src": "nixpkgs-src"
}, },
"locked": { "locked": {
"lastModified": 1770434727, "lastModified": 1776852779,
"narHash": "sha256-WwO/ITisCXwyiRgtktZgv3iGhAGO+IB5Av4kKCwezR0=",
"owner": "cachix", "owner": "cachix",
"repo": "devenv-nixpkgs", "repo": "devenv-nixpkgs",
"rev": "8430f16a39c27bdeef236f1eeb56f0b51b33d348", "rev": "ec3063523dcd911aeadb50faa589f237cdab5853",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -93,11 +39,11 @@
"nixpkgs-src": { "nixpkgs-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1769922788, "lastModified": 1776329215,
"narHash": "sha256-H3AfG4ObMDTkTJYkd8cz1/RbY9LatN5Mk4UF48VuSXc=", "narHash": "sha256-a8BYi3mzoJ/AcJP8UldOx8emoPRLeWqALZWu4ZvjPXw=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "207d15f1a6603226e1e223dc79ac29c7846da32e", "rev": "b86751bc4085f48661017fa226dee99fab6c651b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -110,14 +56,10 @@
"root": { "root": {
"inputs": { "inputs": {
"devenv": "devenv", "devenv": "devenv",
"git-hooks": "git-hooks", "nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs",
"pre-commit-hooks": [
"git-hooks"
]
} }
} }
}, },
"root": "root", "root": "root",
"version": 7 "version": 7
} }

View File

@@ -1,7 +1,7 @@
#+title: Emacs — Basic Configuration #+title: Emacs — Basic Configuration
#+setupfile: ../headers #+setupfile: ../headers
#+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code #+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code
#+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/lisp/basic-config.el #+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/user-lisp/basic-config.el
#+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export #+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export
* Basic Configuration * Basic Configuration

View File

@@ -1,7 +1,7 @@
#+title: Emacs — Custom Elisp #+title: Emacs — Custom Elisp
#+setupfile: ../headers #+setupfile: ../headers
#+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code #+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code
#+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/lisp/custom-elisp.el #+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/user-lisp/custom-elisp.el
#+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export #+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export
* Custom Elisp * Custom Elisp

View File

@@ -78,6 +78,8 @@ block.
#+end_src #+end_src
** Loading All Configuration Modules ** Loading All Configuration Modules
Here are all my Emacs configuration modules, each dedicated to a
specific aspect of my Emacs configuration.
#+name: emacs-modules #+name: emacs-modules
| Module Name | Config Page | | Module Name | Config Page |
@@ -98,27 +100,58 @@ block.
| =visual-config.el= | [[file:./packages/visual-config.org][Packages — Visual Configuration]] | | =visual-config.el= | [[file:./packages/visual-config.org][Packages — Visual Configuration]] |
| =keybindings.el= | [[file:./keybindings.org][Keybindings]] | | =keybindings.el= | [[file:./keybindings.org][Keybindings]] |
#+name: generate-modules #+name: modules
#+begin_src emacs-lisp :tangle no :cache yes :var modules=emacs-modules :exports none #+begin_src emacs-lisp :tangle no :cache yes :var modules=emacs-modules :exports none :results list
(mapconcat (lambda (line) (mapcar (lambda (module) (string-trim (car module) "=" "="))
(concat "\"" (string-trim (car line) "=" "=") "\"")) modules)
modules
" ")
#+end_src #+end_src
#+RESULTS[05f9bb535bec2ba84390cc118600323683f51e7c]: generate-modules #+RESULTS[1c6034eb268577137e95a6f828c249fc306943b1]: modules
: "basic-config.el" "custom-elisp.el" "package-manager.el" "keybinding-managers.el" "applications.el" "autocompletion.el" "editing.el" "emacs-builtin.el" "helpful.el" "latex.el" "misc.el" "org.el" "programming.el" "visual-config.el" "keybindings.el" - basic-config.el
- custom-elisp.el
- package-manager.el
- keybinding-managers.el
- applications.el
- autocompletion.el
- editing.el
- emacs-builtin.el
- helpful.el
- latex.el
- misc.el
- org.el
- programming.el
- visual-config.el
- keybindings.el
#+begin_src emacs-lisp :noweb yes The first thing Emacs does is verify if any of these modules need to
(dolist (module '(<<generate-modules()>>)) be byte-compiled again, i.e. if the =.el= file is younger than its
corresponding =.elc= file. If so, the =.el= file is byte-compiled.
#+begin_src emacs-lisp :var modules=modules :results none
(defun my/mtime (file)
"Get the modification time of FILE as a timestamp."
(let* ((current-time-list nil)
(attr (file-attributes file))
(time-attr (file-attribute-modification-time attr)))
(/ (car time-attr) (cdr time-attr))))
;; `modules' is a variable created by org-mode from the table of modules
(let* ((config-dir (expand-file-name "user-lisp" user-emacs-directory))
(modules (mapcar (lambda (module)
(file-name-sans-extension (expand-file-name module config-dir)))
modules)))
(dolist (module modules)
(let* ((el-file (concat module ".el"))
(elc-file (concat module ".elc"))
(el-last-change (my/mtime el-file))
(elc-last-change (if (file-exists-p elc-file) (my/mtime elc-file) 0)))
(when (> el-last-change elc-last-change)
(byte-compile-file el-file)))))
#+end_src
Now we can load them.
#+begin_src emacs-lisp :var modules=modules :results none
(dolist (module (mapcar #'file-name-sans-extension modules))
(load (expand-file-name module (load (expand-file-name module
(expand-file-name "lisp" user-emacs-directory)))) (expand-file-name "user-lisp" user-emacs-directory))))
#+end_src #+end_src
* TODOs :noexport:
** TODO advise ~evil-insert~ in eshell
Advise ~evil-insert~ to go to the end of the buffer while in
~eshell-mode~.
** DONE Get started with org-roam
CLOSED: [2023-06-17 Sat 13:38]

View File

@@ -1,7 +1,7 @@
#+title: Emacs — Keybinding Managers #+title: Emacs — Keybinding Managers
#+setupfile: ../headers #+setupfile: ../headers
#+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code #+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code
#+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/lisp/keybinding-managers.el #+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/user-lisp/keybinding-managers.el
#+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export #+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export
* Keybinding Managers * Keybinding Managers

View File

@@ -1,7 +1,7 @@
#+title: Emacs — Keybindings #+title: Emacs — Keybindings
#+setupfile: ../headers #+setupfile: ../headers
#+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code #+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code
#+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/lisp/keybindings.el #+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/user-lisp/keybindings.el
#+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export #+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export
* Keybindings * Keybindings
@@ -263,7 +263,7 @@ I also have some keybindings dedicated to opening specific files.
"fI" '((lambda () "fI" '((lambda ()
(interactive) (interactive)
(quick-find-files nil (quick-find-files nil
(expand-file-name "lisp" user-emacs-directory) (expand-file-name "user-lisp" user-emacs-directory)
"el")) "el"))
:which-key "elisp config" :which-key "elisp config"
:package quick-find-files) :package quick-find-files)
@@ -504,34 +504,36 @@ My toggle keybindings are prefixed by ~t~.
A couple of keybindings are hidden from which-key, otherwise theres not A couple of keybindings are hidden from which-key, otherwise theres not
much to say. The prefix here is ~w~. much to say. The prefix here is ~w~.
#+name: keybindings-windows #+name: keybindings-windows
| Key | Function | Description | Package | | Key | Function | Description | Package |
|-----+-------------------------------+-------------+----------------| |-----+-------------------------------+----------------+----------------|
| | | windows | | | | | windows | |
| c | evil-window-left | | evil | | c | evil-window-left | | evil |
| t | evil-window-down | | evil | | t | evil-window-down | | evil |
| s | evil-window-up | | evil | | s | evil-window-up | | evil |
| r | evil-window-right | | evil | | r | evil-window-right | | evil |
| . | windows-adjust-size/body | | | | . | windows-adjust-size/body | | |
| - | split-window-below-and-focus | | | | - | split-window-below-and-focus | | |
| / | split-window-right-and-focus | | | | / | split-window-right-and-focus | | |
| $ | winum-select-window-by-number | | winum | | $ | winum-select-window-by-number | | winum |
| 0 | winum-select-window-0-or-10 | none | winum | | 0 | winum-select-window-0-or-10 | none | winum |
| 1 | winum-select-window-1 | none | winum | | 1 | winum-select-window-1 | none | winum |
| 2 | winum-select-window-2 | none | winum | | 2 | winum-select-window-2 | none | winum |
| 3 | winum-select-window-3 | none | winum | | 3 | winum-select-window-3 | none | winum |
| 4 | winum-select-window-4 | none | winum | | 4 | winum-select-window-4 | none | winum |
| 5 | winum-select-window-5 | none | winum | | 5 | winum-select-window-5 | none | winum |
| 6 | winum-select-window-6 | none | winum | | 6 | winum-select-window-6 | none | winum |
| 7 | winum-select-window-7 | none | winum | | 7 | winum-select-window-7 | none | winum |
| 8 | winum-select-window-8 | none | winum | | 8 | winum-select-window-8 | none | winum |
| 9 | winum-select-window-9 | none | winum | | 9 | winum-select-window-9 | none | winum |
| b | kill-buffer-and-window | | | | b | kill-buffer-and-window | | |
| d | delete-window | | | | d | delete-window | | |
| o | other-window | | | | o | other-window | | |
| D | delete-other-windows | | | | D | delete-other-windows | | |
| w | | writeroom | | | w | | writeroom | |
| w. | writeroom-buffer-width/body | | writeroom-mode | | w. | my/writeroom-transient | adapt width | |
| ww | writeroom-mode | | writeroom-mode | | w= | my/writeroom-reset | reset width | |
| wf | my/writeroom-fit-buffer | fit to content | |
| ww | writeroom-mode | | writeroom-mode |
** Quit ** Quit
Why would I ever use any of these keybindings? They are prefixed with ~q~. Why would I ever use any of these keybindings? They are prefixed with ~q~.

View File

@@ -1,7 +1,7 @@
#+title: Emacs — Package Manager #+title: Emacs — Package Manager
#+setupfile: ../headers #+setupfile: ../headers
#+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code #+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code
#+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/lisp/package-manager.el #+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/user-lisp/package-manager.el
#+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export #+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export
* Package Manager * Package Manager

View File

@@ -1,7 +1,7 @@
#+title: Emacs — Packages — Applications #+title: Emacs — Packages — Applications
#+setupfile: ../../headers #+setupfile: ../../headers
#+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code #+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code
#+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/lisp/applications.el #+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/user-lisp/applications.el
#+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export #+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export
* Applications * Applications
@@ -1280,7 +1280,7 @@ in quite a few languages.
langtool-show-message-at-point langtool-show-message-at-point
langtool-correct-buffer) langtool-correct-buffer)
:custom :custom
(langtool-default-language "en-US") (langtool-default-language "en-GB")
(langtool-mother-tongue "fr") (langtool-mother-tongue "fr")
:config :config
(setq langtool-http-server-host "localhost" (setq langtool-http-server-host "localhost"
@@ -1399,53 +1399,6 @@ left it.
#+end_src #+end_src
** Project Management ** Project Management
*** Jujutsu
Lets face it: [[https://git-scm.com/][git]] is awesome. Theres a reason it took over the world
of software development, replacing pretty much all competitors such as
subversion. And I will forever love it. But, it has a lot of
drawbacks, especially its interface that is... not great, to put it
mildly. I absolutely respect its commitment to staying backward
compatible, but its not great.
[[https://jj-vcs.github.io/][Jujutsu]] on the other hand, is awesome! Its interface is really clean,
really intuitive, especially for someone like me who rebases a LOT!
And, for now, it still uses git as its backend, so its entirely
compatible with git repositories. In fact, I pretty much dont use git
anymore, jj (abbreviation of Jujutsu) has almost completely replaced
git for me.
I like Magits interface, as you can see in my [[file:./applications.md#magit][Magit]] config.
Therefore, lets install =majjit=, my slow and scuffed attempt at
bringing some Magit features to jujutsu.
#+begin_src emacs-lisp
(use-package majjit
:defer t
:after magit
:straight (majjit :built t
:type git
:host nil
:repo "https://labs.phundrak.com/phundrak/majjit")
:custom ((majjit-default-directory "~/code/")))
#+end_src
Though, Ill be honest, I generally prefer to use Jujutsu in the
terminal, unlike git. Something I do use Emacs for, however, is
writing my commit messages.
#+begin_src emacs-lisp
(use-package jjdescription
:defer nil
:straight (:build t)
:commands jjdescription-mode
:init (add-to-list 'auto-mode-alist '("\\.jjdescription\\'" . jjdescription-mode)))
#+end_src
And I want Emacs to know that any directory which has a =.jj= repository
is the root of a project.
#+begin_src emacs-lisp
(add-to-list 'project-vc-extra-root-markers ".jj")
#+end_src
*** Magit *** Magit
Magit is an awesome wrapper around Git for Emacs! Very often, I go Magit is an awesome wrapper around Git for Emacs! Very often, I go
from disliking to really hating Git GUI clients because they often from disliking to really hating Git GUI clients because they often
@@ -1562,6 +1515,53 @@ deactivate `magit-todos-mode', otherwise enable it."
(setq magit-todos-ignore-case nil)) (setq magit-todos-ignore-case nil))
#+end_src #+end_src
*** Jujutsu
Lets face it: [[https://git-scm.com/][git]] is awesome. Theres a reason it took over the world
of software development, replacing pretty much all competitors such as
subversion. And I will forever love it. But, it has a lot of
drawbacks, especially its interface that is... not great, to put it
mildly. I absolutely respect its commitment to staying backward
compatible, but its not great.
[[https://jj-vcs.github.io/][Jujutsu]] on the other hand, is awesome! Its interface is really clean,
really intuitive, especially for someone like me who rebases a LOT!
And, for now, it still uses git as its backend, so its entirely
compatible with git repositories. In fact, I pretty much dont use git
anymore, jj (abbreviation of Jujutsu) has almost completely replaced
git for me.
I like Magits interface, as you can see in my [[file:./applications.md#magit][Magit]] config.
Therefore, lets install =majjit=, my slow and scuffed attempt at
bringing some Magit features to jujutsu.
#+begin_src emacs-lisp
(use-package majjit
:defer t
:after magit
:straight (majjit :built t
:type git
:host nil
:repo "https://labs.phundrak.com/phundrak/majjit")
:custom ((majjit-default-directory "~/code/")))
#+end_src
Though, Ill be honest, I generally prefer to use Jujutsu in the
terminal, unlike git. Something I do use Emacs for, however, is
writing my commit messages.
#+begin_src emacs-lisp
(use-package jjdescription
:defer nil
:straight (:build t)
:commands jjdescription-mode
:init (add-to-list 'auto-mode-alist '("\\.jjdescription\\'" . jjdescription-mode)))
#+end_src
And I want Emacs to know that any directory which has a =.jj= repository
is the root of a project.
#+begin_src emacs-lisp
;;(add-to-list 'project-vc-extra-root-markers ".jj")
#+end_src
*** Forge *** Forge
Forge acts as an interface for GitHub, GitLab, and Bitbucket inside Forge acts as an interface for GitHub, GitLab, and Bitbucket inside
Magit. A lot of possibilities are present, you can read issues and Magit. A lot of possibilities are present, you can read issues and
@@ -1619,6 +1619,8 @@ to projectile.
(projectile-mode) (projectile-mode)
(add-to-list 'projectile-ignored-projects "~/") (add-to-list 'projectile-ignored-projects "~/")
(add-to-list 'projectile-globally-ignored-directories "^node_modules$") (add-to-list 'projectile-globally-ignored-directories "^node_modules$")
(setopt projectile-ignored-project-function
(lambda (path) (string-prefix-p "/nix/" (file-truename path))))
:general :general
(phundrak/leader-key (phundrak/leader-key
"p" '(:keymap projectile-command-map :which-key "projectile"))) "p" '(:keymap projectile-command-map :which-key "projectile")))

View File

@@ -1,7 +1,7 @@
#+title: Emacs — Packages — Autocompletion #+title: Emacs — Packages — Autocompletion
#+setupfile: ../../headers #+setupfile: ../../headers
#+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code #+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code
#+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/lisp/autocompletion.el #+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/user-lisp/autocompletion.el
#+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export #+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export
* Autocompletion * Autocompletion

View File

@@ -1,7 +1,7 @@
#+title: Emacs — Packages — Editing #+title: Emacs — Packages — Editing
#+setupfile: ../../headers #+setupfile: ../../headers
#+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code #+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code
#+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/lisp/editing.el #+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/user-lisp/editing.el
#+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export #+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export
@@ -67,6 +67,9 @@ enough for me.
:after evil :after evil
:config :config
(add-to-list 'evil-surround-pairs-alist '(?$ . ("${" . "}"))) (add-to-list 'evil-surround-pairs-alist '(?$ . ("${" . "}")))
(add-to-list 'evil-surround-pairs-alist '( . ("« " . " »")))
(add-to-list 'evil-surround-pairs-alist '(?“ . ("“ " . " ”")))
(add-to-list 'evil-surround-pairs-alist '(? . ("" . "")))
(global-evil-surround-mode 1)) (global-evil-surround-mode 1))
#+end_src #+end_src
@@ -176,4 +179,30 @@ is a bit too small for me, and I prefer not to go full-screen.
writeroom-maximize-window nil writeroom-maximize-window nil
writeroom-mode-line t writeroom-mode-line t
writeroom-major-modes '(text-mode org-mode markdown-mode nov-mode Info-mode))) writeroom-major-modes '(text-mode org-mode markdown-mode nov-mode Info-mode)))
(with-eval-after-load 'transient
(defun my/writeroom-reset ()
(interactive)
(setq writeroom-width 100)
(writeroom-adjust-width nil))
(defun my/writeroom-fit-buffer ()
"Set writeroom to fit the longest line in the current buffer."
(interactive)
(when writeroom-mode
(let ((max-width 0))
(save-excursion
(goto-char (point-min))
(while (not (eobp))
(end-of-line)
(setq max-width (max max-width (current-column)))
(forward-line 1)))
(writeroom-adjust-width (- max-width visual-fill-column-width)))))
(transient-define-prefix my/writeroom-transient ()
"Writewroom Transient"
["Adjust"
("r" "widen" writeroom-increase-width :transient t)
("c" "tighten" writeroom-decrease-width :transient t)
("q" "quit" transient-quit-all)]))
#+end_src #+end_src

View File

@@ -1,7 +1,7 @@
#+title: Emacs — Packages — Emacs Built-ins #+title: Emacs — Packages — Emacs Built-ins
#+setupfile: ../../headers #+setupfile: ../../headers
#+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code #+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code
#+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/lisp/emacs-builtin.el #+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/user-lisp/emacs-builtin.el
#+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export #+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export
@@ -480,30 +480,4 @@ the following code.
(require 'tramp-sh) (require 'tramp-sh)
(setq tramp-remote-path (append tramp-remote-path (setq tramp-remote-path (append tramp-remote-path
'(tramp-own-remote-path))) '(tramp-own-remote-path)))
#+end_src
*** Yadm
[[https://yadm.io/][~yadm~]] is a git wrapper made to easily manage your dotfiles. It has
loads of features I dont use (the main one I like but dont use is
its [[https://yadm.io/docs/templates][Jinja-like host and OS-aware syntax]]), but unfortunately Magit
doesnt play nice with it. Tramp to the rescue, and this page explains
how! Lets just insert in my config this code snippet:
#+name: tramp-add-yadm
#+begin_src emacs-lisp :tangle no
(add-to-list 'tramp-methods
'("yadm"
(tramp-login-program "yadm")
(tramp-login-args (("enter")))
(tramp-login-env (("SHELL") ("/bin/sh")))
(tramp-remote-shell "/bin/sh")
(tramp-remote-shell-args ("-c"))))
#+end_src
Ill also create a fuction for connecting to this new Tramp protocol:
#+begin_src emacs-lisp
(defun my/yadm ()
"Manage my dotfiles through TRAMP."
(interactive)
(magit-status "/yadm::"))
#+end_src #+end_src

View File

@@ -1,7 +1,7 @@
#+title: Emacs — Packages — EXWM (Deprecated) #+title: Emacs — Packages — EXWM (Deprecated)
#+setupfile: ../../headers #+setupfile: ../../headers
#+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code #+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code
#+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/lisp/exwm.el #+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/user-lisp/exwm.el
#+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export #+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export
* EXWM (Deprecated) * EXWM (Deprecated)

View File

@@ -1,7 +1,7 @@
#+title: Emacs — Packages — Making My Life Easier #+title: Emacs — Packages — Making My Life Easier
#+setupfile: ../../headers #+setupfile: ../../headers
#+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code #+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code
#+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/lisp/helpful.el #+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/user-lisp/helpful.el
#+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export #+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export
* Making my life easier * Making my life easier

View File

@@ -1,7 +1,7 @@
#+title: Emacs — Packages — LaTeX #+title: Emacs — Packages — LaTeX
#+setupfile: ../../headers #+setupfile: ../../headers
#+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code #+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code
#+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/lisp/latex.el #+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/user-lisp/latex.el
#+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export #+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export
* LaTeX * LaTeX

View File

@@ -1,7 +1,7 @@
#+title: Emacs — Packages — Misc #+title: Emacs — Packages — Misc
#+setupfile: ../../headers #+setupfile: ../../headers
#+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code #+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code
#+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/lisp/misc.el #+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/user-lisp/misc.el
#+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export #+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export
* Misc * Misc

View File

@@ -1,7 +1,7 @@
#+title: Emacs — Packages — Org Mode #+title: Emacs — Packages — Org Mode
#+setupfile: ../../headers #+setupfile: ../../headers
#+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code #+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code
#+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/lisp/org.el #+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/user-lisp/org.el
#+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export #+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export
* Org-mode * Org-mode

View File

@@ -1,11 +1,20 @@
#+title: Emacs — Packages — Programming #+title: Emacs — Packages — Programming
#+setupfile: ../../headers #+setupfile: ../../headers
#+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code #+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code
#+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/lisp/programming.el #+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/user-lisp/programming.el
#+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export #+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export
* Programming * Programming
** Tools ** Tools
*** Nix environments
#+begin_src emacs-lisp
(use-package envrc
:straight (:build t)
:hook (after-init . envrc-global-mode))
(use-package inheritenv :straight (:built t))
#+end_src
*** Treesitter *** Treesitter
Treesit is a native Emacs [[https://tree-sitter.github.io/tree-sitter/][tree-sitter]] implementation which provides a Treesit is a native Emacs [[https://tree-sitter.github.io/tree-sitter/][tree-sitter]] implementation which provides a
very fast and flexible way of performing code-highlighting in Emacs. very fast and flexible way of performing code-highlighting in Emacs.
@@ -22,41 +31,12 @@ variables to install grammars for different languages.
#+end_src #+end_src
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package tree-sitter-langs
:after tree-sitter
:straight t
:custom (global-tree-sitter-mode t)
:init
(add-to-list 'treesit-extra-load-path
(expand-file-name "bin" tree-sitter-langs-grammar-dir)))
(use-package treesit-auto
:after tree-sitter
:straight t
:config (global-treesit-auto-mode))
(use-package treesit-fold (use-package treesit-fold
:after tree-sitter :after tree-sitter
:straight (:build t :host github :repo "emacs-tree-sitter/treesit-fold") :straight (:build t :host github :repo "emacs-tree-sitter/treesit-fold")
:init (global-treesit-fold-mode t)) :init (global-treesit-fold-mode t))
#+end_src #+end_src
*** Appwrite
[[https://appwrite.io][Appwrite]] is an open-source and self-hostable alternative to Firebase.
I am currently working on a server SDK for Appwrite in Emacs, so here
it is.
#+begin_src emacs-lisp
(use-package appwrite
:defer t
:straight (appwrite :build t
:type git
:host github
:repo "Phundrak/appwrite.el")
:config
(setopt appwrite-endpoint "https://appwrite.phundrak.com"
appwrite-devel t))
#+end_src
*** Flycheck *** Flycheck
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package flycheck (use-package flycheck
@@ -633,6 +613,7 @@ Markdown.
(use-package nix-ts-mode (use-package nix-ts-mode
:mode "\\.nix\\'" :mode "\\.nix\\'"
:straight (:build t) :straight (:build t)
:hook (nix-ts-mode . lsp-deferred)
:config (add-to-list 'major-mode-remap-alist '((nix-mode . nix-ts-mode)))) :config (add-to-list 'major-mode-remap-alist '((nix-mode . nix-ts-mode))))
#+end_src #+end_src
@@ -661,74 +642,6 @@ Nginx syntax.
(add-to-list 'company-backends #'company-nginx)))) (add-to-list 'company-backends #'company-nginx))))
#+end_src #+end_src
*** PKGBUILD
As I am an ArchLinux user, I sometimes have to interact with PKGBUILD
files, both from the AUR when I want to install something from there
or some I write myself.
#+begin_src emacs-lisp
(use-package pkgbuild-mode
:straight (:build t)
:defer t
:custom
(pkgbuild-update-sums-on-save nil)
(pkgbuild-ask-about-save nil)
:general
(phundrak/major-leader-key
:keymaps 'pkgbuild-mode-map
"c" #'pkgbuild-syntax-check
"i" #'pkgbuild-initialize
"I" #'pkgbuild-increase-release-tag
"m" #'pkgbuild-makepkg
"u" '(:ignore :wk "update")
"us" #'pkgbuild-update-sums-line
"uS" #'pkgbuild-update-srcinfo))
#+end_src
*** PlantUML
#+begin_src emacs-lisp
(use-package plantuml-mode
:defer t
:straight (:build t)
:mode ("\\.\\(pum\\|puml\\)\\'" . plantuml-mode)
:after ob
:init
(add-to-list 'org-babel-load-languages '(plantuml . t))
:general
(phundrak/major-leader-key
:keymaps 'plantuml-mode-map
:packages 'plantuml-mode
"c" '(:ignore t :which-key "compile")
"cc" #'plantuml-preview
"co" #'plantuml-set-output-type)
:config
(setq plantuml-default-exec-mode 'jar
plantuml-jar-path "~/.local/bin/plantuml.jar"
org-plantuml-jar-path "~/.local/bin/plantuml.jar"))
#+end_src
*** QML
Im currently working on a [[https://quickshell.org/][Quickshell]] configuration to replace my
[[https://github.com/Alexays/Waybar][Waybar]] one. Quickshell is configured with [[https://doc.qt.io/qt-6/qmlapplications.html][QML]], which requires its
major mode.
#+begin_src emacs-lisp
(use-package qml-ts-mode
:after lsp-mode
:straight (qml-ts-mode :build t
:type git
:host github
:repo "xhcoding/qml-ts-mode")
:config
(add-to-list 'lsp-language-id-configuration '(qml-ts-mode . "qml-ts"))
(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection '("qmlls" "-E"))
:activation-fn (lsp-activate-on "qml-ts")
:server-id 'qmlls))
(add-hook 'qml-ts-mode-hook (lambda ()
(setq-local electric-indent-chars '(?\n ?\( ?\) ?{ ?} ?\[ ?\] ?\; ?,))
(lsp-deferred))))
#+end_src
*** Ron files *** Ron files
Rusty Object Notation, or RON for short, is to Rust what Json is to Rusty Object Notation, or RON for short, is to Rust what Json is to
Javascript. Sometimes, I have to work with such files, which is why I Javascript. Sometimes, I have to work with such files, which is why I
@@ -800,17 +713,6 @@ When editing some scripts though, I need to use the built-in ~shell-mode~.
:mode "\\.yaml\\'") :mode "\\.yaml\\'")
#+end_src #+end_src
*** yuck
This is one of the two file formats used by [[https://github.com/elkowar/eww/][eww]]s configuration, a
Lisp-like language. Therefore, it will also use [[file:./editing.md#parinfer][parinfer]] to manage its
parenthesis.
#+begin_src emacs-lisp
(use-package yuck-mode
:straight (:build t)
:defer t
:hook ((yuck-mode . parinfer-rust-mode)))
#+end_src
** General Programming Languages ** General Programming Languages
*** C/C++ *** C/C++
I know, I know, C and C++ no longer are closely related languages, I know, I know, C and C++ no longer are closely related languages,
@@ -1328,13 +1230,6 @@ several improvements on top of =rust-mode=.
(remove-hook 'rustic-mode-hook #'rustic-setup-lsp)) (remove-hook 'rustic-mode-hook #'rustic-setup-lsp))
#+end_src #+end_src
*** Uiua
#+begin_src emacs-lisp
(use-package uiua-ts-mode
:mode "\\.ua\\'"
:straight (:build t))
#+end_src
*** Web programming *** Web programming
[[https://emmet.io/][Emmet]] is a powerful templating engine that can generate through simple [[https://emmet.io/][Emmet]] is a powerful templating engine that can generate through simple
CSS-like expression some HTML to avoid the user writing everything by CSS-like expression some HTML to avoid the user writing everything by

View File

@@ -1,7 +1,7 @@
#+title: Emacs — Packages — Visual Configuration #+title: Emacs — Packages — Visual Configuration
#+setupfile: ../../headers #+setupfile: ../../headers
#+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code #+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code
#+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/lisp/visual-config.el #+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/user-lisp/visual-config.el
#+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export #+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export
* Visual Configuration * Visual Configuration