This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
* Emacs Configuration
|
||||
|
||||
[[file:./img/emacs.svg]]
|
||||
#+html: <ImgFigure src="/img/emacs.svg">Emacs Screenshot</ImgFigure>
|
||||
|
||||
** Introduction
|
||||
After a couple of years using Spacemacs and a failed attempt at
|
||||
@@ -29,9 +29,7 @@ general-purpose programming language. Therefore, if you want to do
|
||||
something in Emacs, with enough Elisp you can do it --- if it’s not in
|
||||
Emacs already, that is.
|
||||
|
||||
#+attr_html: :alt Dammit Emacs… :loading lazy
|
||||
#+caption: [[https://xkcd.com/378/][XKCD n°378]]: Real Programmers
|
||||
[[file:./img/real_programmers.png]]
|
||||
#+html: <ImgFigure src="/img/emacs.svg" alt="XKCD n°378: Real Programmers">Dammit Emacs…</ImgFigure>
|
||||
|
||||
** A Warning Before You Proceed
|
||||
:PROPERTIES:
|
||||
|
||||
@@ -83,6 +83,7 @@ Undefining some stuff to make keybind prefixes work correctly.
|
||||
<<general-keybindings-gen(table=keybindings-refactor, prefix="r")>>
|
||||
<<general-keybindings-gen(table=keybindings-toggle, prefix="t ")>>
|
||||
<<general-keybindings-gen(table=keybindings-text, prefix="T")>>
|
||||
<<general-keybindings-gen(table=keybindings-vc, prefix="v")>>
|
||||
<<general-keybindings-gen(table=keybindings-windows, prefix="w")>>
|
||||
<<general-keybindings-gen(table=keybindings-quit, prefix="q")>>)
|
||||
#+end_src
|
||||
@@ -499,6 +500,26 @@ My toggle keybindings are prefixed by ~t~.
|
||||
| is | set-input-method | |
|
||||
|
||||
*** TODO Rewrite =my/modify-frame-alpha-background/body= :noexport:
|
||||
** VCS
|
||||
Magit is awesome, but I rarely use it nowadays in favour of [[https://jj-vcs.github.io/][Jujutsu]].
|
||||
And for that, I use =vc.el= in Emacs thanks to =vc-jj= (see [[file:./packages/applications.md#Jujutsu][my Jujutsu
|
||||
config for Emacs]]). But this is only half the story, let me now set my
|
||||
keybinds for =vc.el=. ethey are all prefixed by =v=.
|
||||
|
||||
#+name: keybindings-vc
|
||||
| Key | Function | Description | Package |
|
||||
|-----+-----------------------+-------------+---------|
|
||||
| a | vc-annotate | | vc |
|
||||
| r | vc-revset | | vc |
|
||||
| | | VCS | |
|
||||
| j | | jujutsu | |
|
||||
| ja | vc-jj-abandon-change | abandon | vc-jj |
|
||||
| jb | | bookmarks | |
|
||||
| jbd | vc-jj-bookmark-delete | delete | vc-jj |
|
||||
| jbr | vc-jj-bookmark-rename | rename | vc-jj |
|
||||
| jbs | vc-jj-bookmark-set | set | vc-jj |
|
||||
| je | vc-jj-edit-change | edit | vc-jj |
|
||||
| jn | vc-jj-new-change | new | vc-jj |
|
||||
|
||||
** Windows
|
||||
A couple of keybindings are hidden from which-key, otherwise there’s not
|
||||
|
||||
@@ -1530,9 +1530,10 @@ 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.
|
||||
I like Magit’s interface, as you can see in my [[file:./applications.md#magit][Magit]] config. But
|
||||
reimplementing it entirely probably won’t happen on my end (lack of
|
||||
time, mainly), so I’ll leave that up to people more motivated than me.
|
||||
In the meantime, I can reimplement some of its API with =majjit=.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package majjit
|
||||
:defer t
|
||||
@@ -1544,6 +1545,22 @@ bringing some Magit features to jujutsu.
|
||||
:custom ((majjit-default-directory "~/code/")))
|
||||
#+end_src
|
||||
|
||||
Speaking of other projects others did better, I use =vc-jj=, which
|
||||
brings basic jujutsu support to =project.el= and =vc.el=. And I’ll just
|
||||
add my grain of salt to force =project.el= to recognize jujutsu
|
||||
repositories as projects.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package vc-jj
|
||||
:straight (:build t)
|
||||
:after '(project vc)
|
||||
:config
|
||||
(add-to-list 'project-vc-extra-root-markers ".jj")
|
||||
:init
|
||||
(require 'project)
|
||||
(require 'vc)
|
||||
(require 'vc-jj))
|
||||
#+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.
|
||||
@@ -1556,12 +1573,6 @@ writing my commit messages.
|
||||
: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
|
||||
|
||||
@@ -175,7 +175,7 @@ compilation buffer, as well as enable some syntax highlighting.
|
||||
#+end_src
|
||||
|
||||
** Eshell
|
||||
[[file:../img/emacs-eshell.svg]]
|
||||
#+html: <ImgFigure src="/img/emacs-eshell.svg">Eshell in Emacs</ImgFigure>
|
||||
|
||||
Eshell is a built-in shell available from Emacs which I use almost as
|
||||
often as fish. Some adjustments are necessary to make it fit my taste
|
||||
|
||||
@@ -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 no
|
||||
#+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export
|
||||
|
||||
* EXWM (Deprecated)
|
||||
@@ -47,7 +47,7 @@ easily.
|
||||
|
||||
In order to launch Emacs with EXWM with ~startx~, I need a ~xinit~ file.
|
||||
This one is exported to ~$HOME/.xinitrc.emacs~.
|
||||
#+begin_src sh :tangle ~/.xinitrc.emacs :shebang "#!/bin/sh"
|
||||
#+begin_src sh :tangle no :shebang "#!/bin/sh"
|
||||
xhost +SI:localuser:$USER
|
||||
|
||||
# Set fallback cursor
|
||||
|
||||
@@ -455,6 +455,10 @@ Yes, I love org-mode and I largely prefer to use it instead of
|
||||
Markdown due to its far superior power and abilities. But still,
|
||||
sometimes I need to use Markdown because not everyone uses org-mode,
|
||||
unfortunately.
|
||||
|
||||
I prefer to use =pandoc= to =markdown= as my =markdown-command=, as it
|
||||
better handles modern Markdown, including Github’s dialect, which
|
||||
=markdown= has troubles with.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package markdown-mode
|
||||
:defer t
|
||||
@@ -465,6 +469,9 @@ unfortunately.
|
||||
("\\.mdx\\'" . markdown-mode))
|
||||
:hook (markdown-mode . orgtbl-mode)
|
||||
:hook (markdown-mode . visual-line-mode)
|
||||
:config
|
||||
(setq markdown-fontify-code-blocks-natively t
|
||||
markdown-command '("," "pandoc" "--from=markdown" "--to=html5"))
|
||||
:general
|
||||
(phundrak/evil
|
||||
:keymaps 'markdown-mode-map
|
||||
@@ -550,9 +557,7 @@ unfortunately.
|
||||
"xp" #'markdown-insert-pre
|
||||
"xP" #'markdown-pre-region
|
||||
"xs" #'markdown-insert-strike-through
|
||||
"xq" #'markdown-blockquote-region)
|
||||
:config
|
||||
(setq markdown-fontify-code-blocks-natively t))
|
||||
"xq" #'markdown-blockquote-region))
|
||||
#+end_src
|
||||
|
||||
Since most of my Markdown files are related to GitHub, I’d like to be
|
||||
@@ -704,6 +709,28 @@ When editing some scripts though, I need to use the built-in ~shell-mode~.
|
||||
:mode "/\\(Cargo.lock\\|\\.cargo/config\\)\\'")
|
||||
#+end_src
|
||||
|
||||
*** Typst
|
||||
[[https://typst.app/][Typst]] is an attempt at making a simpler LaTeX alternative with a quite
|
||||
simple language that still has some programming capabilities. In my
|
||||
case, I use [[https://codeberg.org/meow_king/typst-ts-mode/][typst-ts-mode]] to get a major mode for Typst, relying on
|
||||
[[https://github.com/uben0/tree-sitter-typst][uben0’s Typst treesitter module]].
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(use-package typst-ts-mode
|
||||
:defer t
|
||||
:straight (:build t))
|
||||
#+end_src
|
||||
|
||||
I also wrote a package that extends =lsp-mode= to support [[https://github.com/Myriad-Dreamin/tinymist][tinymist]] as an
|
||||
LSP server for Typst.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package lsp-typst
|
||||
:after lsp-mode
|
||||
:mode "\\.typ\\'"
|
||||
:hook (typst-ts-mode . lsp-deferred)
|
||||
:straight (:build t :type git :repo "labs.phundrak.com/phundrak/lsp-typst"))
|
||||
#+end_src
|
||||
|
||||
*** Yaml
|
||||
#+begin_src emacs-lisp
|
||||
(use-package yaml-mode
|
||||
|
||||
Reference in New Issue
Block a user