* Add some directories to ~load-path~ ** My own (version controlled) ~lisp~ directory #+BEGIN_SRC emacs-lisp (add-to-list 'load-path (expand-file-name (convert-standard-filename "lisp/") user-emacs-directory)) (add-to-list 'load-path (expand-file-name (convert-standard-filename "lisp/nyan-prompt") user-emacs-directory)) #+END_SRC ** The local site-lisp …if it exists. #+BEGIN_SRC emacs-lisp (let ((site-lisp-dir "/usr/local/share/emacs/site-lisp")) (when (file-directory-p site-lisp-dir) (dolist (elt (directory-files site-lisp-dir)) (unless (or (string= elt ".") (string= elt "..")) (add-to-list 'load-path (expand-file-name elt site-lisp-dir)))))) #+END_SRC * Load some prerequisites ** Load ~xdg-paths~ #+BEGIN_SRC emacs-lisp (load "xdg-paths") #+END_SRC * Emacs configuration ** Set up the package archives #+BEGIN_SRC emacs-lisp (require 'package) (add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/")) (add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) (add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t) (package-initialize) #+END_SRC ** Configure ~use-package~ and preload ~bind-key~ #+BEGIN_SRC emacs-lisp (unless (package-installed-p 'use-package) (package-refresh-contents) (package-install 'use-package)) (require 'use-package) (customize-set-variable 'use-package-always-ensure t) (customize-set-variable 'use-package-verbose nil) (use-package bind-key) #+END_SRC ** Install and configure Quelpa #+BEGIN_SRC emacs-lisp (unless (package-installed-p 'quelpa) (with-temp-buffer (url-insert-file-contents "https://raw.githubusercontent.com/quelpa/quelpa/master/quelpa.el") (eval-buffer) (quelpa-self-upgrade))) #+END_SRC *** And quelpa-use-package, too! #+BEGIN_SRC emacs-lisp (quelpa '(quelpa-use-package :fetcher git :url "https://github.com/quelpa/quelpa-use-package.git")) (require 'quelpa-use-package) #+END_SRC ** Set up the really basic things #+begin_src emacs-lisp (use-package emacs :ensure nil :custom (user-full-name "Gergely Polonkai") (user-mail-address "gergely@polonkai.eu") (kill-read-only-ok t) (use-dialog-box nil) (cursor-type 'bar) (echo-keystrokes .01) (fill-column 80) (insert-pair-alist '((40 41) ; () (91 93) ; [] (123 125) ; {} (60 62) ; <> (34 34) ; "" (39 39) ; '' (96 39) ; `' (8220 8221) ; “” (8222 8221) ; „” (8216 8217) ; ‘’ (8249 8250) ; ‹› (8250 8249) ; ›‹ (171 187) ; «» (187 171))) ; »« (initial-scratch-message "")) #+end_src ** Set up some default faces #+begin_src emacs-lisp (use-package faces :ensure nil :custom-face (default ((t (:family "Fira Code Retina" :foundry "simp" :slant normal :weight normal :height 110 :width normal)))) (trailing-whitespace ((t (:inherit nil :background "red3"))))) #+end_src ** Use ligatures #+begin_src emacs-lisp (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 Cascadia 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"))) ;; <>