diff options
Diffstat (limited to '.emacs.d/init.org')
| -rw-r--r-- | .emacs.d/init.org | 160 |
1 files changed, 160 insertions, 0 deletions
diff --git a/.emacs.d/init.org b/.emacs.d/init.org new file mode 100644 index 0000000..b7514b7 --- /dev/null +++ b/.emacs.d/init.org @@ -0,0 +1,160 @@ +#+startup: content indent + +This file is my emacs config, written as an org file. To export it, +run ~M-x org-babel-tangle~. +* Initial stuff +#+begin_src emacs-lisp :tangle "init.el" + ; -*- lexical-binding: t; -*- + + ; NOTE: This file is automatically generated from init.org. Changes + ; should go there, not here. +#+end_src +* Put all the customisation stuff in its own file +When new packages are installed, or settings are changed in the +customisation interface, emacs automatically saves this +information. By default, it is put into the init file, but this is +noisy, and I prefer it to be in another file. +** Set the custom file +#+begin_src emacs-lisp :tangle "init.el" + (setq custom-file (locate-user-emacs-file "custom.el")) +#+end_src +** Load the custom file's contents +#+begin_src emacs-lisp :tangle "init.el" + (load custom-file t) +#+end_src +* Setup package archive +Some packages I use come from melpa. +#+begin_src emacs-lisp :tangle "init.el" + (require 'package) + (package-initialize) + (add-to-list 'package-archives + '("melpa" . "https://melpa.org/packages/") t) +#+end_src +* Configure use-package +Tell use-package to assume ~:defer t~. +#+begin_src emacs-lisp :tangle "init.el" + (setq use-package-always-defer t) +#+end_src +Tell it to assume ~:ensure t~ as well. +#+begin_src emacs-lisp :tangle init.el + (require 'use-package-ensure) + (setq use-package-always-ensure t) +#+end_src +* Basic configuration +#+begin_src emacs-lisp :tangle "init.el" :noweb yes + (use-package emacs + :demand t + :custom + <<basic-custom>> + :config + <<basic-config>> + ) +#+end_src +** Startup +Remove the splash screen +#+begin_src emacs-lisp :noweb-ref basic-custom + (inhibit-splash-screen t) +#+end_src +Use a specific org file as the initial buffer. +#+begin_src emacs-lisp :noweb-ref basic-custom + (initial-buffer-choice "~/org-files/startup.org") +#+end_src +** System-specific setup +*** MacOS +#+begin_src emacs-lisp :noweb-ref basic-config + (when (eq system-type 'darwin) + (setq mac-right-option-modifier 'none)) +#+end_src +* Appearence configuration +** Modus theme +Load a nice looking theme. +#+begin_src emacs-lisp :tangle "init.el" + (use-package modus-themes + :demand t + :custom + (modus-themes-mixed-fonts t) + (modus-themes-variable-pitch-ui t) + (modus-themes-disable-other-themes t) + :config + (modus-themes-load-theme 'modus-operandi-tinted)) +#+end_src +** Default fonts +#+begin_src emacs-lisp :noweb-ref basic-config + (set-face-attribute 'default nil :family "Iosevka" :height 140) + (set-face-attribute 'fixed-pitch nil :family "Iosevka Extended") + (set-face-attribute 'fixed-pitch-serif nil :family "Iosevka Slab Extended") + (set-face-attribute 'variable-pitch nil :family "Iosevka Etoile") +#+end_src +** Disable UI elements +Remove the menu bar +#+begin_src emacs-lisp :noweb-ref basic-config + (menu-bar-mode -1) +#+end_src +Remove the scroll bars +#+begin_src emacs-lisp :noweb-ref basic-config + (scroll-bar-mode -1) +#+end_src +Remove the tool bar +#+begin_src emacs-lisp :noweb-ref basic-config + (tool-bar-mode -1) +#+end_src +* Minibuffer +Customisation of defaults. +#+begin_src emacs-lisp :noweb-ref basic-custom + (completion-eager-display t) + (completion-eager-update t) + (completion-show-help nil) + (completion-show-inline-help nil) + (completions-detailed t) + (completions-group t) + (completions-max-height 10) + (completions-sort 'historical) + (minibuffer-completion-auto-choose t) + (read-buffer-completion-ignore-case t) + (read-file-name-completion-ignore-case t) +#+end_src +Enable electric mode by default. +#+begin_src emacs-lisp :noweb-ref basic-config + (minibuffer-electric-default-mode) +#+end_src +* Magit +#+begin_src emacs-lisp :tangle "init.el" + (use-package magit) +#+end_src +* Ghostel (terminal) +#+begin_src emacs-lisp :tangle "init.el" + (use-package ghostel) +#+end_src +* Mediawiki +#+begin_src emacs-lisp :tangle "init.el" + (use-package mediawiki + :custom + (mediawiki-site-defaut "dyalog") + :config + (add-to-list 'mediawiki-site-alist + '("dyalog" "https://wiki.bramley.dyalog.com" "peterm" nil "" + :description "Dyalog internal wiki" :first-page "User:Peterm"))) +#+end_src +* Project +#+begin_src emacs-lisp :tangle "init.el" + (use-package project + :custom + (project-mode-line t)) +#+end_src +* Org mode and associated packages +** Base org package +#+begin_src emacs-lisp :tangle "init.el" + (use-package org + :bind + (("C-c l" . org-store-link) + ("C-c a" . org-agenda) + ("C-c c" . org-capture))) +#+end_src +** Org roam +#+begin_src emacs-lisp :tangle "init.el" + (use-package org-roam + :custom + (org-roam-directory (file-truename "~/org-files/roam")) + :config + (org-roam-db-autosync-mode)) +#+end_src |