[Emacs] Switching to Chemacs2, added vanilla and Doom

Chemacs2 is a utility for Emacs to switch between various profiles and
configurations of Emacs without a hassle.

It thus helps me run my fully configured Spacemacss alongside my new
attempt at configuring some vanilla Emacs after years of using
Spacemacs.
I also added Doom-Emacs for reference.
This commit is contained in:
Lucien Cartier-Tilet 2021-04-21 22:00:50 +02:00
parent c90d876f9a
commit 0510eaa0f5
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA
11 changed files with 517 additions and 40 deletions

1
.config/chemacs/profile Normal file
View File

@ -0,0 +1 @@
spacemacs

View File

@ -0,0 +1,3 @@
(("spacemacs" . ((user-emacs-directory . "~/.emacs.spacemacs")))
("vanilla" . ((user-emacs-directory . "~/.emacs.vanilla")))
("doom" . ((user-emacs-directory . "~/.emacs.doom"))))

View File

@ -1 +0,0 @@
.config/emacs/

1
.emacs.d Submodule

@ -0,0 +1 @@
Subproject commit 30a20dbc2799e4ab2f8c509fdadcd90aa9845b5c

1
.emacs.doom Submodule

@ -0,0 +1 @@
Subproject commit a9072e9673527d831ec276fd2bd7f43d03ea38a1

View File

@ -0,0 +1,7 @@
(setq package-enable-at-startup nil)
(setq inhibit-startup-message t)
(scroll-bar-mode -1) ; disable scrollbar
(tool-bar-mode -1) ; disable toolbar
(tooltip-mode -1) ; disable tooltips
(set-fringe-mode 10) ; give some breathing room
(menu-bar-mode -1) ; disable menubar

457
.emacs.vanilla/init.el Normal file
View File

@ -0,0 +1,457 @@
;;; init.el --- My vanilla Emacs configuration -*- lexical-binding: t -*-
;; Author: Lucien Cartier-Tilet
;; Maintainer: Lucien Cartier-Tilet
;; Version: 0.1.0
;; Package-Requires: ((emacs "27.1"))
;; Homepage: https://labs.phundrak.com/emacs
;; This file is not part of GNU Emacs
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; commentary
;;; Code:
(defvar phundrak/default-font-size 90
"Default font size.")
(setq-default custom-file (expand-file-name ".custom.el" user-emacs-directory))
(when (file-exists-p custom-file)
(load custom-file))
(setq visible-bell t) ; set up visible bell
(setq display-time-format "%Y-%m-%d %H:%M")
(display-time-mode 1) ; display time in modeline
;; Display battery in modeline when using a laptop
(unless (equal "Battery status not available"
(battery))
(display-battery-mode 1))
(set-face-attribute 'default nil :font "Cascadia Code" :height phundrak/default-font-size)
(setq frame-title-format
'(""
"%b"
(:eval
(let ((project-name (projectile-project-name)))
(unless (string= "-" project-name)
(format (if (buffer-modified-p) " ◉ %s" "  ●  %s") project-name))))))
;; Make ESC quit prompts
(global-set-key (kbd "<escape>") 'keyboard-escabe-quit)
;; Answer with y or n, not yes or not
(defalias 'yes-or-no-p 'y-or-n-p)
(column-number-mode)
(global-display-line-numbers-mode t)
;; Disable line numbers for some modes
(dolist (mode '(org-mode-hook
term-mode-hook
shell-mode-hook
eshell-mode-hook))
(add-hook mode (lambda () (display-line-numbers-mode 0))))
(setq x-stretch-cursor t ; stretch cursor to the glyphs width
delete-by-moving-to-trash t ; delete files to trash
window-combination-resize t ; take new window space from all other windows
undo-limit 100000000 ; raise undo limit to 100Mb
evil-want-fine-undo t ; more granular undo with evil
auto-save-default t
truncate-string-ellipsis "")
(global-subword-mode 1)
(add-to-list 'default-frame-alist '(height . 24))
(add-to-list 'default-frame-alist '(width . 80))
(setq-default major-mode 'org-mode)
(defun modeline-contitional-buffer-encoding ()
"Hide \"LF UTF-8\" in modeline.
It is expected of files to be encoded with LF UTF-8, so only show
the encoding in the modeline if the encoding is worth notifying
the user."
(setq-local doom-modeline-buffer-encoding
(unless (and (memq (plist-get (coding-system-plist buffer-file-coding-system) :category)
'(coding-category-undecided coding-category-utf-8))
(not (memq (coding-system-eol-type buffer-file-coding-system) '(1 2))))
t)))
(add-hook 'after-change-major-mode-hook #'modeline-contitional-buffer-encoding)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Packages ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Initialize package sources
(require 'package)
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
("org" . "https://orgmode.org/elpa/")
("elpa" . "https://elpa.gnu.org/packages/")))
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 5))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
(package-initialize)
(unless package-archive-contents
(package-refresh-contents))
;; Initialize use-package on non-Linux platforms
(unless (package-installed-p 'use-package)
(package-install 'use-package))
(require 'use-package)
(setq use-package-always-ensure t)
(use-package command-log-mode
:defer t)
(use-package ivy
:defer t
:diminish
:bind (("C-s" . swiper)
:map ivy-minibuffer-map
("TAB" . ivy-alt-done)
("C-l" . ivy-alt-done)
("C-t" . ivy-next-line)
("C-s" . ivy-previous-line)
:map ivy-switch-buffer-map
("C-t" . ivy-next-line)
("C-s" . ivy-previous-line)
("C-l" . ivy-done)
("C-d" . ivy-switch-buffer-kill)
:map ivy-reverse-i-search-map
("C-t" . ivy-next-line)
("C-s" . ivy-previous-line)
("C-d" . ivy-reverse-i-search-kill))
:config
(ivy-mode 1))
;; NOTE: Thi first time you load your configuration on a new machine,
;; youll need to run the following command interactively o that mode
;; line icons display correctly:
;;
;; M-x all-the-icons-install-fonts
(use-package all-the-icons
:defer t)
(use-package doom-modeline
:defer t
:init (doom-modeline-mode 1)
:custom ((doom-modeline-height 15)))
(use-package doom-themes
:defer t
:init (load-theme 'doom-nord t))
(use-package rainbow-delimiters
:defer t
:hook (prog-mode . rainbow-delimiters-mode))
(use-package which-key
:defer t
:init (which-key-mode)
:diminish which-key-mode
:config
(setq which-key-idle-delay 0.3))
(use-package ivy-rich
:defer t
:init
(ivy-rich-mode 1))
(use-package counsel
:defer t
:bind (("M-x" . counsel-M-x)
("C-x b" . counsel-ibuffer)
("C-x C-f" . counsel-find-file)
:map minibuffer-local-map
("C-r" . 'counsel-minibuffer-history)))
(use-package helpful
:defer t
:custom
(counsel-describe-function-function #'helpfull-callable)
(counsel-describe-variable-function #'helpfull-variable)
:bind
([remap describe-function] . counsel-describe-function)
([remap describe-command] . helpful-command)
([remap describe-variable] . counsel-describe-variable)
([remap describe-key] . helpful-key))
(use-package bind-map
:ensure t
:defer )
(use-package spaceleader
:defer t
:after bind-map
:straight (spaceleader :type git
:host github
:repo "mohkale/spaceleader")
:config
(setq leader-key "SPC"
leader-major-mode-prefix ","))
(use-package evil
:init
(setq evil-want-integration t)
(setq evil-want-keybinding nil)
(setq evil-want-C-u-scroll t)
(setq evil-want-C-i-jump nil)
:config
(evil-mode 1)
(define-key evil-insert-state-map (kbd "C-g") 'evil-normal-state)
(define-key evil-insert-state-map (kbd "C-h") 'evil-delete-backward-char-and-join)
;; Use visual line motions even outside of visual-line-mode buffers
(evil-global-set-key 'motion "t" 'evil-next-visual-line)
(evil-global-set-key 'motion "s" 'evil-previous-visual-line)
(define-key evil-normal-state-map "c" nil)
(define-key evil-normal-state-map "C" nil)
(define-key evil-normal-state-map "s" nil)
(define-key evil-normal-state-map "S" nil)
(define-key evil-normal-state-map "r" nil)
(define-key evil-normal-state-map "R" nil)
(define-key evil-normal-state-map "j" nil)
(define-key evil-normal-state-map "J" nil)
;je redéfinis certaines fonctions pour létat normal
(define-key evil-normal-state-map "h" 'evil-change)
(define-key evil-normal-state-map "H" 'evil-change-line)
(define-key evil-normal-state-map "T" 'evil-join)
(define-key evil-normal-state-map "l" 'evil-replace)
(define-key evil-normal-state-map "L" 'evil-replace-state)
(define-key evil-normal-state-map "k" 'evil-substitute)
(define-key evil-normal-state-map "K" 'evil-change-whole-line)
;même chose mais cette fois pour létat motion
(define-key evil-motion-state-map "c" 'evil-backward-char)
(define-key evil-motion-state-map "C" 'evil-window-top)
(define-key evil-motion-state-map "t" 'evil-next-line)
(define-key evil-motion-state-map "s" 'evil-previous-line)
(define-key evil-motion-state-map "r" 'evil-forward-char)
(define-key evil-motion-state-map "R" 'evil-window-bottom)
(define-key evil-motion-state-map "j" 'evil-find-char-to)
(define-key evil-motion-state-map "J" 'evil-find-char-to-backward)
(evil-set-initial-state 'messages-buffer-mode 'normal)
(evil-set-initial-state 'dashboard-mode 'normal))
(use-package evil-collection
:after evil
:defer t
:config
(evil-collection-init))
(use-package hydra
:defer t)
(defhydra hydra-text-scale (:timeout 4)
"scale text"
("t" text-scale-increase "in")
("s" text-scale-decrease "out")
("q" nil "quit" :exit t))
(use-package projectile
:defer t
:diminish projectile-mode
:config (projectile-mode)
:custom ((projectile-completion-system 'ivy))
:bind-keymap
("C-c p" . projectile-command-map)
:init
;; NOTE: Set this to the folder where you keep your Git repos!
(when (file-directory-p "~/Documents/code")
(setq projectile-project-search-path '("~/Documents/code")))
(setq projectile-switch-project-action #'projectile-dired))
(use-package counsel-projectile
:defer t
:config (counsel-projectile-mode))
(use-package magit
:defer t
:custom
(magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1))
;; (use-package evil-magit
;; :after magit)
;; NOTE: Make sure to configure a GitHub token before using this package!
;; - https://magit.vc/manual/forge/Token-Creation.html#Token-Creation
;; - https://magit.vc/manual/ghub/Getting-Started.html#Getting-Started
(use-package forge
:defer t)
(defun phundrak-find-org-files ()
"Find all org files in the directories listed in
`phundrak-org-directories', then list them in an ido buffer where
the user can match one and open it."
(interactive)
(find-file
(ivy-completing-read
"Org File: "
(s-split "\n"
(mapconcat (lambda (path)
(shell-command-to-string
(format "fd . %s -e org -c never" path)))
phundrak-org-directories
"\n")))))
;;;;;;;;;;;;;;;; Dashboard
(use-package dashboard
:ensure t
:config
(setq dashboard-banner-logo-title "Phundraks Vanilla Emacs"
dashboard-startup-banner 'logo
dashboard-center-content t
dashboard-show-shortcuts t
dashboard-set-navigator t
dashboard-set-heading-icons t
dashboard-set-file-icons t
dashboard-projects-switch-function 'counsel-projectile-switch-project-by-name
initial-buffer-choice (lambda () (get-buffer "*dashboard*")))
(setq dashboard-navigator-buttons
`(
((,(all-the-icons-faicon "language" :height 1.1 :v-adjust 0.0)
"Linguistics website"
""
(lambda (&rest _) (browse-url "https://langue.phundrak.com")))
(,(all-the-icons-faicon "firefox" :height 1.1 :v-adjust 0.0)
"Config Website"
""
(lambda (&rest _) (browse-url "https://config.phundrak.com"))))
((,(all-the-icons-octicon "git-branch" :height 1.1 :v-adjust 0.0)
"Dotfiles sources"
""
(lambda (&rest _) (browse-url "https://labs.phundrak.com/phundrak/dotfiles")))
("!" "Issues" "Show issues" (lambda (&rest _)
(browse-url "https://labs.phundrak.com/phundrak/dotfiles/issues"))
warning))))
(setq dashboard-items '((recents . 15)
(projects . 10)))
(dashboard-setup-startup-hook)
:init
(add-hook 'after-init-hook 'dashboard-refresh-buffer))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Keybindings ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar phundrak-org-directories '("~/org"
"~/Documents/university/S8"
"~/Documents/conlanging")
"Directories in which to look for org files with the function
`phundrak-find-org-files'.")
(defun split-window-right-and-focus ()
(interactive)
(split-window-right)
(windmove-right)
(when (and (boundp 'golden-ratio-mode)
(symbol-value golden-ratio-mode))
(golden-ratio)))
(defun split-window-below-and-focus ()
(interactive)
(split-window-below)
(windmove-down)
(when (and (boundp 'golden-ratio-mode)
(symbol-value golden-ratio-mode))
(golden-ratio)))
(defun ibuffer-list-buffers-and-focus ()
(interactive)
(ibuffer-list-buffers)
(windmove-down)
(when (and (boundp 'golden-ratio-mode)
(symbol-value golden-ratio-mode))
(golden-ratio)))
(define-key evil-motion-state-map (kbd ",") nil)
(leader/set-keys
"b" "buffers"
"bb" #'counsel-ibuffer
"bi" #'ibuffer-list-buffers-and-focus
"bd" #'kill-this-buffer
"bD" #'kill-buffer
"f" "files"
"fi" (lambda ()
(interactive)
(find-file (expand-file-name "init.el" user-emacs-directory)))
"ff" #'find-file
"fo" #'phundrak-find-org-files
"fs" #'save-buffer
"h" "help"
"hdf" #'helpful-callable
"hdv" #'helpful-variable
"t" "toggles"
"tt" #'counsel-load-theme
"T" "text"
"Ts" #'hydra-text-scale/body
"w" "windows"
"w-" #'split-window-below-and-focus
"w/" #'split-window-right-and-focus
"wo" #'other-window
"wd" #'delete-window
"wc" #'evil-window-left
"wt" #'evil-window-down
"ws" #'evil-window-up
"wr" #'evil-window-right
"q" "quit"
"qq" #'kill-emacs
)
(leader/set-keys-for-major-mode 'emacs-lisp-mode
"e" '("eval" . "evaluate expression")
"ee" 'eval-last-sexp
"ed" 'eval-defun
"er" 'eval-region)
;; Flycheck wont shut up if I dont add this
;; (provide 'init)
;;; init.el ends here

6
.gitmodules vendored
View File

@ -7,3 +7,9 @@
[submodule ".mozilla/firefox/lruehqec.default/chrome"]
path = fromGIT/blurredfox-nord
url = git@labs.phundrak.com:phundrak/blurredfox-nord.git
[submodule ".emacs.d"]
path = .emacs.d
url = git@github.com:plexus/chemacs2.git
[submodule ".emacs.doom"]
path = .emacs.doom
url = git@github.com:hlissner/doom-emacs.git

View File

@ -1,8 +1,10 @@
;; -*- mode: emacs-lisp; lexical-binding: t -*-
(defvar phundrak--dotspacemacs-src-dir "~/.config/emacs/private/"
"Directory for my exported Elisp configuration files")
;;; Code:
(defvar phundrak--dotspacemacs-src-dir "~/.emacs.spacemacs/private/"
"Directory for my exported Elisp configuration files.")
(defvar phundrak--dotspacemacs-src "~/org/config/emacs.org"
"My litterate config file for Emacs")
"My litterate config file for Emacs.")
(defvar phundrak--dotspacemacs-si (concat phundrak--dotspacemacs-src-dir "spacemacs-init"))
(defvar phundrak--dotspacemacs-sl (concat phundrak--dotspacemacs-src-dir "spacemacs-layers"))
(defvar phundrak--dotspacemacs-uc (concat phundrak--dotspacemacs-src-dir "user-config"))

View File

@ -20,8 +20,8 @@ older than the Org file, then Emacs tangles them again, and then loads them.
* Spacemacs layers and packages
:PROPERTIES:
:header-args:emacs-lisp: :mkdirp yes :tangle ~/.config/emacs/private/spacemacs-layers.el :exports code :results silent :lexical t
:CUSTOM_ID: Spacemacs_layers_and_packages-6d318b87
:header-args:emacs-lisp: :mkdirp yes :tangle ~/.emacs.spacemacs/private/spacemacs-layers.el :exports code :results silent :lexical t
:END:
#+BEGIN_SRC emacs-lisp :exports none
;; -*- lexical-binding: t -*-
@ -622,7 +622,7 @@ tools.
* Init
:PROPERTIES:
:header-args:emacs-lisp: :mkdirp yes :tangle ~/.config/emacs/private/spacemacs-init.el :exports code :results silent :lexical t
:header-args:emacs-lisp: :mkdirp yes :tangle ~/.emacs.spacemacs/private/spacemacs-init.el :exports code :results silent :lexical t
:CUSTOM_ID: Init-99a4b561
:END:
#+BEGIN_SRC emacs-lisp :exports none
@ -653,7 +653,7 @@ about how I manage writing a litterate config for Spacemacs and ensure Emacs
starts with an up-to-date configuration from said litterate config. For that, I
actually declared a couple of variables:
#+BEGIN_SRC emacs-lisp
(defvar phundrak--dotspacemacs-src-dir "~/.config/emacs/private/"
(defvar phundrak--dotspacemacs-src-dir "~/.emacs.spacemacs/private/"
"Directory for my exported Elisp configuration files")
(defvar phundrak--dotspacemacs-src "~/org/config/emacs.org"
"My litterate config file for Emacs")
@ -738,7 +738,7 @@ sub-directory. To load it when starting Emacs, the parameter ~--dump-file~
should be added when invoking Emacs 27.1 executable from the command line, for
instance:
#+BEGIN_SRC sh :tangle no :exports code
./emacs --dump-file=~/.config/emacs/.cache/dumps/spacemacs.pdmp
./emacs --dump-file=~/.emacs.spacemacs/.cache/dumps/spacemacs.pdmp
#+END_SRC
The default value of this variable is ~"spacemacs.pdmp"~.
@ -1373,7 +1373,7 @@ for lsp servers in emacs 27.
:END:
** User Init
:PROPERTIES:
:header-args:emacs-lisp: :mkdirp yes :tangle ~/.config/emacs/private/user-init.el :exports code :results silent :lexical t
:header-args:emacs-lisp: :mkdirp yes :tangle ~/.emacs.spacemacs/private/user-init.el :exports code :results silent :lexical t
:CUSTOM_ID: User-Initialization-User-Init-a86829cf
:END:
#+BEGIN_SRC emacs-lisp :exports none
@ -1384,7 +1384,7 @@ While Emacs and especially Spacemacs loads, I want it to initialize some
elements and load some packages. First of all, I want it to load my private
Emacs config file:
#+BEGIN_SRC emacs-lisp
(load "~/.config/emacs/private/private_emacs")
(load "~/.emacs.spacemacs/private/private_emacs")
#+END_SRC
I would also like to enable the setup of flycheck for Rust when Flycheck is
@ -1411,7 +1411,7 @@ hosts if I dont have this code snippet.
** User Load
:PROPERTIES:
:header-args:emacs-lisp: :mkdirp yes :tangle ~/.config/emacs/private/user-load.el :exports code :results silent :lexical t
:header-args:emacs-lisp: :mkdirp yes :tangle ~/.emacs.spacemacs/private/user-load.el :exports code :results silent :lexical t
:CUSTOM_ID: User-Initialization-User-Load-488cf687
:END:
Then, I want a couple of requires:
@ -1426,7 +1426,7 @@ Then, I want a couple of requires:
* User Configuration
:PROPERTIES:
:header-args:emacs-lisp: :mkdirp yes :tangle ~/.config/emacs/private/user-config.el :exports code :results silent :lexical t
:header-args:emacs-lisp: :mkdirp yes :tangle ~/.emacs.spacemacs/private/user-config.el :exports code :results silent :lexical t
:CUSTOM_ID: User_Configuration-4a937fe5
:END:
#+BEGIN_SRC emacs-lisp :exports none
@ -2598,7 +2598,7 @@ such as with this document.
)
#+END_SRC
#+BEGIN_SRC emacs-lisp :tangle ~/.config/emacs/private/user-config.el :exports none :noweb yes
#+BEGIN_SRC emacs-lisp :tangle ~/.emacs.spacemacs/private/user-config.el :exports none :noweb yes
(with-eval-after-load 'org
;; agenda
<<org-agenda-files>>
@ -4103,13 +4103,13 @@ user. Unfortunately, a lot of these files are just noise I dont care about, b
fortunately we can ignore files with the variable ~recentf-exclude~. So, I will
ignore these paths:
#+name: recentf-ignored-paths
| =~/.authinfo.gpg= |
| =~/.mail/= |
| =~/.emacs.d/= |
| =~/.config/emacs/= |
| =~/.elfeed/index= |
| =~/Documents/mu4e= |
| =/tmp/= |
| =~/.authinfo.gpg= |
| =~/.mail/= |
| =~/.emacs.d/= |
| =~/.emacs.spacemacs/= |
| =~/.elfeed/index= |
| =~/Documents/mu4e= |
| =/tmp/= |
#+name: recentf-ignored-paths-gen
#+header: :var paths=recentf-ignored-paths
@ -4947,10 +4947,10 @@ directories that are version controlled that I do not want to see in my list of
projects, namely all the cached AUR packages from my AUR helper, ~paru~. They
are all stored in the same parent directory, so lets ignore that. I will also
make Emacs ignore all ~node_modules~ directories it could encounter. And for
some reason, =~/.config/emacs= is always in my projects list (I now use
some reason, =~/.emacs.spacemacs= is always in my projects list (I now use
XDG-compliant directories), so lets also ignore that.
#+BEGIN_SRC emacs-lisp
(setq projectile-ignored-projects '("~/.cache/paru" "~/.config/emacs" "/tmp"))
(setq projectile-ignored-projects '("~/.cache/paru" "~/.emacs.spacemacs" "/tmp"))
(add-to-list 'projectile-globally-ignored-directories "node_modules")
#+END_SRC
@ -5029,9 +5029,9 @@ break.
:END:
Yasnippets snippets tool is extremely powerful and allows me to write very
quickly code. For now, we have snippets for two modes. The files youll see
below are exported to ~$HOME/.config/emacs/private/snippets/~ and to their
below are exported to ~$HOME/.emacs.spacemacs/private/snippets/~ and to their
respective mode directory. For instance, my ~caption~ snippet for org-mode will
be exported to ~$HOME/.config/emacs/private/snippets/org-mode/caption~.
be exported to ~$HOME/.emacs.spacemacs/private/snippets/org-mode/caption~.
Be aware that on top of these custom snippets, I also use the package
[[file:awesome.org::#Autostart-f2cf42fe][yasnippet-snippets]] which provide plenty of already made snippets.
@ -5042,7 +5042,7 @@ Be aware that on top of these custom snippets, I also use the package
:END:
I have so far two snippets, the first one is actually just a convenience to make
it easier to type a ~println!~ macro than the default snippet.
#+BEGIN_SRC snippet :tangle ~/.config/emacs/private/snippets/rust-mode/println
#+BEGIN_SRC snippet :tangle ~/.emacs.spacemacs/private/snippets/rust-mode/println
# -*- mode: snippet -*-
# name: println
# key: pln
@ -5054,7 +5054,7 @@ The second one is more interesting: it is used to create a ~new~ method for a
struct, and it will try to create a function that will assign each argument
passed to the method to members of the struct. It relies on the custom function
[[#Custom-functions-yas-rust-new-assignments-4ad16bde][I wrote here]].
#+BEGIN_SRC snippet :tangle ~/.config/emacs/private/snippets/rust-mode/new
#+BEGIN_SRC snippet :tangle ~/.emacs.spacemacs/private/snippets/rust-mode/new
# -*- mode: snippet -*-
# name: new
# key: _new
@ -5074,7 +5074,7 @@ passed to the method to members of the struct. It relies on the custom function
The first two snippets are used to add HTML or LaTeX attributes to elements in
org-mode. The third also has a similar usage, inserting a ~#+CAPTION~ header
before an element, as well as the fourth which inserts a ~#+NAME~ header.
#+BEGIN_SRC snippet :tangle ~/.config/emacs/private/snippets/org-mode/attr_html
#+BEGIN_SRC snippet :tangle ~/.emacs.spacemacs/private/snippets/org-mode/attr_html
# -*- mode: snippet -*-
# name: ATTR HTML
# key: <ah
@ -5082,7 +5082,7 @@ before an element, as well as the fourth which inserts a ~#+NAME~ header.
,#+ATTR_HTML: $0
#+END_SRC
#+BEGIN_SRC snippet :tangle ~/.config/emacs/private/snippets/org-mode/attr_latex
#+BEGIN_SRC snippet :tangle ~/.emacs.spacemacs/private/snippets/org-mode/attr_latex
# -*- mode: snippet -*-
# name: ATTR LATEX
# key: <al
@ -5090,7 +5090,7 @@ before an element, as well as the fourth which inserts a ~#+NAME~ header.
,#+ATTR_LATEX: $0
#+END_SRC
#+BEGIN_SRC snippet :tangle ~/.config/emacs/private/snippets/org-mode/caption
#+BEGIN_SRC snippet :tangle ~/.emacs.spacemacs/private/snippets/org-mode/caption
# -*- mode: snippet -*-
# name: caption
# key: <ca
@ -5098,7 +5098,7 @@ before an element, as well as the fourth which inserts a ~#+NAME~ header.
,#+CAPTION: $0
#+END_SRC
#+BEGIN_SRC snippet :tangle ~/.config/emacs/private/snippets/org-mode/name
#+BEGIN_SRC snippet :tangle ~/.emacs.spacemacs/private/snippets/org-mode/name
# -*- mode: snippet -*-
# name: name
# key: <na
@ -5112,7 +5112,7 @@ default to the buffers name capitalized minus the dashes or underscores
replaced with spaces, it will insert a default author and email based on the
users parameters, and the date at the moment of the creation of these headers.
The user can also add some tags if they wish to.
#+BEGIN_SRC snippet :tangle ~/.config/emacs/private/snippets/org-mode/header
#+BEGIN_SRC snippet :tangle ~/.emacs.spacemacs/private/snippets/org-mode/header
# -*- mode: snippet -*-
# name: header
# key: header
@ -5135,7 +5135,7 @@ Now, Lets write some snippets for org blocks. The first one is for a comment
block, then two snippets for an unnamed and a named Elisp source block, and two
others for an unnamed and a named Python source block. There are also two block
for generic unnamed source blocks and generic named source blocks.
#+BEGIN_SRC snippet :tangle ~/.config/emacs/private/snippets/org-mode/comment_block
#+BEGIN_SRC snippet :tangle ~/.emacs.spacemacs/private/snippets/org-mode/comment_block
# -*- mode: snippet -*-
# name: comment block
# key: <co
@ -5145,7 +5145,7 @@ for generic unnamed source blocks and generic named source blocks.
,#+END_COMMENT
#+END_SRC
#+BEGIN_SRC snippet :tangle ~/.config/emacs/private/snippets/org-mode/emacs-lisp
#+BEGIN_SRC snippet :tangle ~/.emacs.spacemacs/private/snippets/org-mode/emacs-lisp
# -*- mode: snippet -*-
# name: emacs-lisp block
# key: <el
@ -5155,7 +5155,7 @@ for generic unnamed source blocks and generic named source blocks.
,#+END_SRC
#+END_SRC
#+BEGIN_SRC snippet :tangle ~/.config/emacs/private/snippets/org-mode/emacs-lisp-named
#+BEGIN_SRC snippet :tangle ~/.emacs.spacemacs/private/snippets/org-mode/emacs-lisp-named
# -*- mode: snippet -*-
# name: named emacs-lisp block
# key: <eln
@ -5166,7 +5166,7 @@ for generic unnamed source blocks and generic named source blocks.
,#+END_SRC
#+END_SRC
#+BEGIN_SRC snippet :tangle ~/.config/emacs/private/snippets/org-mode/python
#+BEGIN_SRC snippet :tangle ~/.emacs.spacemacs/private/snippets/org-mode/python
# -*- mode: snippet -*-
# name: python block
# key: <py
@ -5176,7 +5176,7 @@ for generic unnamed source blocks and generic named source blocks.
,#+END_SRC
#+END_SRC
#+BEGIN_SRC snippet :tangle ~/.config/emacs/private/snippets/org-mode/python-named
#+BEGIN_SRC snippet :tangle ~/.emacs.spacemacs/private/snippets/org-mode/python-named
# -*- mode: snippet -*-
# name: named python block
# key: <pyn
@ -5187,7 +5187,7 @@ for generic unnamed source blocks and generic named source blocks.
,#+END_SRC
#+END_SRC
#+BEGIN_SRC snippet :tangle ~/.config/emacs/private/snippets/org-mode/src
#+BEGIN_SRC snippet :tangle ~/.emacs.spacemacs/private/snippets/org-mode/src
# -*- mode: snippet -*-
# name: source block
# key: <s
@ -5197,7 +5197,7 @@ for generic unnamed source blocks and generic named source blocks.
,#+END_SRC
#+END_SRC
#+BEGIN_SRC snippet :tangle ~/.config/emacs/private/snippets/org-mode/src-named
#+BEGIN_SRC snippet :tangle ~/.emacs.spacemacs/private/snippets/org-mode/src-named
# -*- mode: snippet -*-
# name: named source block
# key: <sn
@ -5215,7 +5215,7 @@ for generic unnamed source blocks and generic named source blocks.
Finally, there are a couple of miscellaneous org snippets that insert macros I
often use in my conlanging documents. The first one inserts a phonetics macro,
while the second one inserts a macro used for my Proto-Ñyqy language.
#+BEGIN_SRC snippet :tangle ~/.config/emacs/private/snippets/org-mode/phon
#+BEGIN_SRC snippet :tangle ~/.emacs.spacemacs/private/snippets/org-mode/phon
# -*- mode: snippet -*-
# name: phon
# key: <ph
@ -5223,7 +5223,7 @@ while the second one inserts a macro used for my Proto-Ñyqy language.
\{\{\{phon($1)\}\}\} $0
#+END_SRC
#+BEGIN_SRC snippet :tangle ~/.config/emacs/private/snippets/org-mode/phon
#+BEGIN_SRC snippet :tangle ~/.emacs.spacemacs/private/snippets/org-mode/phon
# -*- mode: snippet -*-
# name: nyqy
# key: <ny