Skip to content

Latest commit

 

History

History
132 lines (108 loc) · 3.58 KB

emacs.org

File metadata and controls

132 lines (108 loc) · 3.58 KB

#+TITLE Emacs config

Startup speed optimisations

Make startup faster by reducing the frequency of garbage collection and then use a hook to measure Emacs startup time.

;; The default is 800 kilobytes.  Measured in bytes.
(setq gc-cons-threshold (* 50 1000 1000))

;; Profile emacs startup
(add-hook 'emacs-startup-hook
          (lambda ()
            (message "*** Emacs loaded in %s with %d garbage collections."
                     (format "%.2f seconds"
                             (float-time
                              (time-subtract after-init-time before-init-time)))
                     gcs-done)))

Frame decorations

(set-frame-parameter (selected-frame) 'alpha '(95 . 85))
(add-to-list 'default-frame-alist '(alpha . (95 . 85)))

Window decorations

(scroll-bar-mode -1)
(menu-bar-mode -1)
(tool-bar-mode -1)
(tooltip-mode -1)

Buffer decorations

(global-display-line-numbers-mode t)

;; Disable line numbers for some modes
(dolist (mode '(org-mode-hook
                term-mode-hook
                shell-mode-hook
                eshell-mode-hook))
  (add-hook mode (lambda () (display-line-numbers-mode 0))))

Operational speed optimisations

;; Should help with Emacs slowing down on big one-liners
(setq bidi-paragraph-direction 'left-to-right)

Packages

(require 'package)

(setq package-enable-at-startup nil)
(setq package-archives
      '(("melpa" . "https://melpa.org/packages/")
        ("gnu" . "https://elpa.gnu.org/packages/")
        ("org" . "http://orgmode.org/elpa/")))
(package-initialize)

(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))

(eval-when-compile
  (require 'use-package))

(use-package diminish :ensure t)

(use-package use-package-ensure-system-package :ensure t)

Path configurations

This is too slow

;; (use-package exec-path-from-shell
;;   :ensure t
;;   :config (exec-path-from-shell-initialize))

OS integration

;; Enable copy/past-ing from clipboard
(setq select-enable-clipboard t)

Buffer configuration

;; Always reload the file if it changed on disk, see also: auto-revert-tail-mode
(global-auto-revert-mode 1)

;; Auto update dired when files change
(add-hook 'dired-mode-hook 'auto-revert-mode)

Keybinding visual aid

(use-package which-key
  :ensure t
  :init (which-key-mode)
  :diminish which-key-mode
  :config
  (setq which-key-idle-delay 0.3))

Language specific settings

Javascript

Auto-linting fix https://github.com/aaronjensen/eslintd-fix https://github.com/jscheid/prettier.el https://github.com/prettier/prettier-emacs

Org

Calendars

There’s built-in export to icalendar. Set that up for Thunderbird icalendar. Here’s an org icalendar import. https://github.com/vjohansen/emacs-config/blob/master/org-import-calendar.el

With those two we should now have end-to-end Thunderbird (or whatever icalendar), Org Agenda and Orgzly integration.

Themes

https://github.com/hlissner/emacs-doom-themes https://monokai.pro/vscode https://www.nordtheme.com/docs https://github.com/atomiks/moonlight-vscode-theme https://citylights.xyz/

Other configs

https://github.com/daviwil/dotfiles/blob/master/Emacs.org