more changes, all should work pretty nicely now

This commit is contained in:
2025-05-21 15:45:30 +02:00
parent 0e34591f0a
commit ab93aae1b6
56 changed files with 6674 additions and 229 deletions
+558
View File
@@ -0,0 +1,558 @@
(defvar elpaca-installer-version 0.6)
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory))
(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git"
:ref nil
:files (:defaults (:exclude "extensions"))
:build (:not elpaca--activate-package)))
(let* ((repo (expand-file-name "elpaca/" elpaca-repos-directory))
(build (expand-file-name "elpaca/" elpaca-builds-directory))
(order (cdr elpaca-order))
(default-directory repo))
(add-to-list 'load-path (if (file-exists-p build) build repo))
(unless (file-exists-p repo)
(make-directory repo t)
(when (< emacs-major-version 28) (require 'subr-x))
(condition-case-unless-debug err
(if-let ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*"))
((zerop (call-process "git" nil buffer t "clone"
(plist-get order :repo) repo)))
((zerop (call-process "git" nil buffer t "checkout"
(or (plist-get order :ref) "--"))))
(emacs (concat invocation-directory invocation-name))
((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch"
"--eval" "(byte-recompile-directory \".\" 0 'force)")))
((require 'elpaca))
((elpaca-generate-autoloads "elpaca" repo)))
(kill-buffer buffer)
(error "%s" (with-current-buffer buffer (buffer-string))))
((error) (warn "%s" err) (delete-directory repo 'recursive))))
(unless (require 'elpaca-autoloads nil t)
(require 'elpaca)
(elpaca-generate-autoloads "elpaca" repo)
(load "./elpaca-autoloads")))
(add-hook 'after-init-hook #'elpaca-process-queues)
(elpaca `(,@elpaca-order))
;; Install use-package support
(elpaca elpaca-use-package
;; Enable :elpaca use-package keyword.
(elpaca-use-package-mode)
;; Assume :elpaca t unless otherwise specified.
(setq elpaca-use-package-by-default t))
;; Block until current queue processed.
(elpaca-wait)
;;When installing a package which modifies a form used at the top-level
;;(e.g. a package which adds a use-package key word),
;;use `elpaca-wait' to block until that package has been installed/configured.
;;For example:
;;(use-package general :demand t)
;;(elpaca-wait)
;;Turns off elpaca-use-package-mode current declartion
;;Note this will cause the declaration to be interpreted immediately (not deferred).
;;Useful for configuring built-in emacs features.
;;(use-package emacs :elpaca nil :config (setq ring-bell-function #'ignore))
;; Don't install anything. Defer execution of BODY
;;(elpaca nil (message "deferred"))
;; Expands to: (elpaca evil (use-package evil :demand t))
(use-package evil
:bind (:map evil-normal-state-map
("<C-u>" . evil-scroll-page-up))
:init ;; tweak evil's configuration before loading it
(setq evil-want-integration t) ;; This is optional since it's already set to t by default.
(setq evil-respect-visual-line-mode t)
(setq evil-want-keybinding nil)
(setq evil-vsplit-window-right t)
(setq evil-split-window-below t)
(evil-mode))
(use-package evil-collection
:after evil
:config
(setq evil-collection-mode-list '(dashboard dired ibuffer))
(evil-collection-init))
(use-package general
:config
(general-evil-setup)
;; set 'SPC' as global leader key
(general-create-definer lm/leader-keys
:states '(normal insert visual emacs)
:keymaps 'override
:prefix "SPC" ;; set leader
:global-prefix "M-SPC") ;; access leader in insert mode
(lm/leader-keys
"b" '(:ignore t :wk "buffer")
"b b" '(switch-to-buffer :wk "Switch buffer")
"b i" '(ibuffer :wk "Ibuffer")
"b k" '(kill-this-buffer :wk "Kill this buffer")
"b n" '(next-buffer :wk "Next buffer")
"b p" '(previous-buffer :wk "Previous buffer")
"b r" '(revert-buffer :wk "Reload buffer"))
(lm/leader-keys
"e" '(:ignore t :wk "Eshell/Evaluate")
"e b" '(eval-buffer :wk "Evaluate elisp in buffer")
"e d" '(eval-defun :wk "Evaluate defun containing or after point")
"e e" '(eval-expression :wk "Evaluate an elisp expression")
"e l" '(eval-last-sexp :wk "Evaluate elisp expression before point")
"e r" '(eval-region :wk "Evaluate elisp in region")
"e h" '(counsel-esh-history :wk "Eshell history")
"e s" '(eshell :wk "Eshell"))
(lm/leader-keys
"SPC" '(counsel-M-x :wk "Counsel M-x")
"." '(find-file :wk "Find file")
"f c" '((lambda () (interactive) (find-file "~/.config/emacs/config.org")) :wk "Edit emacs config")
"f r" '(counsel-recentf :wk "Find recent files")
"TAB TAB" '(comment-line :wk "Comment lines"))
(lm/leader-keys
"h" '(:ignore t :wk "Help")
"h f" '(describe-function :wk "Describe function")
"h v" '(describe-variable :wk "Describe variable")
"h r r" '(reload-init-file :wk "Reload emacs config"))
;; "h r r" '((lambda () (interactive) (load-file user-init-file)) :wk "Reload emacs config"))
(lm/leader-keys
"i" '(:ignore t :wk "Insert")
"i p" '(org-download-screenshot :wk "Insert screenshot (org)"))
(lm/leader-keys
"t" '(:ignore t :wk "Toggle")
"t l" '(display-line-numbers-mode :wk "Toggle line numbers")
"t v" '(vterm-toggle :wk "Toggle Vterm")
"t i" '(org-toggle-inline-images :wk "Toggle inline images")
"t t" '(visual-line-mode :wk "Toggle truncated lines"))
(lm/leader-keys
"s" '(:ignore t :wk "Shell")
"s c" '(shell-command :wk "Run a shell command")
"s d" '(sh-cd-here :wk "Move current shell to current dir")
"s m" '(sh-mode :wk "Shell mode"))
(lm/leader-keys
"c" '(:ignore t :wk "Capitalize")
"c w" '(capitalize-word :wk "Capitalize word")
"c r" '(capitalize-region :wk "Capitalize region")
"c c" '(upcase-char :wk "Upcase char")
"c u" '(upcase-region :wk "Upcase region"))
(lm/leader-keys
"l" '(:ignore t :wk "Downcase")
"l w" '(downcase-word :wk "Downcase word")
"l u" '(downcase-region :wk "Downcase region"))
;; Evil window bindings
(lm/leader-keys
"w" '(:ignore t :wk "Window")
"w w" '(evil-window-next :wk "Next window")
"w h" '(evil-window-left :wk "Move cursor to window left")
"w j" '(evil-window-down :wk "Move cursor to window below")
"w k" '(evil-window-up :wk "Move cursor to window above")
"w l" '(evil-window-right :wk "Move cursor to window right")
"w s" '(evil-window-split :wk "Split window horizontally")
"w v" '(evil-window-vsplit :wk "Split window vertically")
"w H" '(evil-window-move-far-left :wk "Move split to left")
"w J" '(evil-window-move-very-bottom :wk "Move split to bottom")
"w K" '(evil-window-move-very-top :wk "Move split to top")
"w L" '(evil-window-move-far-right :wk "Move split to right")
"w c" '(evil-window-delete :wk "Close window")
"w o" '(delete-other-windows :wk "Delete other windows")
"w =" '(balance-windows :wk "Balance windows")
"q k" '(kill-buffer-and-window :wk "Kill buf and window")
"q q" '(save-buffers-kill-terminal :wk "Save bufs, kill term"))
;; (evil-global-set-key 'visual "K" (kbd ":m '<-2 RET gv '< gk"))
(evil-global-set-key 'visual "K" 'drag-stuff-up)
;; (evil-global-set-key 'visual "J" (kbd ":m '>+1 RET gv '> gj"))
(evil-global-set-key 'visual "J" 'drag-stuff-down)
(lm/leader-keys
"p" '(:ignore t :wk "Project")
"p o" '(dashboard-open :wk "Return to dashboard")
"p f" '(project-find-file :wk "Find project file"))
)
(use-package all-the-icons
:ensure t
:diminish
:if (display-graphic-p))
(use-package all-the-icons-dired
:hook (dired-mode . (lambda () (all-the-icons-dired-mode t))))
(setq backup-directory-alist
`((".*" . "~/emacs/auto-saves")))
(setq auto-save-file-name-transforms
`((".*" "~/emacs/auto-saves" t)))
(use-package company
:defer 2
:diminish
:custom
(company-begin-commands '(self-insert-command))
(company-idle-delay .1)
(company-minimum-prefix-length 2)
(company-show-numbers t)
(company-tooltip-align-annotations 't)
(global-company-mode t))
(use-package company-box
:after company
:diminish
:hook (company-mode . company-box-mode))
(use-package dashboard
:ensure t
:diminish
:init
(setq initial-buffer-choice 'dashboard-open)
(setq dashboard-set-heading-icons t)
;; (setq dashboard-set-navigator t)
(setq dashboard-set-file-icons t)
(setq dashboard-banner-logo-title "Welcome to Emacs!")
;; (setq dashboard-startup-banner 'logo) ;; default logo
(setq dashboard-startup-banner "~/pictures/smol-penguin.png")
(setq dashboard-center-content t)
(setq dashboard-items '((recents . 5)
(agenda . 5)
(bookmarks . 3)
;; (registers . 3)
(projects . 3)))
;; (dashboard-modify-heading-icons '((recents . "file-text")
;; (bookmarks . "book")))
:config
(dashboard-setup-startup-hook))
(use-package diminish)
(use-package drag-stuff
:diminish
:config
(drag-stuff-global-mode 1))
(use-package flycheck
:ensure t
:defer t
:diminish
:init (global-flycheck-mode))
(set-face-attribute 'default nil
;; try switch to Source Code Pro
:font "FiraCodeNerdFontMono"
:height 110
:weight 'medium)
(set-face-attribute 'variable-pitch nil
:font "FiraCodeNerdFontMono"
:height 120
:weight 'medium)
(set-face-attribute 'fixed-pitch nil
:font "FiraCodeNerdFontMono"
:height 110
:weight 'medium)
;; Makes commented text and keywords italics.
;; This is working in emacsclient but not emacs.
;; Your font must have an italic face available.
(set-face-attribute 'font-lock-comment-face nil
:slant 'italic)
(set-face-attribute 'font-lock-keyword-face nil
:slant 'italic)
;; This sets the default font on all graphical frames created after restarting Emacs.
;; Does the same thing as 'set-face-attribute default' above, but emacsclient fonts
;; are not right unless I also add this method of setting the default font.
(add-to-list 'default-frame-alist '(font . "FiraCodeNerdFontMono-14"))
;; Uncomment the following line if line spacing needs adjusting.
;; (setq-default line-spacing 0.12)
(global-set-key (kbd "C-=") 'text-scale-increase)
(global-set-key (kbd "C--") 'text-scale-decrease)
(global-set-key (kbd "<C-wheel-up>") 'text-scale-increase)
(global-set-key (kbd "<C-wheel-down>") 'text-scale-decrease)
(use-package gnuplot-mode)
;; automatically open files ending with .gp or .gnuplot in gnuplot mode
;; (setq auto-mode-alist
;; (append '(("\\.\\(gp\\|gnuplot\\)$" . gnuplot-mode)) auto-mode-alist)))
(use-package image-dired+)
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
(setq-default indent-line-function 'insert-tab)
(setq-default c-default-style "linux"
c-basic-offset 4)
;; if indent-tabs-mode is off, untabify before saving
;;(add-hook 'write-file-hooks
;; (lambda () (if (not indent-tabs-mode)
;; (untabify (point-min) (point-max)))))
;; This assumes you've installed the package via MELPA.
(use-package ligature
:config
;; Enable the "www" ligature in every possible major mode
(ligature-set-ligatures 't '("www"))
;; Enable traditional ligature support in eww-mode, if the
;; `variable-pitch' face supports it
(ligature-set-ligatures 'eww-mode '("ff" "fi" "ffi"))
;; Enable all FiraMonoNerdFont and Fira Code ligatures in programming modes
(ligature-set-ligatures 'prog-mode
'(;; == === ==== => =| =>>=>=|=>==>> ==< =/=//=// =~
;; =:= =!=
("=" (rx (+ (or ">" "<" "|" "/" "~" ":" "!" "="))))
;; ;; ;;;
(";" (rx (+ ";")))
;; && &&&
("&" (rx (+ "&")))
;; !! !!! !. !: !!. != !== !~
("!" (rx (+ (or "=" "!" "\." ":" "~"))))
;; ?? ??? ?: ?= ?.
("?" (rx (or ":" "=" "\." (+ "?"))))
;; %% %%%
("%" (rx (+ "%")))
;; |> ||> |||> ||||> |] |} || ||| |-> ||-||
;; |->>-||-<<-| |- |== ||=||
;; |==>>==<<==<=>==//==/=!==:===>
("|" (rx (+ (or ">" "<" "|" "/" ":" "!" "}" "\]"
"-" "=" ))))
;; \\ \\\ \/
("\\" (rx (or "/" (+ "\\"))))
;; ++ +++ ++++ +>
("+" (rx (or ">" (+ "+"))))
;; :: ::: :::: :> :< := :// ::=
(":" (rx (or ">" "<" "=" "//" ":=" (+ ":"))))
;; // /// //// /\ /* /> /===:===!=//===>>==>==/
("/" (rx (+ (or ">" "<" "|" "/" "\\" "\*" ":" "!"
"="))))
;; .. ... .... .= .- .? ..= ..<
("\." (rx (or "=" "-" "\?" "\.=" "\.<" (+ "\."))))
;; -- --- ---- -~ -> ->> -| -|->-->>->--<<-|
("-" (rx (+ (or ">" "<" "|" "~" "-"))))
;; *> */ *) ** *** ****
("*" (rx (or ">" "/" ")" (+ "*"))))
;; www wwww
("w" (rx (+ "w")))
;; <> <!-- <|> <: <~ <~> <~~ <+ <* <$ </ <+> <*>
;; <$> </> <| <|| <||| <|||| <- <-| <-<<-|-> <->>
;; <<-> <= <=> <<==<<==>=|=>==/==//=!==:=>
;; << <<< <<<<
("<" (rx (+ (or "\+" "\*" "\$" "<" ">" ":" "~" "!"
"-" "/" "|" "="))))
;; >: >- >>- >--|-> >>-|-> >= >== >>== >=|=:=>>
;; >> >>> >>>>
(">" (rx (+ (or ">" "<" "|" "/" ":" "=" "-"))))
;; #: #= #! #( #? #[ #{ #_ #_( ## ### #####
("#" (rx (or ":" "=" "!" "(" "\?" "\[" "{" "_(" "_"
(+ "#"))))
;; ~~ ~~~ ~= ~- ~@ ~> ~~>
("~" (rx (or ">" "=" "-" "@" "~>" (+ "~"))))
;; __ ___ ____ _|_ __|____|_
("_" (rx (+ (or "_" "|"))))
;; Fira code: 0xFF 0x12
("0" (rx (and "x" (+ (in "A-F" "a-f" "0-9")))))
;; Fira code:
"Fl" "Tl" "fi" "fj" "fl" "ft"
;; The few not covered by the regexps.
"{|" "[|" "]#" "(*" "}#" "$>" "^="))
;; Enables ligature checks globally in all buffers. You can also do it
;; per mode with `ligature-mode'.
(global-ligature-mode t))
(use-package markdown-mode
:ensure t
:mode ("README\\.md\\'" . gfm-mode)
:init (setq markdown-command "multimarkdown"))
;; inspired by https://zzamboni.org/post/how-to-insert-screenshots-in-org-documents-on-macos/
(use-package org-download
:after org
:defer nil
:custom
(org-download-method 'directory)
(org-download-image-dir "~/emacs/")
(org-download-heading-lvl 0)
(org-download-timestamp "org_%Y%m%d-%H%M%S_")
;; (org-image-actual-width 400)
(org-download-screenshot-method "wl-paste -t image/png > '%s'")
:bind
("C-M-y" . org-download-screenshot)
:config
(require 'org-download))
(use-package projectile
:diminish
:config
(projectile-mode 1))
(use-package rainbow-mode
:diminish
:hook
((org-mode prog-mode) . rainbow-mode))
(defun reload-init-file ()
(interactive)
(load-file user-init-file)
(load-file user-init-file))
(use-package eshell-syntax-highlighting
:after esh-mode
:config
(eshell-syntax-highlighting-global-mode +1))
(setq eshell-rc-script (concat user-emacs-directory "eshell/profile")
eshell-aliases-file (concat user-emacs-directory "eshell/aliases")
eshell-history-size 5000
eshell-buffer-maximum-lines 5000
eshell-hist-ignoredups t
eshell-scroll-to-bottom-on-input t
eshell-destroy-buffer-when-process-dies t
eshell-visual-commands'("bash" "fish" "htop" "ssh" "top" "zsh"))
(use-package vterm
:config
(setq shell-file-name "/run/current-system/sw/bin/bash"
vterm-max-scrollback 5000))
(use-package vterm-toggle
:after vterm
:config
(setq vterm-toggle-fullscreen-p nil)
(setq vterm-toggle-scope 'project)
(add-to-list 'display-buffer-alist
'((lambda (buffer-or-name _)
(let ((buffer (get-buffer buffer-or-name)))
(with-current-buffer buffer
(or (equal major-mode 'vterm-mode)
(string-prefix-p vterm-buffer-name (buffer-name buffer))))))
(display-buffer-reuse-window display-buffer-at-bottom)
;;(display-buffer-reuse-window display-buffer-in-direction)
;;display-buffer-in-direction/direction/dedicated is added in emacs27
;;(direction . bottom)
;;(dedicated . t) ;dedicated is supported in emacs27
(reusable-frames . visible)
(window-height . 0.3))))
(use-package sudo-edit
:config
(lm/leader-keys
"fu" '(sudo-edit-find-file :wk "Sudo find file")
"fU" '(sudo-edit :wk "Sudo edit file")))
;;(add-to-list 'custom-theme-load-path "~/.config/emacs/themes")
;;(load-theme 'soft-charcoal t)
(use-package doom-themes
:ensure t
:config
;; Global settings (defaults)
(setq doom-themes-enable-bold t ; if nil, bold is universally disabled
doom-themes-enable-italic t) ; if nil, italics is universally disabled
(load-theme 'doom-monokai-spectrum t)
;; (load-theme 'doom-monokai-machine t)
;; Enable flashing mode-line on errors
(doom-themes-visual-bell-config)
;; Enable custom neotree theme (all-the-icons must be installed!)
(doom-themes-neotree-config)
;; or for treemacs users
(setq doom-themes-treemacs-theme "doom-colors") ; use "doom-colors" for less minimal icon theme
(doom-themes-treemacs-config)
;; Corrects (and improves) org-mode's native fontification.
(doom-themes-org-config))
(add-to-list 'default-frame-alist '(alpha-background . 90)) ;; for all new frames
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
(global-display-line-numbers-mode 0)
(menu-bar--display-line-numbers-mode-relative)
;; (setq display-line-numbers-mode-relative 't)
(global-visual-line-mode t)
(use-package counsel
:after ivy
:diminish
:config (counsel-mode))
(use-package ivy
:bind
;; ivy-resume resumes the last Ivy-based completion.
(("C-c C-r" . ivy-resume)
("C-x B" . ivy-switch-buffer-other-window))
:diminish
:custom
(setq ivy-use-virtual-buffers t)
(setq ivy-count-format "(%d/%d) ")
(setq enable-recursive-minibuffers t)
:config
(ivy-mode))
(use-package all-the-icons-ivy-rich
:ensure t
:diminish
:init (all-the-icons-ivy-rich-mode 1))
(use-package ivy-rich
:after ivy
:diminish
:ensure t
:init (ivy-rich-mode 1) ;; this gets us descriptions in M-x.
:custom
(ivy-virtual-abbreviate 'full
ivy-rich-switch-buffer-align-virtual-buffer t
ivy-rich-path-style 'abbrev)
:config
(ivy-set-display-transformer 'ivy-switch-buffer
'ivy-rich-switch-buffer-transformer))
(use-package zig-mode)
(use-package nix-mode)
;; (use-package jai-mode)
(use-package rust-mode)
(use-package cargo-mode)
(use-package lua-mode)
(add-to-list 'load-path "~/.config/emacs/manual-packages")
(require 'odin-mode)
(use-package toc-org
:commands toc-org-enable
:init (add-hook 'org-mode-hook 'toc-org-enable))
(add-hook 'org-mode-hook 'org-indent-mode)
;;(setq (setq org-return-follows-link t)
(use-package org-bullets)
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
(require 'org-tempo)
(use-package which-key
:init
(which-key-mode 1)
:diminish
:config
(setq which-key-side-window-location 'bottom
which-key-sort-order #'which-key-key-order-alpha
which-key-sort-uppercase-first nil
which-key-add-column-padding 1
which-key-max-display-columns nil
which-key-min-display-lines 6
which-key-side-window-slot -10
which-key-side-window-max-height 0.25
which-key-ide-delay 0.8
which-key-max-description-length 25
which-key-allow-imprecise-window-fit nil
which-key-separator " -> " ))
+792
View File
@@ -0,0 +1,792 @@
#+TITLE:LM's Emacs Config
#+Author: Liam Malone (LM)
#+DESCRIPTION: LM's personal Emacs config
#+STARTUP: showeverything
#+OPTIONS: toc:2
* TABLE OF CONTENTS :toc:
- [[#important-programs-to-load-first][IMPORTANT PROGRAMS TO LOAD FIRST]]
- [[#elpaca-package-manager][Elpaca Package Manager]]
- [[#load-evil-mode][Load Evil Mode]]
- [[#general-keybindings][General Keybindings]]
- [[#all-the-icons][ALL THE ICONS]]
- [[#autosave][AUTOSAVE]]
- [[#company][COMPANY]]
- [[#dashboard][DASHBOARD]]
- [[#diminish][DIMINISH]]
- [[#drag-stuff][DRAG-STUFF]]
- [[#flycheck][FLYCHECK]]
- [[#fonts][FONTS]]
- [[#setting-the-font-face][Setting The Font Face]]
- [[#zoom-inout][Zoom In/Out]]
- [[#gnuplot][GNUPLOT]]
- [[#image-dir-ed][IMAGE DIR-ED]]
- [[#indentingtabs][INDENTING/TABS]]
- [[#ligatures][LIGATURES]]
- [[#markdown-mode][MARKDOWN MODE]]
- [[#org-download][ORG DOWNLOAD]]
- [[#pulse][PULSE]]
- [[#pdf-tools][PDF TOOLS]]
- [[#projectile][PROJECTILE]]
- [[#rainbow-mode][RAINBOW MODE]]
- [[#reload-emacs][RELOAD EMACS]]
- [[#shells-and-terminals][SHELLS AND TERMINALS]]
- [[#eshell][Eshell]]
- [[#vterm][Vterm]]
- [[#sudo-edit][SUDO EDIT]]
- [[#theme][THEME]]
- [[#transparency][TRANSPARENCY]]
- [[#gui-tweaks][GUI TWEAKS]]
- [[#disable-menubar-toolbars-and-scrollbars][Disable Menubar, Toolbars and Scrollbars]]
- [[#display-line-numbers-and-truncated-lines][Display Line Numbers and Truncated Lines]]
- [[#ivy-counsel][IVY (COUNSEL)]]
- [[#language-support][LANGUAGE SUPPORT]]
- [[#org-mode][ORG MODE]]
- [[#enabling-table-of-contents][Enabling Table of Contents]]
- [[#enabling-org-bullets][Enabling Org Bullets]]
- [[#source-code-block-tag-expansion][Source Code Block Tag Expansion]]
- [[#which-key][WHICH-KEY]]
* IMPORTANT PROGRAMS TO LOAD FIRST
** Elpaca Package Manager
#+begin_src emacs-lisp
(defvar elpaca-installer-version 0.6)
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory))
(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git"
:ref nil
:files (:defaults (:exclude "extensions"))
:build (:not elpaca--activate-package)))
(let* ((repo (expand-file-name "elpaca/" elpaca-repos-directory))
(build (expand-file-name "elpaca/" elpaca-builds-directory))
(order (cdr elpaca-order))
(default-directory repo))
(add-to-list 'load-path (if (file-exists-p build) build repo))
(unless (file-exists-p repo)
(make-directory repo t)
(when (< emacs-major-version 28) (require 'subr-x))
(condition-case-unless-debug err
(if-let ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*"))
((zerop (call-process "git" nil buffer t "clone"
(plist-get order :repo) repo)))
((zerop (call-process "git" nil buffer t "checkout"
(or (plist-get order :ref) "--"))))
(emacs (concat invocation-directory invocation-name))
((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch"
"--eval" "(byte-recompile-directory \".\" 0 'force)")))
((require 'elpaca))
((elpaca-generate-autoloads "elpaca" repo)))
(kill-buffer buffer)
(error "%s" (with-current-buffer buffer (buffer-string))))
((error) (warn "%s" err) (delete-directory repo 'recursive))))
(unless (require 'elpaca-autoloads nil t)
(require 'elpaca)
(elpaca-generate-autoloads "elpaca" repo)
(load "./elpaca-autoloads")))
(add-hook 'after-init-hook #'elpaca-process-queues)
(elpaca `(,@elpaca-order))
;; Install use-package support
(elpaca elpaca-use-package
;; Enable :elpaca use-package keyword.
(elpaca-use-package-mode)
;; Assume :elpaca t unless otherwise specified.
(setq elpaca-use-package-by-default t))
;; Block until current queue processed.
(elpaca-wait)
;;When installing a package which modifies a form used at the top-level
;;(e.g. a package which adds a use-package key word),
;;use `elpaca-wait' to block until that package has been installed/configured.
;;For example:
;;(use-package general :demand t)
;;(elpaca-wait)
;;Turns off elpaca-use-package-mode current declartion
;;Note this will cause the declaration to be interpreted immediately (not deferred).
;;Useful for configuring built-in emacs features.
;;(use-package emacs :elpaca nil :config (setq ring-bell-function #'ignore))
;; Don't install anything. Defer execution of BODY
;;(elpaca nil (message "deferred"))
#+end_src
** Load Evil Mode
#+begin_src emacs-lisp
;; Expands to: (elpaca evil (use-package evil :demand t))
(use-package evil
:bind (:map evil-normal-state-map
("<C-u>" . evil-scroll-page-up))
:init ;; tweak evil's configuration before loading it
(setq evil-want-integration t) ;; This is optional since it's already set to t by default.
(setq evil-respect-visual-line-mode t)
(setq evil-want-keybinding nil)
(setq evil-vsplit-window-right t)
(setq evil-split-window-below t)
(evil-mode))
(use-package evil-collection
:after evil
:config
(setq evil-collection-mode-list '(dashboard dired ibuffer))
(evil-collection-init))
#+end_src
** General Keybindings
#+begin_src emacs-lisp
(use-package general
:config
(general-evil-setup)
;; set 'SPC' as global leader key
(general-create-definer lm/leader-keys
:states '(normal insert visual emacs)
:keymaps 'override
:prefix "SPC" ;; set leader
:global-prefix "M-SPC") ;; access leader in insert mode
(lm/leader-keys
"b" '(:ignore t :wk "buffer")
"b b" '(switch-to-buffer :wk "Switch buffer")
"b i" '(ibuffer :wk "Ibuffer")
"b k" '(kill-this-buffer :wk "Kill this buffer")
"b n" '(next-buffer :wk "Next buffer")
"b p" '(previous-buffer :wk "Previous buffer")
"b r" '(revert-buffer :wk "Reload buffer"))
(lm/leader-keys
"e" '(:ignore t :wk "Eshell/Evaluate")
"e b" '(eval-buffer :wk "Evaluate elisp in buffer")
"e d" '(eval-defun :wk "Evaluate defun containing or after point")
"e e" '(eval-expression :wk "Evaluate an elisp expression")
"e l" '(eval-last-sexp :wk "Evaluate elisp expression before point")
"e r" '(eval-region :wk "Evaluate elisp in region")
"e h" '(counsel-esh-history :wk "Eshell history")
"e s" '(eshell :wk "Eshell"))
(lm/leader-keys
"SPC" '(counsel-M-x :wk "Counsel M-x")
"." '(find-file :wk "Find file")
"f c" '((lambda () (interactive) (find-file "~/nixos/modules/old_configs/emacs/config.org")) :wk "Edit emacs config")
"f r" '(counsel-recentf :wk "Find recent files")
"TAB TAB" '(comment-line :wk "Comment lines"))
(lm/leader-keys
"h" '(:ignore t :wk "Help")
"h f" '(describe-function :wk "Describe function")
"h v" '(describe-variable :wk "Describe variable")
"h r r" '(reload-init-file :wk "Reload emacs config"))
;; "h r r" '((lambda () (interactive) (load-file user-init-file)) :wk "Reload emacs config"))
(lm/leader-keys
"i" '(:ignore t :wk "Insert")
"i p" '(org-download-screenshot :wk "Insert screenshot (org)"))
(lm/leader-keys
"t" '(:ignore t :wk "Toggle")
"t l" '(display-line-numbers-mode :wk "Toggle line numbers")
"t i" '(org-toggle-inline-images :wk "Toggle inline images")
"t t" '(visual-line-mode :wk "Toggle truncated lines"))
(lm/leader-keys
"s" '(:ignore t :wk "Shell")
"s c" '(shell-command :wk "Run a shell command")
"s d" '(sh-cd-here :wk "Move current shell to current dir")
"s m" '(sh-mode :wk "Shell mode"))
(lm/leader-keys
"c" '(:ignore t :wk "Capitalize")
"c w" '(capitalize-word :wk "Capitalize word")
"c r" '(capitalize-region :wk "Capitalize region")
"c c" '(upcase-char :wk "Upcase char")
"c u" '(upcase-region :wk "Upcase region"))
(lm/leader-keys
"l" '(:ignore t :wk "Downcase")
"l w" '(downcase-word :wk "Downcase word")
"l u" '(downcase-region :wk "Downcase region"))
;; Evil window bindings
(lm/leader-keys
"w" '(:ignore t :wk "Window")
"w w" '(evil-window-next :wk "Next window")
"w h" '(evil-window-left :wk "Move cursor to window left")
"w j" '(evil-window-down :wk "Move cursor to window below")
"w k" '(evil-window-up :wk "Move cursor to window above")
"w l" '(evil-window-right :wk "Move cursor to window right")
"w s" '(evil-window-split :wk "Split window horizontally")
"w v" '(evil-window-vsplit :wk "Split window vertically")
"w H" '(evil-window-move-far-left :wk "Move split to left")
"w J" '(evil-window-move-very-bottom :wk "Move split to bottom")
"w K" '(evil-window-move-very-top :wk "Move split to top")
"w L" '(evil-window-move-far-right :wk "Move split to right")
"w >" '(evil-window-increase-width :wk "Increase window width")
"w ." '(evil-window-increase-width :wk "Increase window width")
"w <" '(evil-window-decrease-width :wk "Increase window width")
"w ," '(evil-window-decrease-width :wk "Increase window width")
"w c" '(evil-window-delete :wk "Close window")
"w o" '(delete-other-windows :wk "Delete other windows")
"w =" '(balance-windows :wk "Balance windows")
"q k" '(kill-buffer-and-window :wk "Kill buf and window")
"q q" '(save-buffers-kill-terminal :wk "Save bufs, kill term"))
;; (evil-global-set-key 'visual "K" (kbd ":m '<-2 RET gv '< gk"))
(evil-global-set-key 'visual "K" 'drag-stuff-up)
;; (evil-global-set-key 'visual "J" (kbd ":m '>+1 RET gv '> gj"))
(evil-global-set-key 'visual "J" 'drag-stuff-down)
(lm/leader-keys
"p" '(:ignore t :wk "Project")
"p o" '(dashboard-open :wk "Return to dashboard")
"p f" '(project-find-file :wk "Find project file"))
)
#+end_src
* ALL THE ICONS
#+begin_src emacs-lisp
(use-package all-the-icons
:ensure t
:diminish
:if (display-graphic-p))
(use-package all-the-icons-dired
:hook (dired-mode . (lambda () (all-the-icons-dired-mode t))))
#+end_src
* AUTOSAVE
#+begin_src emacs-lisp
(setq backup-directory-alist
`((".*" . "~/emacs/auto-saves")))
(setq auto-save-file-name-transforms
`((".*" "~/emacs/auto-saves" t)))
#+end_src
* COMPANY
#+begin_src emacs-lisp
(use-package company
:defer 2
:diminish
:custom
(company-begin-commands '(self-insert-command))
(company-idle-delay .1)
(company-minimum-prefix-length 2)
(company-show-numbers t)
(company-tooltip-align-annotations 't)
(global-company-mode t))
(use-package company-box
:after company
:diminish
:hook (company-mode . company-box-mode))
#+end_src
* DASHBOARD
#+begin_src emacs-lisp
(use-package dashboard
:ensure t
:diminish
:init
(setq initial-buffer-choice 'dashboard-open)
(setq dashboard-set-heading-icons t)
;; (setq dashboard-set-navigator t)
(setq dashboard-set-file-icons t)
(setq dashboard-banner-logo-title "Welcome to Emacs!")
(setq dashboard-startup-banner 'logo) ;; default logo
(setq dashboard-center-content t)
(setq dashboard-items '((recents . 5)
(agenda . 5)
(bookmarks . 3)
(projects . 3)))
:config
(dashboard-setup-startup-hook))
#+end_src
* DIMINISH
This package implements hiding or abbreviation of the modeline displays (lighters) of minor-modes. With this package installed, you can add ':diminish' to any use-package block to hide that particular mode in the modeline.
#+begin_src emacs-lisp
(use-package diminish)
#+end_src
* DRAG-STUFF
#+begin_src emacs-lisp
(use-package drag-stuff
:diminish
:config
(drag-stuff-global-mode 1))
#+end_src
* FLYCHECK
Install =luacheck= from your Linux distro's repositories for flycheck to work correctly with lua files. Install =python-pylint= for flycheck to work with python files. Haskell works with flycheck as long as =haskell-ghc= or =haskell-stack-ghc= is installed. For more information on language support for flycheck, [[https://www.flycheck.org/en/latest/languages.html][read this]].
#+begin_src emacs-lisp
(use-package flycheck
:ensure t
:defer t
:diminish
:init (global-flycheck-mode))
#+end_src
* FONTS
Defining the various fonts emacs will use
** Setting The Font Face
#+begin_src emacs-lisp
(set-face-attribute 'default nil
;; try switch to Source Code Pro
:font "FiraCodeNerdFontMono"
:height 110
:weight 'medium)
(set-face-attribute 'variable-pitch nil
:font "FiraCodeNerdFontMono"
:height 120
:weight 'medium)
(set-face-attribute 'fixed-pitch nil
:font "FiraCodeNerdFontMono"
:height 110
:weight 'medium)
;; Makes commented text and keywords italics.
;; This is working in emacsclient but not emacs.
;; Your font must have an italic face available.
(set-face-attribute 'font-lock-comment-face nil
:slant 'italic)
(set-face-attribute 'font-lock-keyword-face nil
:slant 'italic)
;; This sets the default font on all graphical frames created after restarting Emacs.
;; Does the same thing as 'set-face-attribute default' above, but emacsclient fonts
;; are not right unless I also add this method of setting the default font.
(add-to-list 'default-frame-alist '(font . "FiraCodeNerdFontMono-14"))
;; Uncomment the following line if line spacing needs adjusting.
;; (setq-default line-spacing 0.12)
#+end_src
** Zoom In/Out
Enable zoom in/out with C-=/- and also for C-scrl-up/down
#+begin_src emacs-lisp
(global-set-key (kbd "C-=") 'text-scale-increase)
(global-set-key (kbd "C--") 'text-scale-decrease)
(global-set-key (kbd "<C-wheel-up>") 'text-scale-increase)
(global-set-key (kbd "<C-wheel-down>") 'text-scale-decrease)
#+end_src
* GNUPLOT
#+begin_src emacs-lisp
(use-package gnuplot-mode)
;; automatically open files ending with .gp or .gnuplot in gnuplot mode
;; (setq auto-mode-alist
;; (append '(("\\.\\(gp\\|gnuplot\\)$" . gnuplot-mode)) auto-mode-alist)))
#+end_src
* IMAGE DIR-ED
#+begin_src emacs-lisp
(use-package image-dired+)
#+end_src
* INDENTING/TABS
#+begin_src emacs-lisp
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
(setq-default indent-line-function 'insert-tab)
(setq-default c-default-style "linux"
c-basic-offset 4)
;; if indent-tabs-mode is off, untabify before saving
;;(add-hook 'write-file-hooks
;; (lambda () (if (not indent-tabs-mode)
;; (untabify (point-min) (point-max)))))
#+end_src
* LIGATURES
#+begin_src emacs-lisp
;; This assumes you've installed the package via MELPA.
(use-package ligature
:config
;; Enable the "www" ligature in every possible major mode
(ligature-set-ligatures 't '("www"))
;; Enable traditional ligature support in eww-mode, if the
;; `variable-pitch' face supports it
(ligature-set-ligatures 'eww-mode '("ff" "fi" "ffi"))
;; Enable all FiraMonoNerdFont and Fira Code ligatures in programming modes
(ligature-set-ligatures 'prog-mode
'(;; == === ==== => =| =>>=>=|=>==>> ==< =/=//=// =~
;; =:= =!=
("=" (rx (+ (or ">" "<" "|" "/" "~" ":" "!" "="))))
;; ;; ;;;
(";" (rx (+ ";")))
;; && &&&
("&" (rx (+ "&")))
;; !! !!! !. !: !!. != !== !~
("!" (rx (+ (or "=" "!" "\." ":" "~"))))
;; ?? ??? ?: ?= ?.
("?" (rx (or ":" "=" "\." (+ "?"))))
;; %% %%%
("%" (rx (+ "%")))
;; |> ||> |||> ||||> |] |} || ||| |-> ||-||
;; |->>-||-<<-| |- |== ||=||
;; |==>>==<<==<=>==//==/=!==:===>
("|" (rx (+ (or ">" "<" "|" "/" ":" "!" "}" "\]"
"-" "=" ))))
;; \\ \\\ \/
("\\" (rx (or "/" (+ "\\"))))
;; ++ +++ ++++ +>
("+" (rx (or ">" (+ "+"))))
;; :: ::: :::: :> :< := :// ::=
(":" (rx (or ">" "<" "=" "//" ":=" (+ ":"))))
;; // /// //// /\ /* /> /===:===!=//===>>==>==/
("/" (rx (+ (or ">" "<" "|" "/" "\\" "\*" ":" "!"
"="))))
;; .. ... .... .= .- .? ..= ..<
("\." (rx (or "=" "-" "\?" "\.=" "\.<" (+ "\."))))
;; -- --- ---- -~ -> ->> -| -|->-->>->--<<-|
("-" (rx (+ (or ">" "<" "|" "~" "-"))))
;; *> */ *) ** *** ****
("*" (rx (or ">" "/" ")" (+ "*"))))
;; www wwww
("w" (rx (+ "w")))
;; <> <!-- <|> <: <~ <~> <~~ <+ <* <$ </ <+> <*>
;; <$> </> <| <|| <||| <|||| <- <-| <-<<-|-> <->>
;; <<-> <= <=> <<==<<==>=|=>==/==//=!==:=>
;; << <<< <<<<
("<" (rx (+ (or "\+" "\*" "\$" "<" ">" ":" "~" "!"
"-" "/" "|" "="))))
;; >: >- >>- >--|-> >>-|-> >= >== >>== >=|=:=>>
;; >> >>> >>>>
(">" (rx (+ (or ">" "<" "|" "/" ":" "=" "-"))))
;; #: #= #! #( #? #[ #{ #_ #_( ## ### #####
("#" (rx (or ":" "=" "!" "(" "\?" "\[" "{" "_(" "_"
(+ "#"))))
;; ~~ ~~~ ~= ~- ~@ ~> ~~>
("~" (rx (or ">" "=" "-" "@" "~>" (+ "~"))))
;; __ ___ ____ _|_ __|____|_
("_" (rx (+ (or "_" "|"))))
;; Fira code: 0xFF 0x12
("0" (rx (and "x" (+ (in "A-F" "a-f" "0-9")))))
;; Fira code:
"Fl" "Tl" "fi" "fj" "fl" "ft"
;; The few not covered by the regexps.
"{|" "[|" "]#" "(*" "}#" "$>" "^="))
;; Enables ligature checks globally in all buffers. You can also do it
;; per mode with `ligature-mode'.
(global-ligature-mode t))
#+end_src
* MARKDOWN MODE
#+begin_src emacs-lisp
(use-package markdown-mode
:ensure t
:mode ("README\\.md\\'" . gfm-mode)
:init (setq markdown-command "multimarkdown"))
#+end_src
* ORG DOWNLOAD
#+begin_src emacs-lisp
(use-package org-download
:after org
:defer nil
:custom
(org-download-method 'directory)
(org-download-image-dir "~/emacs/images/")
(org-download-heading-lvl 0)
(org-download-timestamp "org_%Y%m%d-%H%M%S_")
(org-image-actual-width 400)
(org-download-screenshot-method "WAYLAND_DISPLAY=wayland-1 wl-paste -t image/png > '%s'.png")
:bind
("C-M-y" . org-download-screenshot file)
:config
(require 'org-download))
#+end_src
* PULSE
Pulse highlight a line on certain actions
# #+begin_src emacs-lisp
# (use-package pulse
# :ensure nil
# :defer
# :init
# (defun pulse-line (&rest _)
# "Pulse the current line"
# (pulse-momentary-highlight-one-line (point)))
# (dolist (command '(scroll-up-command
# scroll-down-command
# windmove-left
# windmove-right
# windmove-up
# windmove-down
# move-to-window-line-top-bottom
# recenter-top-bottom
# other-window))
# (advice-add command :after #'pulse-line)))
# #+end_src
* PDF TOOLS
#+begin_src emacs-lisp
(use-package pdf-tools)
#+end_src
* PROJECTILE
[[https://github.com/bbatsov/projectile][Projectile]] is a project interaction library for Emacs.
#+begin_src emacs-lisp
(use-package projectile
:diminish
:config
(projectile-mode 1))
#+end_src
* RAINBOW MODE
Display the actual color as a background for any hex color value (ex. #ffffff). The code block below enables rainbow-mode in all programming modes (prog-mode) as well as org-mode, which is why rainbow works in this document.
#+begin_src emacs-lisp
(use-package rainbow-mode
:diminish
:hook
((org-mode prog-mode) . rainbow-mode))
#+end_src
* RELOAD EMACS
This is just an example of how to create a simple function in Emacs. Use this function to reload Emacs after adding changes to the config. Yes, I am loading the user-init-file twice in this function, which is a hack because for some reason, just loading the user-init-file once does not work properly.
#+begin_src emacs-lisp
(defun reload-init-file ()
(interactive)
(load-file user-init-file)
(load-file user-init-file))
#+end_src
* SHELLS AND TERMINALS
** Eshell
#+begin_src emacs-lisp
(use-package eshell-syntax-highlighting
:after esh-mode
:config
(eshell-syntax-highlighting-global-mode +1))
(setq eshell-rc-script (concat user-emacs-directory "eshell/profile")
eshell-aliases-file (concat user-emacs-directory "eshell/aliases")
eshell-history-size 5000
eshell-buffer-maximum-lines 5000
eshell-hist-ignoredups t
eshell-scroll-to-bottom-on-input t
eshell-destroy-buffer-when-process-dies t
eshell-visual-commands'("bash" "fish" "htop" "ssh" "top" "zsh"))
#+end_src
** Vterm
Vterm is a terminal emulator within Emacs. The 'shell-file-name' setting sets the shell to be used in M-x shell, M-x term, M-x ansi-term and M-x vterm. By default, the shell is set to 'fish' but could change it to 'bash' or 'zsh' if you prefer.
#+begin_src emacs-lisp
(use-package vterm
:config
(setq shell-file-name "/run/current-system/sw/bin/bash"
vterm-max-scrollback 5000))
#+end_src
* SUDO EDIT
Enable editing of privileged files
#+begin_src emacs-lisp
(use-package sudo-edit
:config
(lm/leader-keys
"fu" '(sudo-edit-find-file :wk "Sudo find file")
"fU" '(sudo-edit :wk "Sudo edit file")))
#+end_src
* THEME
Set themes dir, load chosen theme - theme made with [[https://emacsfodder.github.io/emacs-theme-editor/][Emacs Theme Editor]].
#+begin_src emacs-lisp
;;(add-to-list 'custom-theme-load-path "~/.config/emacs/themes")
;;(load-theme 'soft-charcoal t)
(use-package doom-themes
:ensure t
:config
;; Global settings (defaults)
(setq doom-themes-enable-bold t ; if nil, bold is universally disabled
doom-themes-enable-italic t) ; if nil, italics is universally disabled
(load-theme 'doom-monokai-spectrum t)
;; (load-theme 'doom-monokai-machine t)
;; Enable flashing mode-line on errors
(doom-themes-visual-bell-config)
;; Enable custom neotree theme (all-the-icons must be installed!)
(doom-themes-neotree-config)
;; or for treemacs users
(setq doom-themes-treemacs-theme "doom-colors") ; use "doom-colors" for less minimal icon theme
(doom-themes-treemacs-config)
;; Corrects (and improves) org-mode's native fontification.
(doom-themes-org-config))
#+end_src
* TRANSPARENCY
True transparency support as of emacs 29
#+begin_src emacs-lisp
(add-to-list 'default-frame-alist '(alpha-background . 90)) ;; for all new frames
#+end_src
* GUI TWEAKS
Making the UI look nicer
** Disable Menubar, Toolbars and Scrollbars
#+begin_src emacs-lisp
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
#+end_src
** Display Line Numbers and Truncated Lines
#+begin_src emacs-lisp
(global-display-line-numbers-mode 0)
(menu-bar--display-line-numbers-mode-relative)
;; (setq display-line-numbers-mode-relative 't)
(global-visual-line-mode t)
#+end_src
* IVY (COUNSEL)
+ Ivy, a generic completion mechanism for Emacs.
+ Counsel, a collection of Ivy-enhanced versions of common Emacs commands.
+ Ivy-rich allows us to add descriptions alongside the commands in M-x.
#+begin_src emacs-lisp
(use-package counsel
:after ivy
:diminish
:config (counsel-mode))
(use-package ivy
:bind
;; ivy-resume resumes the last Ivy-based completion.
(("C-c C-r" . ivy-resume)
("C-x B" . ivy-switch-buffer-other-window))
:diminish
:custom
(setq ivy-use-virtual-buffers t)
(setq ivy-count-format "(%d/%d) ")
(setq enable-recursive-minibuffers t)
:config
(ivy-mode))
(use-package all-the-icons-ivy-rich
:ensure t
:diminish
:init (all-the-icons-ivy-rich-mode 1))
(use-package ivy-rich
:after ivy
:diminish
:ensure t
:init (ivy-rich-mode 1) ;; this gets us descriptions in M-x.
:custom
(ivy-virtual-abbreviate 'full
ivy-rich-switch-buffer-align-virtual-buffer t
ivy-rich-path-style 'abbrev)
:config
(ivy-set-display-transformer 'ivy-switch-buffer
'ivy-rich-switch-buffer-transformer))
#+end_src
* LANGUAGE SUPPORT
Emacs has built-in programming language modes for Lisp, Scheme, DSSSL, Ada, ASM, AWK, C, C++, Fortran, Icon, IDL (CORBA), IDLWAVE, Java, Javascript, M4, Makefiles, Metafont, Modula2, Object Pascal, Objective-C, Octave, Pascal, Perl, Pike, PostScript, Prolog, Python, Ruby, Simula, SQL, Tcl, Verilog, and VHDL. Other languages will require you to install additional modes.
#+begin_src emacs-lisp
(use-package zig-mode)
(use-package nix-mode)
;; (use-package jai-mode)
(use-package rust-mode)
(use-package cargo-mode)
(use-package lua-mode)
(add-to-list 'load-path "~/.config/emacs/manual-packages")
(require 'odin-mode)
#+end_src
* ORG MODE
** Enabling Table of Contents
#+begin_src emacs-lisp
(use-package toc-org
:commands toc-org-enable
:init (add-hook 'org-mode-hook 'toc-org-enable))
#+end_src
** Enabling Org Bullets
Org-bullets give bullet points instead of asterisks
#+begin_src emacs-lisp
(add-hook 'org-mode-hook 'org-indent-mode)
;;(setq (setq org-return-follows-link t)
(use-package org-bullets)
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
#+end_src
** Source Code Block Tag Expansion
Org-tempo is not a separate package but a module within org that can be enabled. Org-tempo allows for '<s' followed by TAB to expand to a begin_src tag. Other expansions available include:
| Typing the below + TAB | Expands to ... |
|------------------------+-----------------------------------------|
| <a | '#+BEGIN_EXPORT ascii' … '#+END_EXPORT |
| <c | '#+BEGIN_CENTER' … '#+END_CENTER' |
| <C | '#+BEGIN_COMMENT' … '#+END_COMMENT' |
| <e | '#+BEGIN_EXAMPLE' … '#+END_EXAMPLE' |
| <E | '#+BEGIN_EXPORT' … '#+END_EXPORT' |
| <h | '#+BEGIN_EXPORT html' … '#+END_EXPORT' |
| <l | '#+BEGIN_EXPORT latex' … '#+END_EXPORT' |
| <q | '#+BEGIN_QUOTE' … '#+END_QUOTE' |
| <s | '#+BEGIN_SRC' … '#+END_SRC' |
| <v | '#+BEGIN_VERSE' … '#+END_VERSE' |
#+begin_src emacs-lisp
(require 'org-tempo)
#+end_src
* WHICH-KEY
#+begin_src emacs-lisp
(use-package which-key
:init
(which-key-mode 1)
:diminish
:config
(setq which-key-side-window-location 'bottom
which-key-sort-order #'which-key-key-order-alpha
which-key-sort-uppercase-first nil
which-key-add-column-padding 1
which-key-max-display-columns nil
which-key-min-display-lines 6
which-key-side-window-slot -10
which-key-side-window-max-height 0.25
which-key-ide-delay 0.8
which-key-max-description-length 25
which-key-allow-imprecise-window-fit nil
which-key-separator " -> " ))
#+end_src
File diff suppressed because it is too large Load Diff
+447
View File
@@ -0,0 +1,447 @@
;;; doom-themes.el --- an opinionated pack of modern color-themes -*- lexical-binding: t; -*-
;;
;; Copyright (C) 2016-2022 Henrik Lissner
;;
;; Author: Henrik Lissner <contact@henrik.io>
;; Maintainer: Henrik Lissner <contact@henrik.io>
;; Maintainer: Emmanuel Bustos Torres <ema2159@gmail.com>
;; Created: May 22, 2016
;; Version: 2.3.0
;; Keywords: themes faces
;; Homepage: https://github.com/doomemacs/themes
;; Package-Requires: ((emacs "25.1") (cl-lib "0.5"))
;;
;; This file is not part of GNU Emacs.
;;
;;; Commentary:
;;
;; doomemacs/themes is an megapack of popular themes, including aesthetic
;; extensions for popular packages.
;;
;; Themes in this pack:
;; - doom-1337 -- ported from VSCode's 1337 theme (ported by @ccmywish)
;; - doom-acario-dark -- an original dark theme (ported by @gagbo)
;; - doom-acario-light -- an original light theme (ported by @gagbo)
;; - doom-ayu-dark -- inspired by Ayu Dark (ported by @ashton)
;; - doom-ayu-light -- inspirted by Ayu Light (ported by @LoveSponge)
;; - doom-ayu-mirage -- inspired by Ayu Mirage (ported by @LoveSponge)
;; - doom-badger -- inspired by cann's Badger colorscheme (ported by @jsoa)
;; - doom-challenger-deep -- inspired by Vim's Challenger Deep theme (ported by @fuxialexander)
;; - doom-city-lights -- inspired by Atom's City Lights theme (ported by @fuxialexander)
;; - doom-dark+ -- ported from equinusocio's VSCode Theme, dark+ (ported by @ema2159)
;; - doom-dracula -- inspired by the popular Dracula theme (ported by @fuxialexander)
;; - doom-earl-grey -- a gentle color scheme, for code (ported by @JuneKelly)
;; - doom-ephemeral -- inspired by the Ephemeral Theme from elenapan's dotfiles (ported by @karetsu)
;; - doom-fairy-floss -- a candy colored theme by sailorhg (ported by @ema2159)
;; - doom-feather-dark -- a purple-tinted theme, inspired by doom-one (by @Plunne)
;; - doom-feather-light -- a light variable of feather-dark, inspired by doom-one (by @Plunne)
;; - doom-flatwhite -- inspired by Atom's Flatwhite Syntax theme (ported by @JuneKelly)
;; - doom-gruvbox -- inspired by morhetz's Gruvbox (ported by @JongW)
;; - doom-gruvbox-light -- inspired by morhetz's Gruvbox (light) (ported by @jsoa)
;; - doom-henna -- based on VSCode's Henna theme (ported by @jsoa)
;; - doom-homage-black -- a minimalistic, colorless theme inspired by eziam, tao, and jbeans (ported by @mskorzhinskiy)
;; - doom-homage-white -- minimal white theme inspired by editors from 2000s (ported by @mskorzhinskiy)
;; - doom-horizon -- ported from VSCode Horizon (ported by @karetsu)
;; - doom-Iosvkem -- ported from the default dark theme for Adobe Brackets (ported by @neutaaaaan)
;; - doom-ir-black -- ported from Vim's ir_black colorscheme (ported by @legendre6891)
;; - doom-lantern -- based on Gitleptune's Lantern theme (ported by @paladhammika)
;; - doom-laserwave -- a clean synthwave/outrun theme inspired by VSCode's Laserwave (ported by @hyakt)
;; - doom-manegarm -- an original autumn-inspired dark theme (ported by @kenranunderscore)
;; - doom-material -- adapted from equinusocio's Material themes (ported by @tam5)
;; - doom-material-dark -- inspired by Material Theme by xrei (ported by @trev-dev)
;; - doom-meltbus -- a dark (mostly) monochromatic theme (ported by @spacefrogg)
;; - doom-miramare -- a port of Franbach's Miramare theme; a variant of Grubox (ported by @sagittaros)
;; - doom-molokai -- inspired by Tomas Restrepo's Molokai (ported by @hlissner)
;; - doom-monokai-classic -- port of Monokai Classic (ported by @ema2159)
;; - doom-monokai-machine -- port of Monokai Classic (ported by @minikN)
;; - doom-monokai-octagon -- port of Monokai Octagon (ported by @minikN)
;; - doom-monokai-pro -- Port of Monokai Pro (ported by @minikN)
;; - doom-monokai-ristretto -- Port of Monokai Ristretto (ported by @minikN)
;; - doom-monokai-spectrum -- port of Monokai Spectrum (ported by @minikN)
;; - doom-moonlight -- inspired by VS code's Moonlight (ported by @Brettm12345)
;; - doom-nord -- dark variant of Nord (ported by @fuxialexander)
;; - doom-nord-aurora -- a light variant of Nord (ported by @MoskitoHero)
;; - doom-nord-light -- light variant of Nord (ported by @fuxialexander)
;; - doom-nova -- inspired by Trevord Miller's Nova (ported by @bigardone)
;; - doom-oceanic-next -- inspired by Oceanic Next (ported by @juanwolf)
;; - doom-oksolar-dark -- an OKLab variant of Solarized dark (ported by @logc)
;; - doom-oksolar-light -- an OKLab variant of Solarized light (ported by @logc)
;; - doom-old-hope -- inspired by An Old Hope, in a galaxy far far away (ported by @teesloane)
;; - doom-one -- inspired by Atom One Dark (ported by @hlissner)
;; - doom-one-light -- inspired by Atom One Light (ported by @ztlevi)
;; - doom-opera -- an original light theme (ported by @jwintz)
;; - doom-opera-light -- an original light theme (ported by @jwintz)
;; - doom-outrun-electric -- a high contrast, neon theme inspired by Outrun Electric on VSCode (ported by @ema2159)
;; - doom-palenight -- adapted from equinusocio's Material themes (ported by @Brettm12345)
;; - doom-peacock -- inspired by daylerees' Peacock (ported by @teesloane)
;; - doom-pine -- a green flavor of doom-gruvbox (by @RomanHargrave)
;; - doom-plain -- inspired by gko's plain theme for VSCode (ported by @das-s)
;; - doom-plain-dark -- inspired by gko's plain theme for VSCode (ported by @das-s)
;; - doom-rouge -- ported from VSCode's Rouge Theme (ported by @das-s)
;; - doom-shades-of-purple -- a port of VSCode's Shades of Purple (ported by @jwbaldwin)
;; - doom-snazzy -- inspired by Hyper Snazzy (ported by @ar1a)
;; - doom-solarized-dark -- a dark variant of Solarized (ported by @ema2159)
;; - doom-solarized-dark-high-contrast -- a high-contrast variant of Solarized Dark (ported by @jmorag)
;; - doom-solarized-light -- a light variant of Solarized (ported by @fuxialexander)
;; - doom-sourcerer -- a port of xero's Sourcerer (ported by @fm0xb)
;; - doom-spacegrey -- I'm sure you've heard of it (ported by @teesloane)
;; - doom-tokyo-night -- inspired by VSCode's Tokyo Night theme (ported by @FosterHangdaan)
;; - doom-tomorrow-day -- a light variant of Tomorrow (ported by @emacswatcher)
;; - doom-tomorrow-night -- One of the dark variants of Tomorrow (ported by @hlissner)
;; - doom-vibrant -- a more vibrant variant of doom-one (ported by @hlissner)
;; - doom-wilmersdorf -- port of Ian Pan's Wilmersdorf (ported by @ema2159)
;; - doom-xcode -- based off of Apple's Xcode Dark Theme (ported by @kadenbarlow)
;; - doom-zenburn -- port of the popular Zenburn theme (ported by @jsoa)
;;
;; ## Install
;;
;; `M-x package-install RET doom-themes`
;;
;; A comprehensive configuration example:
;;
;; (require 'doom-themes)
;;
;; ;; Global settings (defaults)
;; (setq doom-themes-enable-bold t ; if nil, bold is universally disabled
;; doom-themes-enable-italic t) ; if nil, italics is universally disabled
;;
;; ;; Load the theme (doom-one, doom-molokai, etc); keep in mind that each
;; ;; theme may have their own settings.
;; (load-theme 'doom-one t)
;;
;; ;; Enable flashing mode-line on errors
;; (doom-themes-visual-bell-config)
;;
;; ;; Enable custom neotree theme
;; (doom-themes-neotree-config) ; all-the-icons fonts must be installed!
;;
;;; Code:
(require 'cl-lib)
(require 'doom-themes-base)
(defgroup doom-themes nil
"Options for doom-themes."
:group 'faces)
(defcustom doom-themes-padded-modeline nil
"Default value for padded-modeline setting for themes that support it."
:group 'doom-themes
:type '(choice integer boolean))
;;
(defcustom doom-themes-enable-bold t
"If nil, bold will be disabled across all faces."
:group 'doom-themes
:type 'boolean)
(defcustom doom-themes-enable-italic t
"If nil, italics will be disabled across all faces."
:group 'doom-themes
:type 'boolean)
;;
;;; API
(defvar doom-themes--colors nil)
(defvar doom--min-colors '(257 256 16))
(defvar doom--quoted-p nil)
(defvar doom-themes--faces nil)
(defun doom-themes--colors-p (item)
(declare (pure t) (side-effect-free t))
(when item
(cond ((listp item)
(let ((car (car item)))
(cond ((memq car '(quote doom-color)) nil)
((memq car '(backquote \`))
(let ((doom--quoted-p t))
(doom-themes--colors-p (cdr item))))
((eq car '\,)
(let (doom--quoted-p)
(doom-themes--colors-p (cdr item))))
((or (doom-themes--colors-p car)
(doom-themes--colors-p (cdr-safe item)))))))
((and (symbolp item)
(not (keywordp item))
(not doom--quoted-p)
(not (equal (substring (symbol-name item) 0 1) "-"))
(assq item doom-themes--colors))))))
(defun doom-themes--apply-faces (new-faces &optional default-faces)
(declare (pure t) (side-effect-free t))
(let ((default-faces (or default-faces doom-themes-base-faces))
(faces (make-hash-table :test #'eq :size (+ (length default-faces) (length new-faces))))
(directives (make-hash-table :test #'eq)))
(dolist (spec (append (mapcar #'copy-sequence default-faces) new-faces))
(if (listp (car spec))
(cl-destructuring-bind (face action &optional arg) (car spec)
(unless (assq face new-faces)
(puthash face (list action arg (cdr spec))
directives)))
(puthash (car spec) (cdr spec) faces)))
(cl-loop for face being the hash-keys of directives
for (action target spec) = (gethash face directives)
unless (memq action '(&inherit &extend &override))
do (error "Invalid operation (%s) for '%s' face" action face)
if (eq (car spec) 'quote)
do (error "Can't extend literal face spec (for '%s')" face)
;; TODO Add &all/&light/&dark extension support
else if (memq (car spec) '(&all &light &dark))
do (error "Can't extend face with &all, &light or &dark specs (for '%s')" face)
else do
(puthash face
(let ((old-spec (gethash (or target face) faces))
(plist spec))
;; remove duplicates
(while (keywordp (car plist))
(setq old-spec (plist-put old-spec (car plist) (cadr plist))
plist (cddr plist)))
old-spec)
faces))
(let (results)
(maphash (lambda (face plist)
(when (keywordp (car plist))
;; TODO Clean up duplicates in &all/&light/&dark blocks
(dolist (prop (append (unless doom-themes-enable-bold '(:weight normal :bold unspecified))
(unless doom-themes-enable-italic '(:slant normal :italic unspecified))))
(when (and (plist-member plist prop)
(not (eq (plist-get plist prop) 'inherit)))
(plist-put plist prop
(if (memq prop '(:weight :slant))
(quote 'normal))))))
(push (cons face plist) results))
faces)
(nreverse results))))
(defun doom-themes--colorize (item type)
(declare (pure t) (side-effect-free t))
(when item
(let ((doom--quoted-p doom--quoted-p))
(cond ((listp item)
(cond ((memq (car item) '(quote doom-color))
item)
((eq (car item) 'doom-ref)
(doom-themes--colorize
(apply #'doom-ref (cdr item)) type))
((let* ((item (append item nil))
(car (car item))
(doom--quoted-p
(cond ((memq car '(backquote \`)) t)
((eq car '\,) nil)
(t doom--quoted-p))))
(cons car
(cl-loop
for i in (cdr item)
collect (doom-themes--colorize i type)))))))
((and (symbolp item)
(not (keywordp item))
(not doom--quoted-p)
(not (equal (substring (symbol-name item) 0 1) "-"))
(assq item doom-themes--colors))
`(doom-color ',item ',type))
(item)))))
(defun doom-themes--build-face (face)
(declare (pure t) (side-effect-free t))
`(list
',(car face)
,(let ((face-body (cdr face)))
(cond ((keywordp (car face-body))
(let ((real-attrs face-body)
defs)
(if (doom-themes--colors-p real-attrs)
(dolist (cl doom--min-colors `(list ,@(nreverse defs)))
(push `(list '((class color) (min-colors ,cl))
(list ,@(doom-themes--colorize real-attrs cl)))
defs))
`(list (list 't (list ,@real-attrs))))))
((memq (car-safe (car face-body)) '(quote backquote \`))
(car face-body))
((let (all-attrs defs)
(dolist (attrs face-body `(list ,@(nreverse defs)))
(cond ((eq (car attrs) '&all)
(setq all-attrs (append all-attrs (cdr attrs))))
((memq (car attrs) '(&dark &light))
(let ((bg (if (eq (car attrs) '&dark) 'dark 'light))
(real-attrs (append all-attrs (cdr attrs) '())))
(cond ((doom-themes--colors-p real-attrs)
(dolist (cl doom--min-colors)
(push `(list '((class color) (min-colors ,cl) (background ,bg))
(list ,@(doom-themes--colorize real-attrs cl)))
defs)))
((push `(list '((background ,bg)) (list ,@real-attrs))
defs)))))))))))))
;;
;;; Color helper functions
;; Shamelessly *borrowed* from solarized
;;;###autoload
(defun doom-name-to-rgb (color)
"Retrieves the hexidecimal string repesented the named COLOR (e.g. \"red\")
for FRAME (defaults to the current frame)."
(cl-loop with div = (float (car (tty-color-standard-values "#ffffff")))
for x in (tty-color-standard-values (downcase color))
collect (/ x div)))
;;;###autoload
(defun doom-blend (color1 color2 alpha)
"Blend two colors (hexidecimal strings) together by a coefficient ALPHA (a
float between 0 and 1)"
(when (and color1 color2)
(cond ((and color1 color2 (symbolp color1) (symbolp color2))
(doom-blend (doom-color color1) (doom-color color2) alpha))
((or (listp color1) (listp color2))
(cl-loop for x in color1
when (if (listp color2) (pop color2) color2)
collect (doom-blend x it alpha)))
((and (string-prefix-p "#" color1) (string-prefix-p "#" color2))
(apply (lambda (r g b) (format "#%02x%02x%02x" (* r 255) (* g 255) (* b 255)))
(cl-loop for it in (doom-name-to-rgb color1)
for other in (doom-name-to-rgb color2)
collect (+ (* alpha it) (* other (- 1 alpha))))))
(color1))))
;;;###autoload
(defun doom-darken (color alpha)
"Darken a COLOR (a hexidecimal string) by a coefficient ALPHA (a float between
0 and 1)."
(cond ((and color (symbolp color))
(doom-darken (doom-color color) alpha))
((listp color)
(cl-loop for c in color collect (doom-darken c alpha)))
((doom-blend color "#000000" (- 1 alpha)))))
;;;###autoload
(defun doom-lighten (color alpha)
"Brighten a COLOR (a hexidecimal string) by a coefficient ALPHA (a float
between 0 and 1)."
(cond ((and color (symbolp color))
(doom-lighten (doom-color color) alpha))
((listp color)
(cl-loop for c in color collect (doom-lighten c alpha)))
((doom-blend color "#FFFFFF" (- 1 alpha)))))
;;;###autoload
(defun doom-color (name &optional type)
"Retrieve a specific color named NAME (a symbol) from the current theme."
(let ((colors (if (listp name)
name
(cdr-safe (assq name doom-themes--colors)))))
(and colors
(cond ((listp colors)
(let ((i (or (plist-get '(256 1 16 2 8 3) type) 0)))
(if (> i (1- (length colors)))
(car (last colors))
(nth i colors))))
(t colors)))))
;;;###autoload
(defun doom-ref (face prop &optional class)
"TODO"
(let ((spec (or (cdr (assq face doom-themes--faces))
(error "Couldn't find the '%s' face" face))))
(when (memq (car spec) '(quote backquote \`))
(user-error "Can't fetch the literal spec for '%s'" face))
(when class
(setq spec (cdr (assq class spec)))
(unless spec
(error "Couldn't find the '%s' class in the '%s' face"
class face)))
(unless (plist-member spec prop)
(error "Couldn't find the '%s' property in the '%s' face%s"
prop face (if class (format "'s '%s' class" class) "")))
(plist-get spec prop)))
;;
;;; Defining themes
(defun doom-themes-prepare-facelist (custom-faces)
"Return an alist of face definitions for `custom-theme-set-faces'.
Faces in EXTRA-FACES override the default faces."
(declare (pure t) (side-effect-free t))
(setq doom-themes--faces (doom-themes--apply-faces custom-faces))
(mapcar #'doom-themes--build-face doom-themes--faces))
(defun doom-themes-prepare-varlist (vars)
"Return an alist of variable definitions for `custom-theme-set-variables'.
Variables in EXTRA-VARS override the default ones."
(declare (pure t) (side-effect-free t))
(cl-loop for (var val) in (append doom-themes-base-vars vars)
collect `(list ',var ,val)))
;;;###autoload
(defun doom-themes-set-faces (theme &rest faces)
"Customize THEME (a symbol) with FACES.
If THEME is nil, it applies to all themes you load. FACES is a list of Doom
theme face specs. These is a simplified spec. For example:
(doom-themes-set-faces \\='user
\\='(default :background red :foreground blue)
\\='(doom-modeline-bar :background (if -modeline-bright modeline-bg highlight))
\\='(doom-modeline-buffer-file :inherit \\='mode-line-buffer-id :weight \\='bold)
\\='(doom-modeline-buffer-path :inherit \\='mode-line-emphasis :weight \\='bold)
\\='(doom-modeline-buffer-project-root :foreground green :weight \\='bold))"
(declare (indent defun))
(apply #'custom-theme-set-faces
(or theme 'user)
(eval
`(let* ((bold ,doom-themes-enable-bold)
(italic ,doom-themes-enable-italic)
,@(cl-loop for (var . val) in doom-themes--colors
collect `(,var ',val)))
(list ,@(mapcar #'doom-themes--build-face faces))))))
(defmacro def-doom-theme (name docstring defs &optional extra-faces extra-vars)
"Define a DOOM theme, named NAME (a symbol)."
(declare (doc-string 2))
(let ((doom-themes--colors defs))
`(let* ((bold doom-themes-enable-bold)
(italic doom-themes-enable-italic)
,@defs)
(setq doom-themes--colors
(list ,@(cl-loop for (var val) in defs
collect `(cons ',var ,val))))
(deftheme ,name ,docstring)
(custom-theme-set-faces
',name ,@(doom-themes-prepare-facelist extra-faces))
(custom-theme-set-variables
',name ,@(doom-themes-prepare-varlist extra-vars))
(unless bold (set-face-bold 'bold 'unspecified))
(unless italic (set-face-italic 'italic 'unspecified))
(provide-theme ',name))))
;;;###autoload
(when (and (boundp 'custom-theme-load-path) load-file-name)
(let* ((base (file-name-directory load-file-name))
(dir (expand-file-name "themes/" base)))
(add-to-list 'custom-theme-load-path
(or (and (file-directory-p dir) dir)
base))))
(provide 'doom-themes)
;;; doom-themes.el ends here
+1
View File
@@ -0,0 +1 @@
(setq package-enable-at-startup nil)
Binary file not shown.
Binary file not shown.
+20
View File
@@ -0,0 +1,20 @@
# Aliases for emacs commands
alias ff find-file $1
# Aliasing standard shell commands to emacs alternatives
alias less view-file $1
# Changing "ls" to "exa"
alias ls exa -al --color=always --group-directories-first $* # my preferred listing
alias la exa -a --color=always --group-directories-first $* # all files and dirs
alias ll exa -l --color=always --group-directories-first $* # long format
alias lt exa -aT --color=always --group-directories-first $* # tree listing
alias l. exa -a1 $* | grep "^\." # list hidden files
# Merge Xresources
alias merge xrdb -merge ~/.Xresources
# Confirm before overwriting something
alias cp cp -i $1
alias mv mv -i $1
alias rm rm -i $1
+1
View File
@@ -0,0 +1 @@
ls
View File
+6
View File
@@ -0,0 +1,6 @@
(org-babel-load-file
(expand-file-name
"config.org"
user-emacs-directory))
(put 'upcase-region 'disabled nil)
(put 'downcase-region 'disabled nil)
+191
View File
@@ -0,0 +1,191 @@
;;; odin-mode.el --- A major mode for Odin -*- lexical-binding: t; -*-
;; Copyright (C) 2023 Graham Marlow
;; Author: Graham Marlow
;; Keywords: languages
;; Url: https://git.sr.ht/~mgmarlow/odin-mode
;; Version: 0.1.0
;; Package-Requires: ((emacs "28.1"))
;; 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:
;; A major mode for the Odin programming language.
;;; Code:
(require 'js) ; For indentation
(require 'project) ; For build/compile commands
(defgroup odin nil
"Major mode for the Odin programming language."
:link '(url-link "https://odin-lang.org")
:group 'languages)
(defconst odin-keywords
'("import" "foreign" "package"
"where" "when" "if" "else" "for" "switch" "in" "do" "case"
"break" "continue" "fallthrough" "defer" "return" "proc"
"struct" "union" "enum" "bit_field" "bit_set" "map" "dynamic"
"auto_cast" "cast" "transmute" "distinct" "opaque"
"using" "inline" "no_inline"
"size_of" "align_of" "offset_of" "type_of"
"context"))
(defconst odin-builtins
'("len" "cap"
"typeid_of" "type_info_of"
"swizzle" "complex" "real" "imag" "quaternion" "conj"
"jmag" "kmag"
"min" "max" "abs" "clamp"
"expand_to_tuple"
"init_global_temporary_allocator"
"copy" "pop" "unordered_remove" "ordered_remove" "clear" "reserve"
"resize" "new" "new_clone" "free" "free_all" "delete" "make"
"clear_map" "reserve_map" "delete_key" "append_elem" "append_elems"
"append" "append_string" "clear_dynamic_array" "reserve_dynamic_array"
"resize_dynamic_array" "incl_elem" "incl_elems" "incl_bit_set"
"excl_elem" "excl_elems" "excl_bit_set" "incl" "excl" "card"
"assert" "panic" "unimplemented" "unreachable"))
(defconst odin-constants
'("nil" "true" "false"))
(defconst odin-typenames
'("bool" "b8" "b16" "b32" "b64"
"int" "i8" "i16" "i32" "i64"
"i16le" "i32le" "i64le"
"i16be" "i32be" "i64be"
"i128" "u128"
"i128le" "u128le"
"i128be" "u128be"
"uint" "u8" "u16" "u32" "u64"
"u16le" "u32le" "u64le"
"u16be" "u32be" "u64be"
"f32" "f64"
"complex64" "complex128"
"quaternion128" "quaternion256"
"rune"
"string" "cstring"
"uintptr" "rawptr"
"typeid" "any"
"byte"))
(defvar odin-mode-syntax-table
(let ((table (make-syntax-table)))
;; Operators
(dolist (i '(?: ?+ ?- ?* ?= ?< ?> ?& ?| ?^ ?! ??))
(modify-syntax-entry i "." table))
;; Strings
(modify-syntax-entry ?\" "\"" table)
(modify-syntax-entry ?\\ "\\" table)
;; Comments
(modify-syntax-entry ?/ ". 124b" table)
(modify-syntax-entry ?* ". 23n" table)
(modify-syntax-entry ?\n "> b" table)
(modify-syntax-entry ?\^m "> b" table)
table))
(defvar odin-font-lock-keywords
`(
;; Keywords
(,(regexp-opt odin-keywords 'symbols) . font-lock-keyword-face)
;; Types
(,(regexp-opt odin-typenames 'symbols) . font-lock-type-face)
;; Attributes
("^ *@[a-zA-Z]+" . font-lock-preprocessor-face)
;; Builtins
(,(regexp-opt odin-builtins 'symbols) . font-lock-builtin-face)
;; Constants
(,(regexp-opt odin-constants 'symbols) . font-lock-constant-face)))
;;;###autoload
(define-derived-mode odin-mode
prog-mode "Odin"
"Major mode for the Odin programming language."
:group 'odin
:syntax-table odin-mode-syntax-table
(setq-local font-lock-defaults
'(odin-font-lock-keywords))
(setq-local parse-sexp-ignore-comments t)
(setq-local comment-start-skip "\\(//+\\|/\\*+\\)\\s *")
(setq-local comment-start "/*")
(setq-local comment-end "*/")
(setq-local indent-line-function #'js-indent-line)
(setq-local electric-indent-chars
(append "{}():;," electric-indent-chars)))
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.odin\\'" . odin-mode))
(defcustom odin-bin "odin"
"Path to odin executable."
:type 'string
:group 'odin-mode)
(defun odin--project-cmd (format-string)
"Execute odin on current project.
FORMAT-STRING is the command passed to the odin binary. The
current project directory is always passed as the first argument."
(unless (project-current)
(error "No project found"))
(let ((default-directory (project-root (project-current))))
(compile (apply #'format
(concat "%s " format-string " %s")
(list odin-bin default-directory)))))
(defun odin-build-project ()
"Build curent project using `odin build`."
(interactive)
(odin--project-cmd "build"))
(defun odin-run-project ()
"Run current project using `odin run`."
(interactive)
(odin--project-cmd "run"))
(defun odin-check-project ()
"Check current project using `odin check`."
(interactive)
(odin--project-cmd "check"))
(defun odin-test-project ()
"Run procedures marked by the attribute @(test) using `odin test`."
(interactive)
(odin--project-cmd "test"))
(provide 'odin-mode)
;;; odin-mode.el ends here
@@ -0,0 +1,147 @@
;;; doom-palenight-theme.el --- adapted from equinusocio's Material themes -*- lexical-binding: t; no-byte-compile: t; -*-
;;
;; Added: August 8, 2019 (7c7e871f2221)
;; Author: Brettm12345 <https://github.com/Brettm12345>
;; Maintainer:
;; Source: https://github.com/equinusocio/vsc-material-theme
;;
;;; Commentary:
;;; Code:
(require 'doom-themes)
;;
;;; Variables
(defgroup doom-palenight-theme nil
"Options for the `doom-palenight' theme."
:group 'doom-themes)
(defcustom doom-palenight-padded-modeline doom-themes-padded-modeline
"If non-nil, adds a 4px padding to the mode-line.
Can be an integer to determine the exact padding."
:group 'doom-palenight-theme
:type '(choice integer boolean))
;;
;;; Theme definition
(def-doom-theme doom-palenight
"A dark theme inspired by Material-Palenight"
;; name default 256 16
((bg '("#292D3E" nil nil))
(bg-alt '("#242837" nil nil))
(base0 '("#1c1f2b" "black" "black"))
(base1 '("#1e212e" "#262626" "brightblack"))
(base2 '("#232635" "#303030" "brightblack"))
(base3 '("#3C435E" "#3a3a3a" "brightblack"))
(base4 '("#4E5579" "#444444" "brightblack"))
(base5 '("#676E95" "#585858" "brightblack"))
(base6 '("#697098" "#626262" "brightblack"))
(base7 '("#717CB4" "#767676" "brightblack"))
(base8 '("#A6Accd" "#a8a8a8" "white"))
(fg '("#EEFFFF" "#e4e4e4" "brightwhite"))
(fg-alt '("#BFC7D5" "#bcbcbc" "white"))
(grey base5)
(red '("#ff5370" "#ff0000" "red"))
(orange '("#f78c6c" "#ff5f00" "brightred"))
(green '("#c3e88d" "#afff00" "green"))
(teal '("#44b9b1" "#00d7af" "brightgreen"))
(yellow '("#ffcb6b" "#ffd700" "brightyellow"))
(blue '("#82aaff" "#5fafff" "brightblue"))
(dark-blue '("#7986E7" "#d7ffff" "blue"))
(magenta '("#c792ea" "#d787d7" "brightmagenta"))
(violet '("#bb80b3" "#d787af" "magenta"))
(cyan '("#89DDFF" "#5fd7ff" "brightcyan"))
(dark-cyan '("#80cbc4" "#00d7af" "cyan"))
;; face categories -- required for all themes
(highlight magenta)
(vertical-bar base2)
(selection base4)
(builtin blue)
(comments base5)
(doc-comments (doom-lighten base5 0.25))
(constants orange)
(functions blue)
(keywords cyan)
(methods blue)
(operators cyan)
(type magenta)
(strings green)
(variables yellow)
(numbers orange)
(region base3)
(error red)
(warning yellow)
(success green)
(vc-modified blue)
(vc-added green)
(vc-deleted red)
;; custom categories
(modeline-bg base2)
(modeline-bg-alt (doom-darken bg 0.01))
(modeline-fg base8)
(modeline-fg-alt comments)
(-modeline-pad
(when doom-palenight-padded-modeline
(if (integerp doom-palenight-padded-modeline) doom-palenight-padded-modeline 4))))
;;;; Base theme face overrides
((lazy-highlight :background base4 :foreground fg :weight 'bold)
(mode-line
:background modeline-bg :foreground modeline-fg
:box (if -modeline-pad `(:line-width ,-modeline-pad :color ,modeline-bg)))
(mode-line-inactive
:background modeline-bg-alt :foreground modeline-fg-alt
:box (if -modeline-pad `(:line-width ,-modeline-pad :color ,modeline-bg-alt)))
(tooltip :background (doom-darken bg-alt 0.2) :foreground fg)
;;;; css-mode <built-in> / scss-mode
(css-proprietary-property :foreground orange)
(css-property :foreground green)
(css-selector :foreground blue)
;;;; dired-k
(dired-k-commited :foreground base4)
(dired-k-modified :foreground vc-modified)
(dired-k-ignored :foreground cyan)
(dired-k-added :foreground vc-added)
;;;; doom-modeline
(doom-modeline-buffer-path :foreground green :weight 'bold)
(doom-modeline-buffer-major-mode :inherit 'doom-modeline-buffer-path)
;;;; js2-mode
(js2-jsdoc-tag :foreground magenta)
(js2-object-property :foreground yellow)
(js2-object-property-access :foreground cyan)
(js2-function-param :foreground violet)
(js2-jsdoc-type :foreground base8)
(js2-jsdoc-value :foreground cyan)
;;;; man <built-in>
(Man-overstrike :inherit 'bold :foreground magenta)
(Man-underline :inherit 'underline :foreground blue)
;;;; org <built-in>
((org-block &override) :background base2)
((org-block-background &override) :background base2)
((org-block-begin-line &override) :background base2)
;;;; rainbow-delimiters
(rainbow-delimiters-depth-1-face :foreground magenta)
(rainbow-delimiters-depth-2-face :foreground orange)
(rainbow-delimiters-depth-3-face :foreground green)
(rainbow-delimiters-depth-4-face :foreground cyan)
(rainbow-delimiters-depth-5-face :foreground violet)
(rainbow-delimiters-depth-6-face :foreground yellow)
(rainbow-delimiters-depth-7-face :foreground blue)
(rainbow-delimiters-depth-8-face :foreground teal)
(rainbow-delimiters-depth-9-face :foreground dark-cyan)
;;;; rjsx-mode
(rjsx-tag :foreground red)
(rjsx-attr :foreground yellow :slant 'italic :weight 'medium)))
;;; doom-palenight-theme.el ends here
+306
View File
@@ -0,0 +1,306 @@
;;; soft-charcoal-theme.el --- Theme
;; Copyright (C) 2023 ,
;; Author:
;; Version: 0.1
;; Package-Requires: ((emacs "24.1"))
;; Created with ThemeCreator, https://github.com/mswift42/themecreator.
;; 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 <http://www.gnu.org/licenses/>.
;; This file is not part of Emacs.
;;; Commentary:
;;; soft-charcoal theme created by in 2023
;;; Code:
(deftheme soft-charcoal)
(let ((class '((class color) (min-colors 89)))
(fg1 "#c2c2c2")
(fg2 "#b2b2b2")
(fg3 "#a3a3a3")
(fg4 "#939393")
(fg6 "#d1d1d1")
(bg1 "#191919")
(bg2 "#2b2b2b")
(bg3 "#3e3e3e")
(bg4 "#505050")
(builtin "#54686d")
(keyword "#8aa234")
(const "#8aa6c1")
(comment "#808080")
(func "#7a8bbd")
(str "#5d90cd")
(type "#8aa6c1")
(var "#8885b2")
(selection "#ff6523")
(warning "#ff6523")
(warning2 "#ff2370")
(unspec (when (>= emacs-major-version 29) 'unspecified)))
(custom-theme-set-faces
'soft-charcoal
`(default ((,class (:background ,bg1 :foreground ,fg1))))
`(font-lock-builtin-face ((,class (:foreground ,builtin))))
`(font-lock-comment-face ((,class (:foreground ,comment))))
`(font-lock-negation-char-face ((,class (:foreground ,const))))
`(font-lock-reference-face ((,class (:foreground ,const))))
`(font-lock-constant-face ((,class (:foreground ,const))))
`(font-lock-doc-face ((,class (:foreground ,comment))))
`(font-lock-function-name-face ((,class (:foreground ,func ))))
`(font-lock-keyword-face ((,class (:bold ,class :foreground ,keyword))))
`(font-lock-string-face ((,class (:foreground ,str))))
`(font-lock-type-face ((,class (:foreground ,type ))))
`(font-lock-variable-name-face ((,class (:foreground ,var))))
`(font-lock-warning-face ((,class (:foreground ,warning :background ,bg2))))
`(term-color-black ((,class (:foreground ,fg2 :background ,unspec))))
;; `(region ((,class (:background ,fg1 :foreground ,bg1))))
`(region ((,class (:background ,selection))))
`(highlight ((,class (:foreground ,fg3 :background ,bg3))))
`(hl-line ((,class (:background ,bg2))))
`(fringe ((,class (:background ,bg2 :foreground ,fg4))))
`(cursor ((,class (:background ,fg4))))
`(isearch ((,class (:bold t :foreground ,warning :background ,bg3))))
`(mode-line ((,class (:box (:line-width 1 :color nil) :bold t :foreground ,fg4 :background ,bg2))))
`(mode-line-inactive ((,class (:box (:line-width 1 :color nil :style pressed-button) :foreground ,var :background ,bg1 :weight normal))))
`(mode-line-buffer-id ((,class (:bold t :foreground ,func :background ,unspec))))
`(mode-line-highlight ((,class (:foreground ,keyword :box nil :weight bold))))
`(mode-line-emphasis ((,class (:foreground ,fg1))))
`(vertical-border ((,class (:foreground ,fg3))))
`(minibuffer-prompt ((,class (:bold t :foreground ,keyword))))
`(default-italic ((,class (:italic t))))
`(link ((,class (:foreground ,const :underline t))))
`(org-code ((,class (:foreground ,fg2))))
`(org-hide ((,class (:foreground ,fg4))))
`(org-level-1 ((,class (:bold t :foreground ,fg2 :height 1.1))))
`(org-level-2 ((,class (:bold nil :foreground ,fg3))))
`(org-level-3 ((,class (:bold t :foreground ,fg4))))
`(org-level-4 ((,class (:bold nil :foreground ,bg4))))
`(org-date ((,class (:underline t :foreground ,var) )))
`(org-footnote ((,class (:underline t :foreground ,fg4))))
`(org-link ((,class (:underline t :foreground ,type ))))
`(org-special-keyword ((,class (:foreground ,func))))
`(org-block ((,class (:foreground ,fg3))))
`(org-quote ((,class (:inherit org-block :slant italic))))
`(org-verse ((,class (:inherit org-block :slant italic))))
`(org-todo ((,class (:box (:line-width 1 :color ,fg3) :foreground ,keyword :bold t))))
`(org-done ((,class (:box (:line-width 1 :color ,bg3) :bold t :foreground ,bg4))))
`(org-warning ((,class (:underline t :foreground ,warning))))
`(org-agenda-structure ((,class (:weight bold :foreground ,fg3 :box (:color ,fg4) :background ,bg3))))
`(org-agenda-date ((,class (:foreground ,var :height 1.1 ))))
`(org-agenda-date-weekend ((,class (:weight normal :foreground ,fg4))))
`(org-agenda-date-today ((,class (:weight bold :foreground ,keyword :height 1.4))))
`(org-agenda-done ((,class (:foreground ,bg4))))
`(org-scheduled ((,class (:foreground ,type))))
`(org-scheduled-today ((,class (:foreground ,func :weight bold :height 1.2))))
`(org-ellipsis ((,class (:foreground ,builtin))))
`(org-verbatim ((,class (:foreground ,fg4))))
`(org-document-info-keyword ((,class (:foreground ,func))))
`(font-latex-bold-face ((,class (:foreground ,type))))
`(font-latex-italic-face ((,class (:foreground ,var :italic t))))
`(font-latex-string-face ((,class (:foreground ,str))))
`(font-latex-match-reference-keywords ((,class (:foreground ,const))))
`(font-latex-match-variable-keywords ((,class (:foreground ,var))))
`(ido-only-match ((,class (:foreground ,warning))))
`(org-sexp-date ((,class (:foreground ,fg4))))
`(ido-first-match ((,class (:foreground ,keyword :bold t))))
`(ivy-current-match ((,class (:foreground ,fg3 :inherit highlight :underline t))))
`(gnus-header-content ((,class (:foreground ,keyword))))
`(gnus-header-from ((,class (:foreground ,var))))
`(gnus-header-name ((,class (:foreground ,type))))
`(gnus-header-subject ((,class (:foreground ,func :bold t))))
`(mu4e-view-url-number-face ((,class (:foreground ,type))))
`(mu4e-cited-1-face ((,class (:foreground ,fg2))))
`(mu4e-cited-7-face ((,class (:foreground ,fg3))))
`(mu4e-header-marks-face ((,class (:foreground ,type))))
`(ffap ((,class (:foreground ,fg4))))
`(js2-private-function-call ((,class (:foreground ,const))))
`(js2-jsdoc-html-tag-delimiter ((,class (:foreground ,str))))
`(js2-jsdoc-html-tag-name ((,class (:foreground ,var))))
`(js2-external-variable ((,class (:foreground ,type ))))
`(js2-function-param ((,class (:foreground ,const))))
`(js2-jsdoc-value ((,class (:foreground ,str))))
`(js2-private-member ((,class (:foreground ,fg3))))
`(js3-warning-face ((,class (:underline ,keyword))))
`(js3-error-face ((,class (:underline ,warning))))
`(js3-external-variable-face ((,class (:foreground ,var))))
`(js3-function-param-face ((,class (:foreground ,fg2))))
`(js3-jsdoc-tag-face ((,class (:foreground ,keyword))))
`(js3-instance-member-face ((,class (:foreground ,const))))
`(warning ((,class (:foreground ,warning))))
`(ac-completion-face ((,class (:underline t :foreground ,keyword))))
`(info-quoted-name ((,class (:foreground ,builtin))))
`(info-string ((,class (:foreground ,str))))
`(icompletep-determined ((,class :foreground ,builtin)))
`(undo-tree-visualizer-current-face ((,class :foreground ,builtin)))
`(undo-tree-visualizer-default-face ((,class :foreground ,fg2)))
`(undo-tree-visualizer-unmodified-face ((,class :foreground ,var)))
`(undo-tree-visualizer-register-face ((,class :foreground ,type)))
`(slime-repl-inputed-output-face ((,class (:foreground ,type))))
`(trailing-whitespace ((,class :foreground ,unspec :background ,warning)))
`(rainbow-delimiters-depth-1-face ((,class :foreground ,fg1)))
`(rainbow-delimiters-depth-2-face ((,class :foreground ,type)))
`(rainbow-delimiters-depth-3-face ((,class :foreground ,var)))
`(rainbow-delimiters-depth-4-face ((,class :foreground ,const)))
`(rainbow-delimiters-depth-5-face ((,class :foreground ,keyword)))
`(rainbow-delimiters-depth-6-face ((,class :foreground ,fg1)))
`(rainbow-delimiters-depth-7-face ((,class :foreground ,type)))
`(rainbow-delimiters-depth-8-face ((,class :foreground ,var)))
`(magit-item-highlight ((,class :background ,bg3)))
`(magit-section-heading ((,class (:foreground ,keyword :weight bold))))
`(magit-hunk-heading ((,class (:background ,bg3))))
`(magit-section-highlight ((,class (:background ,bg2))))
`(magit-hunk-heading-highlight ((,class (:background ,bg3))))
`(magit-diff-context-highlight ((,class (:background ,bg3 :foreground ,fg3))))
`(magit-diffstat-added ((,class (:foreground ,type))))
`(magit-diffstat-removed ((,class (:foreground ,var))))
`(magit-process-ok ((,class (:foreground ,func :weight bold))))
`(magit-process-ng ((,class (:foreground ,warning :weight bold))))
`(magit-branch ((,class (:foreground ,const :weight bold))))
`(magit-log-author ((,class (:foreground ,fg3))))
`(magit-hash ((,class (:foreground ,fg2))))
`(magit-diff-file-header ((,class (:foreground ,fg2 :background ,bg3))))
`(lazy-highlight ((,class (:foreground ,fg2 :background ,bg3))))
`(term ((,class (:foreground ,fg1 :background ,bg1))))
`(term-color-black ((,class (:foreground ,bg3 :background ,bg3))))
`(term-color-blue ((,class (:foreground ,func :background ,func))))
`(term-color-red ((,class (:foreground ,keyword :background ,bg3))))
`(term-color-green ((,class (:foreground ,type :background ,bg3))))
`(term-color-yellow ((,class (:foreground ,var :background ,var))))
`(term-color-magenta ((,class (:foreground ,builtin :background ,builtin))))
`(term-color-cyan ((,class (:foreground ,str :background ,str))))
`(term-color-white ((,class (:foreground ,fg2 :background ,fg2))))
`(rainbow-delimiters-unmatched-face ((,class :foreground ,warning)))
`(helm-header ((,class (:foreground ,fg2 :background ,bg1 :underline nil :box nil))))
`(helm-source-header ((,class (:foreground ,keyword :background ,bg1 :underline nil :weight bold))))
`(helm-selection ((,class (:background ,bg2 :underline nil))))
`(helm-selection-line ((,class (:background ,bg2))))
`(helm-visible-mark ((,class (:foreground ,bg1 :background ,bg3))))
`(helm-candidate-number ((,class (:foreground ,bg1 :background ,fg1))))
`(helm-separator ((,class (:foreground ,type :background ,bg1))))
`(helm-time-zone-current ((,class (:foreground ,builtin :background ,bg1))))
`(helm-time-zone-home ((,class (:foreground ,type :background ,bg1))))
`(helm-buffer-not-saved ((,class (:foreground ,type :background ,bg1))))
`(helm-buffer-process ((,class (:foreground ,builtin :background ,bg1))))
`(helm-buffer-saved-out ((,class (:foreground ,fg1 :background ,bg1))))
`(helm-buffer-size ((,class (:foreground ,fg1 :background ,bg1))))
`(helm-ff-directory ((,class (:foreground ,func :background ,bg1 :weight bold))))
`(helm-ff-file ((,class (:foreground ,fg1 :background ,bg1 :weight normal))))
`(helm-ff-executable ((,class (:foreground ,var :background ,bg1 :weight normal))))
`(helm-ff-invalid-symlink ((,class (:foreground ,warning2 :background ,bg1 :weight bold))))
`(helm-ff-symlink ((,class (:foreground ,keyword :background ,bg1 :weight bold))))
`(helm-ff-prefix ((,class (:foreground ,bg1 :background ,keyword :weight normal))))
`(helm-grep-cmd-line ((,class (:foreground ,fg1 :background ,bg1))))
`(helm-grep-file ((,class (:foreground ,fg1 :background ,bg1))))
`(helm-grep-finish ((,class (:foreground ,fg2 :background ,bg1))))
`(helm-grep-lineno ((,class (:foreground ,fg1 :background ,bg1))))
`(helm-grep-match ((,class (:foreground ,unspec :background ,unspec :inherit helm-match))))
`(helm-grep-running ((,class (:foreground ,func :background ,bg1))))
`(helm-moccur-buffer ((,class (:foreground ,func :background ,bg1))))
`(helm-source-go-package-godoc-description ((,class (:foreground ,str))))
`(helm-bookmark-w3m ((,class (:foreground ,type))))
`(company-echo-common ((,class (:foreground ,bg1 :background ,fg1))))
`(company-preview ((,class (:background ,bg1 :foreground ,var))))
`(company-preview-common ((,class (:foreground ,bg2 :foreground ,fg3))))
`(company-preview-search ((,class (:foreground ,type :background ,bg1))))
`(company-scrollbar-bg ((,class (:background ,bg3))))
`(company-scrollbar-fg ((,class (:foreground ,keyword))))
`(company-tooltip ((,class (:foreground ,fg2 :background ,bg2 :bold t))))
`(company-tooltop-annotation ((,class (:foreground ,const))))
`(company-tooltip-common ((,class ( :foreground ,fg3))))
`(company-tooltip-common-selection ((,class (:foreground ,str))))
`(company-tooltip-mouse ((,class (:inherit highlight))))
`(company-tooltip-selection ((,class (:background ,bg3 :foreground ,fg3))))
`(company-template-field ((,class (:inherit region))))
`(web-mode-builtin-face ((,class (:inherit ,font-lock-builtin-face))))
`(web-mode-comment-face ((,class (:inherit ,font-lock-comment-face))))
`(web-mode-constant-face ((,class (:inherit ,font-lock-constant-face))))
`(web-mode-keyword-face ((,class (:foreground ,keyword))))
`(web-mode-doctype-face ((,class (:inherit ,font-lock-comment-face))))
`(web-mode-function-name-face ((,class (:inherit ,font-lock-function-name-face))))
`(web-mode-string-face ((,class (:foreground ,str))))
`(web-mode-type-face ((,class (:inherit ,font-lock-type-face))))
`(web-mode-html-attr-name-face ((,class (:foreground ,func))))
`(web-mode-html-attr-value-face ((,class (:foreground ,keyword))))
`(web-mode-warning-face ((,class (:inherit ,font-lock-warning-face))))
`(web-mode-html-tag-face ((,class (:foreground ,builtin))))
`(jde-java-font-lock-package-face ((t (:foreground ,var))))
`(jde-java-font-lock-public-face ((t (:foreground ,keyword))))
`(jde-java-font-lock-private-face ((t (:foreground ,keyword))))
`(jde-java-font-lock-constant-face ((t (:foreground ,const))))
`(jde-java-font-lock-modifier-face ((t (:foreground ,fg2))))
`(jde-jave-font-lock-protected-face ((t (:foreground ,keyword))))
`(jde-java-font-lock-number-face ((t (:foreground ,var))))
`(yas-field-highlight-face ((t (:background ,selection)))))
;; Legacy
(if (< emacs-major-version 22)
(custom-theme-set-faces
'soft-charcoal
`(show-paren-match-face ((,class (:background ,warning))))) ;; obsoleted in 22.1, removed 2016
(custom-theme-set-faces
'soft-charcoal
`(show-paren-match ((,class (:foreground ,bg1 :background ,str))))
`(show-paren-mismatch ((,class (:foreground ,bg1 :background ,warning))))))
;; emacs >= 26.1
(when (>= emacs-major-version 26)
(custom-theme-set-faces
'soft-charcoal
`(line-number ((t (:inherit fringe))))
`(line-number-current-line ((t (:inherit fringe :foreground ,fg6 :weight bold))))))
;; emacs >= 27.1
(when (>= emacs-major-version 27)
(custom-theme-set-faces
'soft-charcoal
`(tab-line ((,class (:background ,bg2 :foreground ,fg4))))
`(tab-line-tab ((,class (:inherit tab-line))))
`(tab-line-tab-inactive ((,class (:background ,bg2 :foreground ,fg4))))
`(tab-line-tab-current ((,class (:background ,bg1 :foreground ,fg1))))
`(tab-line-highlight ((,class (:background ,bg1 :foreground ,fg2))))))
(when (>= emacs-major-version 28)
(custom-theme-set-faces
'soft-charcoal
`(line-number ((t (:inherit fringe))))
`(line-number-current-line ((t (:inherit fringe :foreground ,fg6 :weight bold))))))
;; emacs >= 27.1
(when (>= emacs-major-version 27)
(custom-theme-set-faces
'soft-charcoal
`(tab-line ((,class (:background ,bg2 :foreground ,fg4))))
`(tab-line-tab ((,class (:inherit tab-line))))
`(tab-line-tab-inactive ((,class (:background ,bg2 :foreground ,fg4))))
`(tab-line-tab-current ((,class (:background ,bg1 :foreground ,fg1))))
`(tab-line-highlight ((,class (:background ,bg1 :foreground ,fg2))))))
(when (>= emacs-major-version 28)
(custom-theme-set-faces
'soft-charcoal
`(tab-line-tab-modified ((,class (:foreground ,warning2 :weight bold))))))
(when (boundp 'font-lock-regexp-face)
(custom-theme-set-faces
'soft-charcoal
`(font-lock-regexp-face ((,class (:inherit font-lock-string-face :underline t)))))))
;;;###autoload
(when load-file-name
(add-to-list 'custom-theme-load-path
(file-name-as-directory (file-name-directory load-file-name))))
(provide-theme 'soft-charcoal)
;; Local Variables:
;; no-byte-compile: t
;; End:
;;; soft-charcoal-theme.el ends here