X-Git-Url: https://git.shemshak.org/~bandali/configs/blobdiff_plain/fd134a2b5330c76b04e8777a8dc001722c706a37..63a849c3da1bd6eb3e0cc722ab0419b3d68c4f57:/emacs/init.org diff --git a/emacs/init.org b/emacs/init.org index db79586..5f96e69 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -5,9 +5,18 @@ TODO: description -TODO: toc +* Contents :toc_1:noexport: + +- [[#intro][Intro]] +- [[#header][Header]] +- [[#initial-setup][Initial setup]] +- [[#config][Config]] +- [[#footer][Footer]] * Header +:PROPERTIES: +:CUSTOM_ID: header +:END: ** First line @@ -51,6 +60,9 @@ file. #+end_src * Initial setup +:PROPERTIES: +:CUSTOM_ID: initial-setup +:END: #+begin_src emacs-lisp :comments none ;;; Code: @@ -63,10 +75,10 @@ Measure and display startup time. Also, temporarily increase collection frequency. Taken from [[https://github.com/dieggsy/dotfiles/tree/3d95bc08033920e077855caf545a975eba52d28d/emacs.d#startup-time][here]]. #+begin_src emacs-lisp -(defconst aminb/emacs-start-time (current-time)) -(defconst aminb/gc-cons-threshold gc-cons-threshold) -(defconst aminb/gc-cons-percentage gc-cons-percentage) -(defvar aminb/file-name-handler-alist file-name-handler-alist) +(defconst ab--emacs-start-time (current-time)) +(defconst ab--gc-cons-threshold gc-cons-threshold) +(defconst ab--gc-cons-percentage gc-cons-percentage) +(defvar ab--file-name-handler-alist file-name-handler-alist) (setq gc-cons-threshold 400000000 gc-cons-percentage 0.6 file-name-handler-alist nil @@ -80,18 +92,21 @@ Reset the variables back to default after init. (add-hook 'after-init-hook `(lambda () - (setq gc-cons-threshold aminb/gc-cons-threshold - gc-cons-percentage aminb/gc-cons-percentage - file-name-handler-alist aminb/file-name-handler-alist) + (setq gc-cons-threshold ab--gc-cons-threshold + gc-cons-percentage ab--gc-cons-percentage + file-name-handler-alist ab--file-name-handler-alist) (let ((elapsed (float-time (time-subtract (current-time) - aminb/emacs-start-time)))) + ab--emacs-start-time)))) (message "Loading %s...done (%.3fs) [after-init]" ,load-file-name elapsed)))) #+end_src +Note that I'll be using my initials, =ab=, as a prefix for the +variables and functions I define throughout my init file. + ** Package management -*** [[https://github.com/raxod502/straight.el][=straight.el=]] +*** =straight.el= #+begin_quote Next-generation, purely functional package manager for the Emacs @@ -143,7 +158,7 @@ hacker. *** =use-package= #+begin_quote -A use-package declaration for simplifying your .emacs. +A use-package declaration for simplifying your .emacs #+end_quote =use-package= is an awesome utility for managing and configuring @@ -159,7 +174,7 @@ performance. So let's install it using =striaght.el= and have it use ** No littering in =~/.emacs.d= #+begin_quote -Help keeping ~/.emacs.d clean. +Help keeping ~/.emacs.d clean #+end_quote By default, even for Emacs' built-in packages, the configuration files @@ -189,6 +204,22 @@ it it's own file. (load custom-file)) #+end_src +** Backups + +Emacs' default backup settings aren't that great. Let's use more +sensible options. See documentation for the ~make-backup-file~ +variable. + +#+begin_src emacs-lisp +(setq backup-by-copying t + version-control t) +#+end_src + +* Config +:PROPERTIES: +:CUSTOM_ID: config +:END: + ** Org #+begin_src emacs-lisp @@ -198,6 +229,9 @@ it it's own file. #+end_src * Footer +:PROPERTIES: +:CUSTOM_ID: footer +:END: #+begin_src emacs-lisp :comments none ;;; init.el ends here