Compare commits
11 Commits
493815b939
...
35a525e3fc
| Author | SHA1 | Date | |
|---|---|---|---|
|
35a525e3fc
|
|||
|
39c311ba41
|
|||
|
8f68f4ba04
|
|||
|
027761fc52
|
|||
|
c05329171d
|
|||
|
0a2b238e1e
|
|||
|
c8b7d1b899
|
|||
|
aa793e0638
|
|||
|
af2f22aa4b
|
|||
|
1ea379f907
|
|||
|
e42b591bd8
|
80
devenv.lock
80
devenv.lock
@@ -3,10 +3,11 @@
|
||||
"devenv": {
|
||||
"locked": {
|
||||
"dir": "src/modules",
|
||||
"lastModified": 1771852244,
|
||||
"lastModified": 1777679510,
|
||||
"narHash": "sha256-uG8LPb1useAwa0cjO5sEkYhCSPjbWiCH3DyNxQLVSck=",
|
||||
"owner": "cachix",
|
||||
"repo": "devenv",
|
||||
"rev": "c88c14a32d06173867e26b7d4f5daed38a3f6f1e",
|
||||
"rev": "bc8b21628907c726c74094cedc439c10a455cdb7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -16,71 +17,16 @@
|
||||
"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": {
|
||||
"inputs": {
|
||||
"nixpkgs-src": "nixpkgs-src"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1770434727,
|
||||
"lastModified": 1776852779,
|
||||
"narHash": "sha256-WwO/ITisCXwyiRgtktZgv3iGhAGO+IB5Av4kKCwezR0=",
|
||||
"owner": "cachix",
|
||||
"repo": "devenv-nixpkgs",
|
||||
"rev": "8430f16a39c27bdeef236f1eeb56f0b51b33d348",
|
||||
"rev": "ec3063523dcd911aeadb50faa589f237cdab5853",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -93,11 +39,11 @@
|
||||
"nixpkgs-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1769922788,
|
||||
"narHash": "sha256-H3AfG4ObMDTkTJYkd8cz1/RbY9LatN5Mk4UF48VuSXc=",
|
||||
"lastModified": 1776329215,
|
||||
"narHash": "sha256-a8BYi3mzoJ/AcJP8UldOx8emoPRLeWqALZWu4ZvjPXw=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "207d15f1a6603226e1e223dc79ac29c7846da32e",
|
||||
"rev": "b86751bc4085f48661017fa226dee99fab6c651b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -110,14 +56,10 @@
|
||||
"root": {
|
||||
"inputs": {
|
||||
"devenv": "devenv",
|
||||
"git-hooks": "git-hooks",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"pre-commit-hooks": [
|
||||
"git-hooks"
|
||||
]
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
#+title: Emacs — Basic Configuration
|
||||
#+setupfile: ../headers
|
||||
#+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
|
||||
|
||||
* Basic Configuration
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#+title: Emacs — Custom Elisp
|
||||
#+setupfile: ../headers
|
||||
#+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
|
||||
|
||||
* Custom Elisp
|
||||
|
||||
@@ -78,6 +78,8 @@ block.
|
||||
#+end_src
|
||||
|
||||
** Loading All Configuration Modules
|
||||
Here are all my Emacs configuration modules, each dedicated to a
|
||||
specific aspect of my Emacs configuration.
|
||||
|
||||
#+name: emacs-modules
|
||||
| Module Name | Config Page |
|
||||
@@ -98,27 +100,58 @@ block.
|
||||
| =visual-config.el= | [[file:./packages/visual-config.org][Packages — Visual Configuration]] |
|
||||
| =keybindings.el= | [[file:./keybindings.org][Keybindings]] |
|
||||
|
||||
#+name: generate-modules
|
||||
#+begin_src emacs-lisp :tangle no :cache yes :var modules=emacs-modules :exports none
|
||||
(mapconcat (lambda (line)
|
||||
(concat "\"" (string-trim (car line) "=" "=") "\""))
|
||||
modules
|
||||
" ")
|
||||
#+name: modules
|
||||
#+begin_src emacs-lisp :tangle no :cache yes :var modules=emacs-modules :exports none :results list
|
||||
(mapcar (lambda (module) (string-trim (car module) "=" "="))
|
||||
modules)
|
||||
#+end_src
|
||||
|
||||
#+RESULTS[05f9bb535bec2ba84390cc118600323683f51e7c]: generate-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"
|
||||
#+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
|
||||
|
||||
#+begin_src emacs-lisp :noweb yes
|
||||
(dolist (module '(<<generate-modules()>>))
|
||||
The first thing Emacs does is verify if any of these modules need to
|
||||
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
|
||||
(expand-file-name "lisp" user-emacs-directory))))
|
||||
(expand-file-name "user-lisp" user-emacs-directory))))
|
||||
#+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]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#+title: Emacs — Keybinding Managers
|
||||
#+setupfile: ../headers
|
||||
#+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
|
||||
|
||||
* Keybinding Managers
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#+title: Emacs — Keybindings
|
||||
#+setupfile: ../headers
|
||||
#+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
|
||||
|
||||
* Keybindings
|
||||
@@ -263,7 +263,7 @@ I also have some keybindings dedicated to opening specific files.
|
||||
"fI" '((lambda ()
|
||||
(interactive)
|
||||
(quick-find-files nil
|
||||
(expand-file-name "lisp" user-emacs-directory)
|
||||
(expand-file-name "user-lisp" user-emacs-directory)
|
||||
"el"))
|
||||
:which-key "elisp config"
|
||||
: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 there’s not
|
||||
much to say. The prefix here is ~w~.
|
||||
#+name: keybindings-windows
|
||||
| Key | Function | Description | Package |
|
||||
|-----+-------------------------------+-------------+----------------|
|
||||
| | | windows | |
|
||||
| c | evil-window-left | | evil |
|
||||
| t | evil-window-down | | evil |
|
||||
| s | evil-window-up | | evil |
|
||||
| r | evil-window-right | | evil |
|
||||
| . | windows-adjust-size/body | | |
|
||||
| - | split-window-below-and-focus | | |
|
||||
| / | split-window-right-and-focus | | |
|
||||
| $ | winum-select-window-by-number | | winum |
|
||||
| 0 | winum-select-window-0-or-10 | none | winum |
|
||||
| 1 | winum-select-window-1 | none | winum |
|
||||
| 2 | winum-select-window-2 | none | winum |
|
||||
| 3 | winum-select-window-3 | none | winum |
|
||||
| 4 | winum-select-window-4 | none | winum |
|
||||
| 5 | winum-select-window-5 | none | winum |
|
||||
| 6 | winum-select-window-6 | none | winum |
|
||||
| 7 | winum-select-window-7 | none | winum |
|
||||
| 8 | winum-select-window-8 | none | winum |
|
||||
| 9 | winum-select-window-9 | none | winum |
|
||||
| b | kill-buffer-and-window | | |
|
||||
| d | delete-window | | |
|
||||
| o | other-window | | |
|
||||
| D | delete-other-windows | | |
|
||||
| w | | writeroom | |
|
||||
| w. | writeroom-buffer-width/body | | writeroom-mode |
|
||||
| ww | writeroom-mode | | writeroom-mode |
|
||||
| Key | Function | Description | Package |
|
||||
|-----+-------------------------------+----------------+----------------|
|
||||
| | | windows | |
|
||||
| c | evil-window-left | | evil |
|
||||
| t | evil-window-down | | evil |
|
||||
| s | evil-window-up | | evil |
|
||||
| r | evil-window-right | | evil |
|
||||
| . | windows-adjust-size/body | | |
|
||||
| - | split-window-below-and-focus | | |
|
||||
| / | split-window-right-and-focus | | |
|
||||
| $ | winum-select-window-by-number | | winum |
|
||||
| 0 | winum-select-window-0-or-10 | none | winum |
|
||||
| 1 | winum-select-window-1 | none | winum |
|
||||
| 2 | winum-select-window-2 | none | winum |
|
||||
| 3 | winum-select-window-3 | none | winum |
|
||||
| 4 | winum-select-window-4 | none | winum |
|
||||
| 5 | winum-select-window-5 | none | winum |
|
||||
| 6 | winum-select-window-6 | none | winum |
|
||||
| 7 | winum-select-window-7 | none | winum |
|
||||
| 8 | winum-select-window-8 | none | winum |
|
||||
| 9 | winum-select-window-9 | none | winum |
|
||||
| b | kill-buffer-and-window | | |
|
||||
| d | delete-window | | |
|
||||
| o | other-window | | |
|
||||
| D | delete-other-windows | | |
|
||||
| w | | writeroom | |
|
||||
| w. | my/writeroom-transient | adapt width | |
|
||||
| w= | my/writeroom-reset | reset width | |
|
||||
| wf | my/writeroom-fit-buffer | fit to content | |
|
||||
| ww | writeroom-mode | | writeroom-mode |
|
||||
|
||||
** Quit
|
||||
Why would I ever use any of these keybindings? They are prefixed with ~q~.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#+title: Emacs — Package Manager
|
||||
#+setupfile: ../headers
|
||||
#+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
|
||||
|
||||
* Package Manager
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#+title: Emacs — Packages — Applications
|
||||
#+setupfile: ../../headers
|
||||
#+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
|
||||
|
||||
* Applications
|
||||
@@ -1280,7 +1280,7 @@ in quite a few languages.
|
||||
langtool-show-message-at-point
|
||||
langtool-correct-buffer)
|
||||
:custom
|
||||
(langtool-default-language "en-US")
|
||||
(langtool-default-language "en-GB")
|
||||
(langtool-mother-tongue "fr")
|
||||
:config
|
||||
(setq langtool-http-server-host "localhost"
|
||||
@@ -1399,53 +1399,6 @@ left it.
|
||||
#+end_src
|
||||
|
||||
** Project Management
|
||||
*** Jujutsu
|
||||
Let’s face it: [[https://git-scm.com/][git]] is awesome. There’s 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 it’s not great.
|
||||
|
||||
[[https://jj-vcs.github.io/][Jujutsu]] on the other hand, is awesome! It’s 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 it’s entirely
|
||||
compatible with git repositories. In fact, I pretty much don’t use git
|
||||
anymore, jj (abbreviation of Jujutsu) has almost completely replaced
|
||||
git for me.
|
||||
|
||||
I like Magit’s interface, as you can see in my [[file:./applications.md#magit][Magit]] config.
|
||||
Therefore, let’s 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, I’ll 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 is an awesome wrapper around Git for Emacs! Very often, I go
|
||||
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))
|
||||
#+end_src
|
||||
|
||||
*** Jujutsu
|
||||
Let’s face it: [[https://git-scm.com/][git]] is awesome. There’s 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 it’s not great.
|
||||
|
||||
[[https://jj-vcs.github.io/][Jujutsu]] on the other hand, is awesome! It’s 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 it’s entirely
|
||||
compatible with git repositories. In fact, I pretty much don’t use git
|
||||
anymore, jj (abbreviation of Jujutsu) has almost completely replaced
|
||||
git for me.
|
||||
|
||||
I like Magit’s interface, as you can see in my [[file:./applications.md#magit][Magit]] config.
|
||||
Therefore, let’s 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, I’ll 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 acts as an interface for GitHub, GitLab, and Bitbucket inside
|
||||
Magit. A lot of possibilities are present, you can read issues and
|
||||
@@ -1619,6 +1619,8 @@ to projectile.
|
||||
(projectile-mode)
|
||||
(add-to-list 'projectile-ignored-projects "~/")
|
||||
(add-to-list 'projectile-globally-ignored-directories "^node_modules$")
|
||||
(setopt projectile-ignored-project-function
|
||||
(lambda (path) (string-prefix-p "/nix/" (file-truename path))))
|
||||
:general
|
||||
(phundrak/leader-key
|
||||
"p" '(:keymap projectile-command-map :which-key "projectile")))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#+title: Emacs — Packages — Autocompletion
|
||||
#+setupfile: ../../headers
|
||||
#+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
|
||||
|
||||
* Autocompletion
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#+title: Emacs — Packages — Editing
|
||||
#+setupfile: ../../headers
|
||||
#+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
|
||||
|
||||
|
||||
@@ -67,6 +67,9 @@ enough for me.
|
||||
:after evil
|
||||
: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 '(?‘ . ("‘" . "’")))
|
||||
(global-evil-surround-mode 1))
|
||||
#+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-mode-line t
|
||||
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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#+title: Emacs — Packages — Emacs Built-ins
|
||||
#+setupfile: ../../headers
|
||||
#+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
|
||||
|
||||
|
||||
@@ -480,30 +480,4 @@ the following code.
|
||||
(require 'tramp-sh)
|
||||
(setq tramp-remote-path (append tramp-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 don’t use (the main one I like but don’t use is
|
||||
its [[https://yadm.io/docs/templates][Jinja-like host and OS-aware syntax]]), but unfortunately Magit
|
||||
doesn’t play nice with it. Tramp to the rescue, and this page explains
|
||||
how! Let’s 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
|
||||
|
||||
I’ll 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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#+title: Emacs — Packages — EXWM (Deprecated)
|
||||
#+setupfile: ../../headers
|
||||
#+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
|
||||
|
||||
* EXWM (Deprecated)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#+title: Emacs — Packages — Making My Life Easier
|
||||
#+setupfile: ../../headers
|
||||
#+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
|
||||
|
||||
* Making my life easier
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#+title: Emacs — Packages — LaTeX
|
||||
#+setupfile: ../../headers
|
||||
#+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
|
||||
|
||||
* LaTeX
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#+title: Emacs — Packages — Misc
|
||||
#+setupfile: ../../headers
|
||||
#+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
|
||||
|
||||
* Misc
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#+title: Emacs — Packages — Org Mode
|
||||
#+setupfile: ../../headers
|
||||
#+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
|
||||
|
||||
* Org-mode
|
||||
|
||||
@@ -1,11 +1,20 @@
|
||||
#+title: Emacs — Packages — Programming
|
||||
#+setupfile: ../../headers
|
||||
#+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
|
||||
|
||||
* Programming
|
||||
** 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
|
||||
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.
|
||||
@@ -22,19 +31,6 @@ variables to install grammars for different languages.
|
||||
#+end_src
|
||||
|
||||
#+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
|
||||
:after tree-sitter
|
||||
:straight (:build t :host github :repo "emacs-tree-sitter/treesit-fold")
|
||||
@@ -633,6 +629,7 @@ Markdown.
|
||||
(use-package nix-ts-mode
|
||||
:mode "\\.nix\\'"
|
||||
:straight (:build t)
|
||||
:hook (nix-ts-mode . lsp-deferred)
|
||||
:config (add-to-list 'major-mode-remap-alist '((nix-mode . nix-ts-mode))))
|
||||
#+end_src
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#+title: Emacs — Packages — Visual Configuration
|
||||
#+setupfile: ../../headers
|
||||
#+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
|
||||
|
||||
* Visual Configuration
|
||||
|
||||
Reference in New Issue
Block a user