Skip to content

Instantly share code, notes, and snippets.

@Archenoth
Last active September 21, 2023 18:47
Show Gist options
  • Save Archenoth/634cb7ac7b435b4429b0fc6f21bf8997 to your computer and use it in GitHub Desktop.
Save Archenoth/634cb7ac7b435b4429b0fc6f21bf8997 to your computer and use it in GitHub Desktop.
(kinda-but-not-actually) microemacs -- a script for emacs28+ that runs a speedy configless terminal version of emacs with some edges filed off~
#!/bin/bash
EL=`cat <<EL
(load-theme 'modus-vivendi)
(setq initial-scratch-message nil)
;; Squelch the creation of .#<filename> files
(setq create-lockfiles nil)
;; Emacs auto-backups feel nicer when they collect in my ~/.emacs.d/backups
;; instead of the current folder
(setq backup-directory-alist '((".*" . "~/.emacs.d/backups/"))
auto-save-file-name-transforms '((".*" "~/.emacs.d/backups/" t)))
;; yes or no questions are now y/n questions
(defalias 'yes-or-no-p 'y-or-n-p)
;; Parenthesis (and other things) pair highlighting
(show-paren-mode)
;; Eldoc is useful for most language support
(global-eldoc-mode 1)
;; Marks files with shebangs as executable automatically
(add-hook 'after-save-hook
'executable-make-buffer-file-executable-if-script-p)
;; Deletes trailing whitespace before saving
(add-hook 'before-save-hook 'delete-trailing-whitespace)
;; This causes dired to open files in the same buffer as itself when
;; you click things (Deffered until we actually use dired)
(with-eval-after-load 'dired
(define-key dired-mode-map (kbd "<mouse-2>") 'dired-mouse-find-file))
;; Save my minibuffer history between sessions plz
(savehist-mode 1)
;; Mouse support
(xterm-mouse-mode 1)
(global-set-key (kbd "<mouse-4>") 'scroll-down-line)
(global-set-key (kbd "<mouse-5>") 'scroll-up-line)
EL
`
exec emacs -Q -nw --eval "(progn $EL)" "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment