dot-emacs

My emacs dotfiles/config
git clone git://git.ethandl.dev/dot-emacs
Log | Files | Refs

commit 56bd5c762a6159d092cf8a153fe5e3e08a748339
parent b338ce92567eaca4054691ac0b121b4ccf036304
Author: Ethan Long <ethandavidlong@gmail.com>
Date:   Wed, 23 Aug 2023 16:23:08 +1000

Merge branch 'main' of https://gitlab.com/lightningx10/dot-emacs

Diffstat:
Mconfig.org | 56++++++++++++++++++++++++++++++++++++++++----------------
Minit.el | 7++++---
2 files changed, 44 insertions(+), 19 deletions(-)

diff --git a/config.org b/config.org @@ -42,6 +42,7 @@ We can use ~use-package~ to configure emacs at startup. On MacOS we leave things (menu-bar-mode 0) (tool-bar-mode 0) (scroll-bar-mode 0) + (setq frame-resize-pixelwise t) (when (eq system-type 'darwin) (setq mac-option-modifier nil mac-command-modifier 'meta)) @@ -51,7 +52,10 @@ We can use ~use-package~ to configure emacs at startup. On MacOS we leave things ;; Indentation (setq-default indent-tabs-mode nil) ;; SILENCE - (setq ring-bell-function 'ignore)) + (setq ring-bell-function 'ignore) + ;; Fuck Control+Scroll to zoom, that's terrible and seems to be bound by something in emacs-plus? + (global-unset-key (kbd "<C-wheel-up>")) + (global-unset-key (kbd "<C-wheel-down>"))) #+end_src Let's get rid of the autosave and backup crap that emacs puts into the active working directories. #+begin_src emacs-lisp @@ -100,7 +104,6 @@ Let's get rid of the autosave and backup crap that emacs puts into the active wo "|>" "<>" "<$" "<$>" "$>" "<+" "<+>" "+>" "?=" "/=" "/==" "/\\" "\\/" "__" "&&" "++" "+++")) #+end_src - * Packages ** Ivy and Counsel (Better Text Navigation) [[https://github.com/abo-abo/swiper][Ivy and Counsel]] are replacements for the default ~find-file~ and =M-x= menus. @@ -113,18 +116,17 @@ Let's get rid of the autosave and backup crap that emacs puts into the active wo (add-hook 'elpaca-after-init-hook (lambda () (counsel-mode t))) #+end_src ** Ligature.el / Ligature set up -Ligatures are native on =emacs-mac=, so we just call the built in helper function if we are on MacOS. If not, we will use [[https://github.com/mickeynp/ligature.el][ligature.el]] to give ligatures with Harfbuzz. +Ligatures are native on =emacs-mac=, so we just call the built in helper function if we are using that. If not, we will use [[https://github.com/mickeynp/ligature.el][ligature.el]] to give ligatures with Harfbuzz. #+begin_src emacs-lisp ;; Font ligatures: - (if (not (eq system-type 'darwin)) - (use-package ligature - :config - (ligature-set-ligatures 'prog-mode victor-mono-ligs) - (global-ligature-mode t)) - ;; Else, on mac we have ligatures already - ;;(mac-auto-operator-composition-mode)) - ) - + (if (fboundp 'mac-auto-operator-composition-mode) + ;; We must be in emacs-mac + (mac-auto-operator-composition-mode) + ;; Else, we're in a vanilla emacs + (use-package ligature + :config + (ligature-set-ligatures 'prog-mode victor-mono-ligs) + (global-ligature-mode t))) #+end_src ** Rainbow Delimiters Rainbow delimiters are essential for working with LISP, and are just nice to have elsewhere. This package has apparently got a very small footprint, and I can't be arsed actually benchmarking anything in this emacs config so I trust them. @@ -198,7 +200,7 @@ Based completion. This is an overhaul of the autocomplete. Company mode sucks be (corfu-cycle t) (corfu-auto t) (corfu-scroll-margin 5) - :init + :config (global-corfu-mode) ;; Shouldn't have to do this, but lsp is a little bugged: (advice-add #'lsp-completion-at-point :around #'cape-wrap-noninterruptible)) @@ -225,7 +227,15 @@ Here are a few more nice things for scrolling. ;; Necessary to stop random jumps (setq scroll-conservatively 10000) #+end_src - +** Exec path from shell (Fix Path issues) +When running emacs as a daemon, we have a notable lack of things in our ~PATH~ because daemons are started in a minimal environment, at least on MacOS. +This solution will increase startup time, but will fix any path issues for most shells. May need tinkering. This will also only be activated when using a daemon. +#+begin_src emacs-lisp + (when (and (fboundp 'daemonp) (daemonp)) + (use-package exec-path-from-shell + :config + (exec-path-from-shell-initialize))) +#+end_src * Org Mode My org mode is based on [[https://orgmode.org/guide/Hyperlinks.html][a post by Diego Zamboni]]. The general idea is that we want headings to be bigger and more noticable than text, all regular text should be non-monospace, and all code should be in the regular monospace font. Starting out, let's configure the basics, we want indentation and variable pitch fonts, as well as lines that fill the whole screen well with variable font. We also want all code blocks to be fontified properly. We will wrap this all up in a function called ~org-mode-base~. @@ -279,7 +289,7 @@ Now let's make org prettier, we want all non-textual markers gone, our fonts to (custom-theme-set-faces 'user '(variable-pitch ((t (:family "ETBookOT" :height 200 :weight thin)))) - '(fixed-pitch ((t (:family "Victor Mono" :height 160 :weight regular))))) + '(fixed-pitch ((t (:family "Victor Mono" :height 0.8 :weight regular :inherit t))))) (custom-theme-set-faces 'user @@ -325,13 +335,20 @@ Adding in the ability to seamlessly paste in images from the clipboard: (org-download-image-dir "pasted-images") (org-download-heading-lvl nil) (org-download-timestamp "%Y%m%d-%H%M%S_") - (org-image-actual-width 300) + (org-image-actual-width t) (org-download-screenshot-method "/opt/homebrew/bin/pngpaste %s") :bind ("M-p" . org-download-screenshot) :config (require 'org-download)) #+end_src +We want nice ~org-latex~ previews, this isn't strictly necessary because we're using a build of org with better LaTeX previews, but it's still nice to have if that ever changes. +#+begin_src emacs-lisp + (setq org-preview-latex-default-process 'dvisvgm) + ;; This should not be necessary, but it seems the default packages is a lot barer than before. + (add-to-list 'org-latex-packages-alist '("" "amsmath" t)) + (add-to-list 'org-latex-packages-alist '("" "amssymb" t)) +#+end_src * Languages ** LSP Setup LSP, the Language Server Protocol. Very nice for debugging code live as you write it. It depends on the language as to how useful this really is. @@ -424,3 +441,10 @@ Firstly, we should get CDLaTeX: (use-package cdlatex :hook ((latex-mode LaTeX-mode) . turn-on-cdlatex)) #+end_src + +** Clojure +Firstly, we want to use clojure-mode: +#+begin_src emacs-lisp + (use-package clojure-mode) +#+end_src +I've not used clojure much yet so this section is subject to change. diff --git a/init.el b/init.el @@ -47,10 +47,11 @@ ;; If we want to use the git version of org mode, we need to download it now ;; There are many reasons you might want to do this, but the git version is quite unstable as well -;;(use-package org -;; :load-path "~/.config/emacs/elpaca/builds/org/") +;;(elpaca (org :host "git.tecosaur.net" :repo "tec/org-mode")) +(use-package org + :elpaca (:host "git.tecosaur.net" :repo "tec/org-mode")) ;; We then need to wait for the download of org to complete before we can use org. -;;(elpaca-wait) +(elpaca-wait) (setq ethandl/config-fname (expand-file-name "config.org" user-emacs-directory)) (when (file-readable-p ethandl/config-fname) (org-babel-load-file ethandl/config-fname))