👁 emacs28 configuration

This commit is contained in:
2022-03-16 18:24:18 +09:00
parent 0f416ecb7d
commit 933f9759df
37 changed files with 2430 additions and 5 deletions

4
.config/emacs/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
eln-cache
.cask
elpa
auto-save-list

View File

@ -0,0 +1,43 @@
# Unreleased
- Add support for early-init.el
- Change installation from `~/.emacs` to `~/.emacs.d`
- Allow .emacs-profiles and .emacs-profile to be stored in $XDG\_CONFIG\_HOME/chemacs
- Allow loading a literal profile from the cli (e.g. `emacs --with-profile '((user-emacs-directory . "/path/to/config"))'` works)
# 1.0 (2020-10-01 / 4dad0684)
- Only load `custom-file` when it is different from `init-file` (prevent double loading of `init-file`)
- Fixes to the install script for OS X
- Documentation fixes
- Introduce `chemacs-version` variable
- start keeping a CHANGELOG
# 0.6 (2020-02-23 / 71e30878)
- NixOS support in installation script
- Add Powershell installation script
# 0.5 (2020-01-14 / 4c279476)
- First class support for straight.el
- Documentation fixes
# 0.4 (2018-10-01 / 68382d50)
- Support GNU style `--with-profile=profilename` (so with equal sign)
# 0.3 (2018-09-30 / 1140501d)
- Allow selection of default profile using `~/.emacs-profile`
# 0.2 (2018-06-06 / 1f5601a9)
- Add installer script
- Improve documentation
- Improve support for older Emacsen
- Document how to use with Doom
# 0.1 (2018-05-18 / 8500636a)
- Initial release

276
.config/emacs/README.org Normal file
View File

@ -0,0 +1,276 @@
#+BEGIN_SRC
___ ___ ___ ___ ___ ___ ___
/ /\ /__/\ / /\ /__/\ / /\ / /\ / /\
/ /:/ \ \:\ / /:/_ | |::\ / /::\ / /:/ / /:/_
/ /:/ \__\:\ / /:/ /\ | |:|:\ / /:/\:\ / /:/ / /:/ /\
/ /:/ ___ ___ / /::\ / /:/ /:/_ __|__|:|\:\ / /:/~/::\ / /:/ ___ / /:/ /::\
/__/:/ / /\ /__/\ /:/\:\ /__/:/ /:/ /\ /__/::::| \:\ /__/:/ /:/\:\ /__/:/ / /\ /__/:/ /:/\:\
\ \:\ / /:/ \ \:\/:/__\/ \ \:\/:/ /:/ \ \:\~~\__\/ \ \:\/:/__\/ \ \:\ / /:/ \ \:\/:/~/:/
\ \:\ /:/ \ \::/ \ \::/ /:/ \ \:\ \ \::/ \ \:\ /:/ \ \2.0 /:/
\ \:\/:/ \ \:\ \ \:\/:/ \ \:\ \ \:\ \ \:\/:/ \__\/ /:/
\ \::/ \ \:\ \ \::/ \ \:\ \ \:\ \ \::/ /__/:/
\__\/ \__\/ \__\/ \__\/ \__\/ \__\/ \__\/
222222222222222
2:::::::::::::::22
2::::::222222:::::2
2222222 2:::::2
2:::::2
2:::::2
2222::::2
22222::::::22
22::::::::222
2:::::22222
2:::::2
2:::::2
2:::::2 222222
2::::::2222222:::::2
2::::::::::::::::::2
22222222222222222222
#+END_SRC
* Chemacs
Chemacs 2 is an Emacs profile switcher, it makes it easy to run multiple Emacs
configurations side by side.
Think of it as a bootloader for Emacs.
** Differences from Chemacs 1
Emacs intialization used to have a single entry point, either =~/.emacs= or
=~/.emacs.d/init.el=. More recent Emacsen have introduced a second startup
script, =~/.emacs.d/early-init.el=, which runs earlier in the boot process, and
can be used for things that should happen very early on, like tweaking the GC,
or disabling UI elements.
Chemacs 2 supports =early-init.el=, Chemacs 1 does not. This does also imply
that Chemacs 2 needs to be installed as =~/.emacs.d= (a directory), rather than
simply linking it to =~/.emacs= (a single file).
** Rationale
Emacs configuration is either kept in a =~/.emacs= file or, more commonly, in a
=~/.emacs.d= directory. These paths are hard-coded. If you want to try out
someone else's configuration, or run different distributions like Prelude or
Spacemacs, then you either need to swap out =~/.emacs.d=, or run Emacs with a
different =$HOME= directory set.
This last approach is quite common, but has some real drawbacks, since now
packages will no longer know where your actual home directory is.
All of these makes trying out different Emacs configurations and distributions
needlessly cumbersome.
Various approaches to solving this have been floated over the years. There's an
Emacs patch around that adds an extra command line option, and various examples
of how to add a command line option in userspace from Emacs Lisp.
Chemacs tries to implement this idea in a user-friendly way, taking care of the
various edge cases and use cases that come up.
** Installation
Clone the Chemacs 2 repository as =$HOME/.emacs.d=. Note that if you already
have an Emacs setup in =~/.emacs.d= you need to move it out of the way first. If
you have an =~/.emacs= startup script then move that out of the way as well.
#+BEGIN_SRC shell
[ -f ~/.emacs ] && mv ~/.emacs ~/.emacs.bak
[ -d ~/.emacs.d ] && mv ~/.emacs.d ~/.emacs.default
git clone https://github.com/plexus/chemacs2.git ~/.emacs.d
#+END_SRC
Note that this is different from Chemacs 1. Before Chemacs installed itself as
=~/.emacs= and you could have your own default setup in =~/.emacs.d=. This
approach no longer works because of =~/.emacs.d/early-init.el=, so Chemacs 2
needs to be installed as =~/.emacs.d=.
Next you will need to create a =~/.emacs-profiles.el= file, for details see
below.
#+begin_src emacs-lisp
(("default" . ((user-emacs-directory . "~/.emacs.default"))))
#+end_src
** Usage
Chemacs adds an extra command line option to Emacs, =--with-profile=. Profiles
are configured in =~/.emacs-profiles.el=.
If no profile is given at the command line then the environment variable
CHEMACS_PROFILE is used. If this environment variables isn't set then the
=default= profile is used.
#+BEGIN_SRC shell
$ emacs --with-profile my-profile
#+END_SRC
There is an option for using profile that is not preconfigured in =~/.emacs-profiles.el=. To accomplish that you can directly provide the profile via the command line, like so
#+BEGIN_SRC shell
$ emacs --with-profile '((user-emacs-directory . "/path/to/config"))'
#+END_SRC
This method supports all the profile options given below.
** .emacs-profiles.el
This file contains an association list, with the keys/cars being the profile
names, and the values/cdrs their configuration.
The main thing to configure is the =user-emacs-directory=
#+BEGIN_SRC emacs-lisp
(("default" . ((user-emacs-directory . "~/.emacs.default")))
("spacemacs" . ((user-emacs-directory . "~/spacemacs"))))
#+END_SRC
Chemacs will set this to be the =user-emacs-directory= in use, and load
=init.el= from that directory.
Other things you can configure
- =custom-file= : The file where Customize stores its customizations. If this
isn't configured, and the =custom-file= variable is still unset after loading
the profile's =init.el=, then this will get set to the profile's =init.el=
- =server-name= : Sets the =server-name= variable, so you can distinguish multiple
instances with =emacsclient -s <server-name>=.
- =env= An association list of environment variables. These will get set before
loading the profile, so they can influence the initialization, and they are
visible to any subprocesses spawned from Emacs.
- =straight-p= Enable the [[https://github.com/raxod502/straight.el][Straight]]
functional package manager.
Store =.emacs-profiles.el= together with your dotfiles. If you're not yet keeping
a version controlled directory of dotfiles, then check out
[[https://github.com/plexus/dotfiles/blob/master/connect-the-dots][connect-the-dots]]
for a helpful script to do that.
** Changing the default profile (e.g. for GUI editors)
Where it is not possible to use the =--with-profile= flag or the CHEMACS_PROFILE
environment variable, the default profile can be set using a =~/.emacs-profile=
file.
If your =~/.emacs-profiles.el= file contains the following:
#+BEGIN_SRC emacs-lisp
(("default" . ((user-emacs-directory . "~/.emacs.default")))
("spacemacs" . ((user-emacs-directory . "~/spacemacs")))
("prelude" . ((user-emacs-directory . "~/prelude"))))
#+END_SRC
you can create a file called =~/.emacs-profile=, containing the name of the
profile you'd like to be used when none is given on the command line:
#+BEGIN_SRC shell
$ echo 'spacemacs' > ~/.emacs-profile
#+END_SRC
This will set the default profile to be the "spacemacs" profile, instead of
"default". You can change the default by simply changing the contents of this
file:
#+BEGIN_SRC shell
$ echo 'prelude' > ~/.emacs-profile
#+END_SRC
If this file doesn't exist, then "default" will be used, as before.
** Spacemacs
Spacemacs is typically installed by cloning the Spacemacs repo to =~/.emacs.d=,
and doing extra customization from =~/.spacemacs= or =~/.spacemacs.d/init.el=.
This makes it tedious to switch between version of Spacemacs, or between
different Spacemacs configurations.
With Chemacs you can point your =user-emacs-directory= to wherever you have
Spacemacs installed, and use the =SPACEMACSDIR= environment variable to point at
a directory with customizations that are applied on top of the base install.
#+BEGIN_SRC emacs-lisp
(("spacemacs" . ((user-emacs-directory . "~/spacemacs")
(env . (("SPACEMACSDIR" . "~/.spacemacs.d")))))
("spacemacs-develop" . ((user-emacs-directory . "~/spacemacs/develop")
(env . (("SPACEMACSDIR" . "~/.spacemacs.d")))))
("new-config" . ((user-emacs-directory . "~/spacemacs/develop")
(env . (("SPACEMACSDIR" . "~/my-spacemacs-config"))))))
#+END_SRC
** DOOM emacs
You can add an entry similar to the following to your =.emacs-profiles.el=
In the following snippet =~/doom-emacs= is where you have cloned doom emacs.
(Depending on when you read this) =DOOMDIR= support is only in =develop= branch of doom emacs. Check commit history of =master= branch of doom emacs
#+BEGIN_SRC emacs-lisp
("doom" . ((user-emacs-directory . "~/doom-emacs")
(env . (("DOOMDIR" . "~/doom-config")))))
#+END_SRC
Please refer to [[https://github.com/plexus/chemacs/issues/5][this]] discussion for details.
** FreeDesktop Directories
Both =~/.emacs-profiles.el= and =~/.emacs-profile= can also be stored under =$XDG_CONFIG_HOME/chemacs= (typically =~/.config/chemacs=) as =$XGD_CONFIG_HOME/chemacs/profiles.el= and =$XDG_CONFIG_HOME/chemacs/profile= respectively.
Further, as indicated by the [[http://git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS?h=emacs-27][Emacs 27.1 changelog]], Emacs is now compatible with XDG Standards, looking for its configuration files in =${XDG_CONFIG_HOME}/emacs= directory too (provided the traditional =~/.emacs.d= and =~/.emacs= does not exist).
Therefore, it is perfectly viable to install Chemacs 2 in =${XDG_CONFIG_HOME}/emacs= (usually =~/.config/emacs=) directory - with the aforementioned caveat: _the directory =~/.emacs.d"= and the file ="~/.emacs"= does not exist_.
** Example: emacs as daemon
- Profiles
You can add an entry similar to the following to your =.emacs-profiles.el=
#+BEGIN_SRC emacs-lisp
;; your custom or vanilla emacs profile
(("default" . ((user-emacs-directory . "~/.gnu-emacs")
(server-name . "gnu")
))
;; emacs distribution: DOOM-emacs
("doom" . ((user-emacs-directory . "~/.doom-emacs")
(server-name . "doom")
(env . (("DOOMDIR" . "~/.doom.d")))
))
)
#+END_SRC
- daemon
Set emacs daemon to always run in background
#+begin_src bash
# vanilla
emacs --daemon &
# Doom emacs
emacs --with-profile doom --daemon &
#+end_src
- emacsclient
create a new frame, connect to the socket and use vanilla emacs as fallback
#+begin_src bash
emacsclient -c -s gnu -a emacs
emacsclient -c -s doom -a emacs
#+end_src
** Troubleshooting
*** Emacs cannot find packages installed by straight
Some users have [[https://github.com/plexus/chemacs2/issues/31][reported issues]] where packages installed by `straight.el` can no longer be found after switching to using `chemacs`.
First, make sure you haven't hardcoded filepaths to "emacs.d" in your configuration. You should reference files inside a profile-specific emacs folder like this:
#+begin_src elisp
(setq some-var (expand-file-name "path/to/file" user-emacs-directory))
#+END_SRC
Second, if the issue persists you should delete the `build` folder in your `straight` directory and rebuild your dependencies.
If the issue persists please [[https://github.com/plexus/chemacs2/issues/31][comment on the issue]], because we are still trying to figure out the exact source of this problem, but this has solved the problem for some users.
** LICENSE
Copyright © Arne Brasseur and contributors, 2018-2022
Distributed under the terms of the GPL v3.

173
.config/emacs/chemacs.el Normal file
View File

@ -0,0 +1,173 @@
;;; chemacs.el --- -*- lexical-binding: t; -*-
;;; Commentary:
;; ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;;
;; ___ ___ ___ ___ ___ ___ ___
;; / /\ /__/\ / /\ /__/\ / /\ / /\ / /\
;; / /:/ \ \:\ / /:/_ | |::\ / /::\ / /:/ / /:/_
;; / /:/ \__\:\ / /:/ /\ | |:|:\ / /:/\:\ / /:/ / /:/ /\
;; / /:/ ___ ___ / /::\ / /:/ /:/_ __|__|:|\:\ / /:/~/::\ / /:/ ___ / /:/ /::\
;; /__/:/ / /\ /__/\ /:/\:\ /__/:/ /:/ /\ /__/::::| \:\ /__/:/ /:/\:\ /__/:/ / /\ /__/:/ /:/\:\
;; \ \:\ / /:/ \ \:\/:/__\/ \ \:\/:/ /:/ \ \:\~~\__\/ \ \:\/:/__\/ \ \:\ / /:/ \ \:\/:/~/:/
;; \ \:\ /:/ \ \::/ \ \::/ /:/ \ \:\ \ \::/ \ \:\ /:/ \ \2.0 /:/
;; \ \:\/:/ \ \:\ \ \:\/:/ \ \:\ \ \:\ \ \:\/:/ \__\/ /:/
;; \ \::/ \ \:\ \ \::/ \ \:\ \ \:\ \ \::/ /__/:/
;; \__\/ \__\/ \__\/ \__\/ \__\/ \__\/ \__\/
;;
;; ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;;
;; Chemacs - Emacs Profile Switcher
;;
;; See README.md for instructions.
;; NOTE Don't require any libraries in this file. When emacs loads a library that
;; is byte compiled, it may start native-compiling it, so if we require anything
;; here, native compilation can start before the user has had a chance to configure
;; it in their init files.
;;; Code:
(defvar chemacs-version "2.0")
(defvar config-home (or (getenv "XDG_CONFIG_HOME") "~/.config"))
(defvar chemacs-profiles-paths (list "~/.emacs-profiles.el" (format "%s/%s" config-home "chemacs/profiles.el" )))
(defvar chemacs-default-profile-paths (list "~/.emacs-profile" (format "%s/%s" config-home "chemacs/profile")))
(defvar chemacs-profile-env-var "CHEMACS_PROFILE")
;; Copy `seq' library's `seq-filter' to avoid requiring it, see note above.
(defun chemacs--seq-filter (pred sequence)
(let ((exclude (make-symbol "exclude")))
(delq exclude (mapcar (lambda (elt)
(if (funcall pred elt)
elt
exclude))
sequence))))
(defvar chemacs-profiles-path (or (car (chemacs--seq-filter #'file-exists-p chemacs-profiles-paths))
(car chemacs-profiles-paths)))
(defvar chemacs-default-profile-path (or (car (chemacs--seq-filter #'file-exists-p chemacs-default-profile-paths))
(car chemacs-default-profile-paths)))
(defun chemacs-handle-command-line (args)
(when args
;; Handle either --with-profile profilename or
;; --with-profile=profilename
(let ((s (split-string (car args) "=")))
(cond ((equal (car args) "--with-profile")
;; This is just a no-op so Emacs knows --with-profile
;; is a valid option. If we wait for
;; command-switch-alist to be processed then
;; after-init-hook has already run.
(add-to-list 'command-switch-alist
'("--with-profile" .
(lambda (_) (pop command-line-args-left))))
(cadr args))
;; Similar handling for `--with-profile=profilename'
((equal (car s) "--with-profile")
(add-to-list 'command-switch-alist `(,(car args) . (lambda (_))))
(mapconcat 'identity (cdr s) "="))
(t (chemacs-handle-command-line (cdr args)))))))
(defvar chemacs--with-profile-value
(let* ((value (chemacs-handle-command-line command-line-args))
(read-value (read value)))
(when value
(if (listp read-value)
read-value
value))))
(defvar chemacs-literal-profile-provided
(and chemacs--with-profile-value
(listp chemacs--with-profile-value)))
(unless (or (file-exists-p chemacs-profiles-path)
(and chemacs--with-profile-value
(listp chemacs--with-profile-value)))
(error "[chemacs] %s does not exist." chemacs-profiles-path))
(defvar chemacs-default-profile-name
(if (file-exists-p chemacs-default-profile-path)
(with-temp-buffer
(insert-file-contents chemacs-default-profile-path)
(goto-char (point-min))
;; (buffer-string))
(symbol-name (read (current-buffer)) ))
"default"))
(defvar chemacs-profile-name
(let ((env-profile-value (getenv chemacs-profile-env-var)))
(cond ((and chemacs--with-profile-value
(stringp chemacs--with-profile-value))
chemacs--with-profile-value)
(env-profile-value env-profile-value)
(t chemacs-default-profile-name))))
(defvar chemacs-profile
(if (and chemacs--with-profile-value
(listp chemacs--with-profile-value))
chemacs--with-profile-value
(let ((profiles
(with-temp-buffer
(insert-file-contents chemacs-profiles-path)
(goto-char (point-min))
(read (current-buffer)))))
(cdr (assoc chemacs-profile-name profiles)))))
(unless chemacs-profile
(error "No profile `%s' in %s" chemacs-profile-name chemacs-profiles-path))
(defun chemacs-profile-get (key &optional default)
(alist-get key chemacs-profile default))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq user-emacs-directory (file-name-as-directory
(chemacs-profile-get 'user-emacs-directory)))
;; Allow multiple profiles to each run their server
;; use `emacsclient -s profile_name' to connect
(let ((name (chemacs-profile-get 'server-name)))
(when name (setq server-name name)))
;; Set environment variables, these are visible to init-file with
;; getenv
(mapcar (lambda (env)
(setenv (car env) (cdr env)))
(chemacs-profile-get 'env))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun chemacs-load-user-early-init ()
(let ((early-init-file (expand-file-name "early-init.el" user-emacs-directory)))
(load early-init-file t t)))
(defun chemacs-load-user-init ()
(when (chemacs-profile-get 'straight-p) (chemacs-load-straight))
(let ((init-file (expand-file-name "init.el" user-emacs-directory)))
(setq package-user-dir (expand-file-name "elpa" user-emacs-directory))
(load init-file t t)
;; Prevent customize from changing ~/.emacs (this file), but if
;; init.el has set a value for custom-file then don't touch it.
(let ((chemacs-custom-file (chemacs-profile-get 'custom-file init-file)))
(when (not custom-file)
(setq custom-file chemacs-custom-file)
(unless (equal custom-file init-file)
(unless (file-exists-p custom-file)
(with-temp-buffer (write-file custom-file)))
(load custom-file))))))
(defun chemacs-load-straight ()
(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)))
(provide 'chemacs)

View File

@ -0,0 +1,7 @@
;;; early-init.el --- -*- lexical-binding: t; -*-
(require 'chemacs
(expand-file-name "chemacs.el"
(file-name-directory
(file-truename load-file-name))))
(chemacs-load-user-early-init)

11
.config/emacs/init.el Normal file
View File

@ -0,0 +1,11 @@
;;; init.el --- -*- lexical-binding: t; -*-
(require 'chemacs
(expand-file-name "chemacs.el"
(file-name-directory
(file-truename load-file-name))))
(chemacs-load-user-init)
;; this must be here to keep the package system happy, normally you do
;; `package-initialize' for real in your own init.el
;; (package-initialize)

7
.emacs-profiles.el Normal file
View File

@ -0,0 +1,7 @@
(("default" . ((user-emacs-directory . "~/.emacs.rational")
(env . (("RATIONAL_EMACS_HOME" . "~/.emacs.rational.d")))))
("vanilla" . ((user-emacs-directory . "~/.emacs.vanilla")))
("doom" . ((user-emacs-directory . "~/.emacs.doom")
(env . (("DOOMDIR" . "~/.emacs.doom.d")))))
("rational" . ((user-emacs-directory . "~/.emacs.rational")
(env . (("RATIONAL_EMACS_HOME" . "~/.emacs.rational.d"))))))

View File

Before

Width:  |  Height:  |  Size: 165 KiB

After

Width:  |  Height:  |  Size: 165 KiB

View File

@ -0,0 +1,4 @@
(undo-tree-save-format-version . 1)
"4a5393278893732c0283cee67786bb2a47c5180c"
[nil current nil nil (25137 37704 59576 695000) 0 nil]
nil

View File

@ -0,0 +1,9 @@
(undo-tree-save-format-version . 1)
"b20f26d4c1a610976323cc8ba3e3402825a52087"
[nil nil nil nil (25137 43379 69396 762000) 0 nil]
([nil nil ((6791 . 6793) (6790 . 6791) (t 25137 43364 922509 987000) 6754) nil (25137 43387 694003 567000) 0 nil])
([nil current ((#("
" 0 1 (fontified t ws-butler-chg chg) 1 2 (fontified t ws-butler-chg chg) 2 3 (fontified t)) . 6791) (6794 . 6794)) nil (25137 43387 694000 103000) 0 nil])
nil

View File

@ -0,0 +1,4 @@
(undo-tree-save-format-version . 1)
"6219c0e3ab970e5c7a9cb17402a3d8be54b7c012"
[nil current nil nil (25137 37704 42936 540000) 0 nil]
nil

232
.emacs.rational.d/config.el Normal file
View File

@ -0,0 +1,232 @@
;;; example-config.el -- Example Rational Emacs user customization file -*- lexical-binding: t; -*-
;;; Commentary:
;;
;; Rational Emacs supports user customization through a `config.el' file
;; similar to this one. You can copy this file as `config.el' to your
;; Rational Emacs configuration directory as an example.
;;
;; In your configuration you can set any Emacs configuration variable, face
;; attributes, themes, etc as you normally would.
;;
;; See the README.org file in this repository for additional information.
;;; Code:
(require 'rational-defaults)
(require 'rational-screencast)
(require 'rational-ui)
(require 'rational-editing)
(require 'rational-evil)
(require 'rational-completion)
(require 'rational-windows)
(require 'rational-use-package)
(setq system-time-locale "C")
(setenv "LANG" "en_US.UTF-8")
(setenv "LC_ALL" "en_US.UTF-8")
;; Set further font and theme customizations
(custom-set-variables
'(rational-ui-default-font
'(:font "Fira Code Retina" :weight light :height 110)))
(add-to-list 'default-frame-alist `(font . "Fira Code Retina"))
(set-face-attribute 'default nil :font "Fira Code Retina" :height 110)
(set-face-attribute 'fixed-pitch nil :font "Fira Code Retina" :height 110)
(set-face-attribute 'variable-pitch nil :font "Fira Code Retina" :height 110 :weight 'regular)
(set-fontset-font t 'hangul (font-spec :family "D2Coding" :height 110))
(setq face-font-rescale-alist
'(("D2Coding" . 1.25)))
(set-frame-parameter (selected-frame) 'fullscreen 'maximized)
(add-to-list 'default-frame-alist '(fullscreen . maximized))
(load-theme 'doom-dracula t)
(column-number-mode)
(global-display-line-numbers-mode t)
(global-hl-line-mode)
;;; example-config.el ends here
(setq user-full-name "JaeYoo-Im"
user-mail-address "cpu3792@gmail.com")
(defun toggle-transparency ()
(interactive)
(let ((alpha (frame-parameter nil 'alpha)))
(set-frame-parameter
nil 'alpha
(if (eql (cond ((numberp alpha) alpha)
((numberp (cdr alpha)) (cdr alpha))
;; Also handle undocumented (<active> <inactive>) form.
((numberp (cadr alpha)) (cadr alpha)))
100)
'(75 . 75) '(100 . 100)))))
(global-set-key (kbd "C-c t") 'toggle-transparency)
(set-frame-parameter (selected-frame) 'alpha '(75 . 75))
;; DASHBOARD
(straight-use-package 'dashboard)
(require 'all-the-icons)
(setq dashboard-set-heading-icons t)
(setq dashboard-set-file-icons t)
(setq dashboard-startup-banner 'logo)
(setq dashboard-center-content t)
(setq dashboard-week-agenda t)
(setq dashboard-agenda-time-string-format "%d/%m/%Y %A %H:%M")
(setq dashboard-items '((recents . 10)
(agenda . 5)
(bookmarks . 5)
(registers . 5)))
(setq dashboard-set-navigator t)
;; Format: "(icon title help action face prefix suffix)"
(setq dashboard-navigator-buttons
`((
(,(all-the-icons-octicon "mark-github" :height 1.1 :v-adjust 0.0)
"Github"
"Browse github"
(lambda (&rest _) (browse-url "https://github.com/JaeUs3792")))
(,(all-the-icons-octicon "book" :height 1.1 :v-adjust 0.0)
"My Blog"
"Browse Blog"
(lambda (&rest _) (browse-url "https://jaeus.net"))))))
(setq dashboard-set-footer nil)
(dashboard-setup-startup-hook)
;; EMOJI
(straight-use-package 'emojify)
(global-emojify-mode)
;; Which Key
(straight-use-package 'which-key)
(setq which-key-idle-delay 0.5)
(which-key-mode)
;; GENERAL KEY MAP
(straight-use-package 'general)
(general-evil-setup t)
(general-create-definer ju/leader-key-def
:keymaps '(normal insert visual emacs)
:prefix "SPC"
:global-prefix "C-SPC")
(ju/leader-key-def
"." 'find-file
;; Buffer
"b" '(:ignore t :which-key "buffer handling")
"b b" '(ibuffer :which-key "IBuffer")
"b k" '(kill-current-buffer :which-key "Kill current buffer")
"b n" '(next-buffer :which-key "Next buffer")
"b p" '(previous-buffer :which-key "Previous buffer")
"b B" '(ibuffer-list-buffers :which-key "IBuffer List Buffers")
"b K" '(kill-buffer :which-key "IBuffer Kill Buffers")
;; Eshell
"e" '(:ignore t :which-key "eshell")
"e h" '(counsel-esh-history :which "Kill history")
"e s" '(eshell :which "run eshell")
;; Workspace
;; Counsel
"f" '(:ignore t :which-key "file op.")
"f r" '(consult-recent-file :which-key "Recent files")
"f R" '(revert-buffer :which-key "Revert Buffer")
"t t" '(toggle-truncate-lines :which-key "Toggle truncate lines")
;; Shortcut
"f d d" '(lambda () (interactive) (find-file (expand-file-name "~/.emacs.rational.d/desktop.el")) :which-key "open exwm config")
"f d e" '(lambda () (interactive) (find-file (expand-file-name "~/.emacs.rational.d/config.el")) :which-key "open emacs config"))
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
(global-unset-key (kbd "C-j"))
(global-unset-key (kbd "C-k"))
(global-unset-key (kbd "S-SPC")) ;; use only S-\
;; tramp default is scp
(setq tramp-default-method "ssh")
(straight-use-package 'flycheck)
(global-flycheck-mode t)
;;(straight-use-package 'vertico-posframe)
;;(setq vertico-posframe-parameters
;; `((left-fringe . 8)
;; (right-fringe . 8) (alpha . 100)))
;;(vertico-posframe-mode 1)
;; TODO
(straight-use-package 'hl-todo)
(setq hl-todo-highlight-punctuation ":"
hl-todo-keyword-faces
`(;; For things that need to be done, just not today.
("TODO" warning bold)
;; For problems that will become bigger problems later if not
;; fixed ASAP.
("FIXME" error bold)
;; For tidbits that are unconventional and not intended uses of the
;; constituent parts, and may break in a future update.
("HACK" font-lock-constant-face bold)
;; For things that were done hastily and/or hasn't been thoroughly
;; tested. It may not even be necessary!
("REVIEW" font-lock-keyword-face bold)
;; For especially important gotchas with a given implementation,
;; directed at another user other than the author.
("NOTE" success bold)
;; For things that just gotta go and will soon be gone.
("DEPRECATED" font-lock-doc-face bold)
;; For a known bug that needs a workaround
("BUG" error bold)
;; For warning about a problematic or misguiding code
("XXX" font-lock-constant-face bold)))
(global-hl-todo-mode)
;; ORG Mode
(setq org-todo-keywords
'((sequence "TODO(t)" "HOLD(h)" "|" "KILL(k)" "DONE(d)")))
(setq org-ellipsis "")
(setq org-hide-emphasis-markers t)
(setq org-src-fontify-natively t)
(setq org-fontify-quote-and-verse-blocks t)
(setq org-agenda-start-with-log-mode t)
(setq org-log-done 'time)
(setq org-log-into-drawer t)
(add-hook 'org-mode-hook (lambda () (org-indent-mode)))
;;(straight-use-package 'org-superstar)
;;(add-hook 'org-mode-hook (lambda () (org-superstar-mode 1)))
(straight-use-package 'org-attach-screenshot)
(straight-use-package 'org-download)
(defun efs/org-mode-visual-fill ()
(setq visual-fill-column-width 100
visual-fill-column-center-text t)
(visual-fill-column-mode 1))
(straight-use-package 'visual-fill-column)
(add-hook 'org-mode-hook (lambda () org-mode . efs/org-mode-visual-fill))
;;(with-eval-after-load 'org
;; (org-babel-do-load-languages
;; 'org-babel-load-languages
;; '((emacs-lisp . t)
;; (python . t)
;; (latex . t)))
;;
;; (push '("conf-unix" . conf-unix) org-src-lang-modes))
;;
;;(with-eval-after-load 'org
;; ;; This is needed as of Org 9.2
;; (require 'org-tempo)
;;
;; (add-to-list 'org-structure-template-alist '("sh" . "src shell"))
;; (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
;; (add-to-list 'org-structure-template-alist '("hs" . "src haskell"))
;; (add-to-list 'org-structure-template-alist '("cc" . "src c"))
;; (add-to-list 'org-structure-template-alist '("cp" . "src c++"))
;; (add-to-list 'org-structure-template-alist '("rs" . "src rust"))
;; (add-to-list 'org-structure-template-alist '("py" . "src python"))
;; (add-to-list 'org-structure-template-alist '("oc" . "src octave"))
;; (add-to-list 'org-structure-template-alist '("vl" . "src verilog"))
;; (add-to-list 'org-structure-template-alist '("vh" . "src vhdl"))

View File

@ -0,0 +1,201 @@
;;; example-config.el -- Example Rational Emacs user customization file -*- lexical-binding: t; -*-
;;; Commentary:
;;
;; Rational Emacs supports user customization through a `config.el' file
;; similar to this one. You can copy this file as `config.el' to your
;; Rational Emacs configuration directory as an example.
;;
;; In your configuration you can set any Emacs configuration variable, face
;; attributes, themes, etc as you normally would.
;;
;; See the README.org file in this repository for additional information.
;;; Code:
(require 'rational-defaults)
(require 'rational-screencast)
(require 'rational-ui)
(require 'rational-editing)
(require 'rational-evil)
(require 'rational-completion)
(require 'rational-windows)
(require 'rational-use-package)
(setq system-time-locale "C")
(setenv "LANG" "en_US.UTF-8")
(setenv "LC_ALL" "en_US.UTF-8")
;; Set further font and theme customizations
(custom-set-variables
'(rational-ui-default-font
'(:font "Fira Code Retina" :weight light :height 110)))
(add-to-list 'default-frame-alist `(font . "Fira Code Retina"))
(set-face-attribute 'default nil :font "Fira Code Retina" :height 110)
(set-face-attribute 'fixed-pitch nil :font "Fira Code Retina" :height 110)
(set-face-attribute 'variable-pitch nil :font "Fira Code Retina" :height 110 :weight 'regular)
(set-fontset-font t 'hangul (font-spec :family "D2Coding" :height 110))
(setq face-font-rescale-alist
'(("D2Coding" . 1.25)))
(set-frame-parameter (selected-frame) 'fullscreen 'maximized)
(add-to-list 'default-frame-alist '(fullscreen . maximized))
(load-theme 'doom-dracula t)
(column-number-mode)
(global-display-line-numbers-mode t)
(global-hl-line-mode)
;;; example-config.el ends here
(setq user-full-name "JaeYoo-Im"
user-mail-address "cpu3792@gmail.com")
(defun toggle-transparency ()
(interactive)
(let ((alpha (frame-parameter nil 'alpha)))
(set-frame-parameter
nil 'alpha
(if (eql (cond ((numberp alpha) alpha)
((numberp (cdr alpha)) (cdr alpha))
;; Also handle undocumented (<active> <inactive>) form.
((numberp (cadr alpha)) (cadr alpha)))
100)
'(75 . 75) '(100 . 100)))))
(global-set-key (kbd "C-c t") 'toggle-transparency)
(set-frame-parameter (selected-frame) 'alpha '(75 . 75))
;; DASHBOARD
(straight-use-package 'dashboard)
(require 'all-the-icons)
(setq dashboard-set-heading-icons t)
(setq dashboard-set-file-icons t)
(setq dashboard-startup-banner 'logo)
(setq dashboard-center-content t)
(setq dashboard-week-agenda t)
(setq dashboard-agenda-time-string-format "%d/%m/%Y %A %H:%M")
(setq dashboard-items '((recents . 10)
(agenda . 5)
(bookmarks . 5)
(registers . 5)))
(setq dashboard-set-navigator t)
;; Format: "(icon title help action face prefix suffix)"
(setq dashboard-navigator-buttons
`((
(,(all-the-icons-octicon "mark-github" :height 1.1 :v-adjust 0.0)
"Github"
"Browse github"
(lambda (&rest _) (browse-url "https://github.com/JaeUs3792")))
(,(all-the-icons-octicon "book" :height 1.1 :v-adjust 0.0)
"My Blog"
"Browse Blog"
(lambda (&rest _) (browse-url "https://jaeus.net"))))))
(setq dashboard-set-footer nil)
(dashboard-setup-startup-hook)
;; EMOJI
(straight-use-package 'emojify)
(global-emojify-mode)
;; Which Key
(straight-use-package 'which-key)
(setq which-key-idle-delay 0.5)
(which-key-mode)
;; GENERAL KEY MAP
(straight-use-package 'general)
(general-evil-setup t)
(general-create-definer ju/leader-key-def
:keymaps '(normal insert visual emacs)
:prefix "SPC"
:global-prefix "C-SPC")
(ju/leader-key-def
"." 'find-file
;; Buffer
"b" '(:ignore t :which-key "buffer handling")
"b b" '(ibuffer :which-key "IBuffer")
"b k" '(kill-current-buffer :which-key "Kill current buffer")
"b n" '(next-buffer :which-key "Next buffer")
"b p" '(previous-buffer :which-key "Previous buffer")
"b B" '(ibuffer-list-buffers :which-key "IBuffer List Buffers")
"b K" '(kill-buffer :which-key "IBuffer Kill Buffers")
;; Eshell
"e" '(:ignore t :which-key "eshell")
"e h" '(counsel-esh-history :which "Kill history")
"e s" '(eshell :which "run eshell")
;; Workspace
;; Counsel
"f" '(:ignore t :which-key "file op.")
"f r" '(consult-recent-file :which-key "Recent files")
"f R" '(revert-buffer :which-key "Revert Buffer")
"t t" '(toggle-truncate-lines :which-key "Toggle truncate lines")
;; Shortcut
"f d d" '(lambda () (interactive) (find-file (expand-file-name "~/.emacs.rational.d/desktop.el")) :which-key "open exwm config")
"f d e" '(lambda () (interactive) (find-file (expand-file-name "~/.emacs.rational.d/config.el")) :which-key "open emacs config"))
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
(global-unset-key (kbd "C-j"))
(global-unset-key (kbd "C-k"))
(global-unset-key (kbd "S-SPC")) ;; use only S-\
;; tramp default is scp
(setq tramp-default-method "ssh")
(straight-use-package 'flycheck)
(global-flycheck-mode t)
;;(straight-use-package 'vertico-posframe)
;;(setq vertico-posframe-parameters
;; `((left-fringe . 8)
;; (right-fringe . 8) (alpha . 100)))
;;(vertico-posframe-mode 1)
;; TODO
(straight-use-package 'hl-todo)
(setq hl-todo-highlight-punctuation ":"
hl-todo-keyword-faces
`(;; For things that need to be done, just not today.
("TODO" warning bold)
;; For problems that will become bigger problems later if not
;; fixed ASAP.
("FIXME" error bold)
;; For tidbits that are unconventional and not intended uses of the
;; constituent parts, and may break in a future update.
("HACK" font-lock-constant-face bold)
;; For things that were done hastily and/or hasn't been thoroughly
;; tested. It may not even be necessary!
("REVIEW" font-lock-keyword-face bold)
;; For especially important gotchas with a given implementation,
;; directed at another user other than the author.
("NOTE" success bold)
;; For things that just gotta go and will soon be gone.
("DEPRECATED" font-lock-doc-face bold)
;; For a known bug that needs a workaround
("BUG" error bold)
;; For warning about a problematic or misguiding code
("XXX" font-lock-constant-face bold)))
(global-hl-todo-mode)
;; ORG Mode
(setq org-todo-keywords
'((sequence "TODO(t)" "HOLD(h)" "|" "KILL(k)" "DONE(d)")))
(setq org-ellipsis "")
(setq org-hide-emphasis-markers t)
(setq org-src-fontify-natively t)
(setq org-fontify-quote-and-verse-blocks t)
(setq org-agenda-start-with-log-mode t)
(setq org-log-done 'time)
(setq org-log-into-drawer t)
(add-hook 'org-mode-hook (lambda () (org-indent-mode)))
;;(straight-use-package 'org-superstar)
;;(add-hook 'org-mode-hook (lambda () (org-superstar-mode 1)))
(straight-use-package 'org-attach-screenshot)
(straight-use-package 'org-download)

1454
.emacs.vanilla/emacs.el Normal file

File diff suppressed because it is too large Load Diff

View File

@ -309,8 +309,8 @@ https://nathantypanski.com/blog/2014-08-03-a-vim-like-emacs-config.html
;; Set frame transparency ;; Set frame transparency
(set-frame-parameter (selected-frame) 'alpha gvar/frame-transparency) (set-frame-parameter (selected-frame) 'alpha gvar/frame-transparency)
(add-to-list 'default-frame-alist `(alpha . ,gvar/frame-transparency)) (add-to-list 'default-frame-alist `(alpha . ,gvar/frame-transparency))
;;(set-frame-parameter (selected-frame) 'fullscreen 'maximized) (set-frame-parameter (selected-frame) 'fullscreen 'maximized)
;;(add-to-list 'default-frame-alist '(fullscreen . maximized)) (add-to-list 'default-frame-alist '(fullscreen . maximized))
#+end_src #+end_src
* Dashboard * Dashboard
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -1321,8 +1321,8 @@ https://emacs.stackexchange.com/a/30691
(use-package org-gcal (use-package org-gcal
:ensure t :ensure t
:config :config
(setq org-gcal-client-id "oauth 2.0 client ID" (setq org-gcal-client-id "928945571655-4h4kclj8etm6qfm27jk4jhgil6jsotbc.apps.googleusercontent.com"
org-gcal-client-secret "client secret" org-gcal-client-secret "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"
org-gcal-file-alist '(("cpu3792@gmail.com" . "~/Roam/gcal.org")))) org-gcal-file-alist '(("cpu3792@gmail.com" . "~/Roam/gcal.org"))))
;;(add-hook 'org-agenda-mode-hook (lambda () (org-gcal-sync) )) ;;(add-hook 'org-agenda-mode-hook (lambda () (org-gcal-sync) ))
(add-hook 'org-capture-after-finalize-hook (lambda () (org-gcal-sync) )) (add-hook 'org-capture-after-finalize-hook (lambda () (org-gcal-sync) ))

View File

@ -11,4 +11,4 @@
rm ~/.emacs.d/emacs.el rm ~/.emacs.d/emacs.el
picom -b --config $HOME/.xmonad/scripts/picom.conf & picom -b --config $HOME/.xmonad/scripts/picom.conf &
~/scripts/random_wallpaper.sh ~/scripts/random_wallpaper.sh
exec dbus-launch --exit-with-session emacs -mm --debug-init -l ~/.emacs.d/desktop.el exec dbus-launch --exit-with-session emacs --with-profile vanilla -mm --debug-init -l ~/.emacs.d/desktop.el

View File

Before

Width:  |  Height:  |  Size: 165 KiB

After

Width:  |  Height:  |  Size: 165 KiB

View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB