#+title: EMACS 2#+PROPERTY: header-args:emacs-lisp :tangle yes :tangle init.el* Welcome!#+begin_src emacs-lisp;; -*- lexical-binding: t; -*-#+end_src* Package Setup #+begin_src emacs-lisp(message"Reached package setup")(require`package)(setqpackage-archives`(("mepla"."https://melpa.org/packages/")("org"."https://orgmode.org/elpa/")("elpa"."https://elpa.gnu.org/packages/")))(package-initialize)(unless(package-installed-p'use-package)(progn(package-refresh-contents)(package-install'use-package)))(require'use-package)(setquse-package-always-ensuret);; TODO add better detection to this(when(eqsystem-type'windows-nt)(message"setting up straight.el")(defvarbootstrap-version)(let((bootstrap-file(expand-file-name"straight/repos/straight.el/bootstrap.el"(or(bound-and-true-pstraight-base-dir)user-emacs-directory)))(bootstrap-version7))(unless(file-exists-pbootstrap-file)(with-current-buffer(url-retrieve-synchronously"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"'silent'inhibit-cookies)(goto-char(point-max))(eval-print-last-sexp)))(loadbootstrap-filenil'nomessage))(setqstraight-use-package-by-defaultt))#+end_src* Keybinds
Ill use this later eventually
#+begin_src emacs-lisp(message"Got to keybinds")#+end_src** Make emacs more human
#+begin_src emacs-lisp(global-set-key(kbd"<escape>")'keyboard-escape-quit)#+end_src* Core#+begin_src elisp(message"Reached core.")#+end_src** Encoding
#+begin_src emacs-lisp(setqutf-translate-cjk-modenil); disable CJK coding/encoding (Chinese/Japanese/Korean characters)(set-language-environment'utf-8)(set-keyboard-coding-system'utf-8); For old Carbon emacs on OS X only(setqlocale-coding-system'utf-8)(set-default-coding-systems'utf-8)(set-terminal-coding-system'utf-8)(set-selection-coding-system(if(eqsystem-type'windows-nt)'utf-16-le;; https://rufflewind.com/2014-07-20/pasting-unicode-in-emacs-on-windows'utf-8))(prefer-coding-system'utf-8)#+end_src** Cleanup .emacs.d
#+begin_src emacs-lisp(setqbackup-directory-alist'(("."."~/.emacs.d/backup"))backup-by-copyingtversion-controltdelete-old-versionstkept-new-versions20kept-old-versions5)(use-packageno-littering:config(setqcustom-file(if(boundp'server-socket-dir)(expand-file-name"custom.el"server-socket-dir)(no-littering-expand-etc-file-name"custom.el")))(when(file-exists-pcustom-file)(loadcustom-filet));; Don't litter project folders with backup files(let((backup-dir(no-littering-expand-var-file-name"backup/")))(make-directorybackup-dirt)(setqbackup-directory-alist`(("\\`/tmp/".nil)("\\`/dev/shm/".nil)(".".,backup-dir))))(setqauto-save-defaultnil);; Tidy up auto-save files(setqauto-save-defaultnil)(let((auto-save-dir(no-littering-expand-var-file-name"auto-save/")))(make-directoryauto-save-dirt)(setqauto-save-file-name-transforms`(("\\`/[^/]*:\\([^/]*/\\)*\\([^/]*\\)\\'",(concattemporary-file-directory"\\2")t)("\\`\\(/tmp\\|/dev/shm\\)\\([^/]*/\\)*\\(.*\\)\\'""\\3")(".",auto-save-dirt)))));; no-littering doesn't set this by default so we must place;; auto save files in the same path as it uses for sessions(setqauto-save-file-name-transforms`((".*",(no-littering-expand-var-file-name"auto-save/")t)))#+end_src** Native Compilation
#+begin_src emacs-lisp(setqnative-comp-async-report-warnings-errorsnil)(add-to-list'native-comp-eln-load-path(expand-file-name"eln-cache/"user-emacs-directory))#+end_src** Emacs settings
#+begin_src emacs-lisp
(setq inhibit-startup-message t