<p>Not really every single one, because straight.el installs
dependencies automatically.</p>
<p>Here's the file I went through during this recording. Some things may
have changed slightly since the time of recording. Save this file in
<code>~/.emacs.d/init.el</code> to reproduce my exact Emacs
configuration that I use at home and at work.</p>
<pre class="elisp"><code>;;; init.el ---  This is Tiago&#39;s init.el file
;;; Commentary:
;;; Thanks to everyone that curates Emacs packages.

;;; Code:
;; BEGIN Straight.el bootstrap
(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name &quot;straight/repos/straight.el/bootstrap.el&quot; user-emacs-directory))
      (bootstrap-version 6))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         &quot;https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el&quot;
         &#39;silent &#39;inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil &#39;nomessage))
;; END Straight.el bootstrap

(straight-use-package &#39;use-package)
(setq straight-use-package-by-default t)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; &lt;&lt;&lt; THE ESSENTIALS &gt;&gt;&gt;  ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Get minor modes off the modeline
(use-package diminish)

(use-package evil
  :init (setq evil-want-keybinding nil)
  :config (evil-mode)
  :custom (evil-undo-system &#39;undo-redo)
  :bind (&quot;C-u&quot; . evil-scroll-up))

(use-package evil-collection
  :diminish evil-collection-unimpaired-mode
  :after evil
  :config (evil-collection-init))

(use-package evil-surround
  :after evil
  :config
  (global-evil-surround-mode 1))

;; In-Buffer Completion
(use-package company
  :diminish
  :config (global-company-mode))

;; completion with extra info box
(use-package company-box
  :diminish
  :hook (company-mode . company-box-mode))

;; Show key bindings as you go
(use-package which-key
  :diminish
  :config (which-key-mode))

;; search query feedback in the buffer
(use-package anzu
  :diminish
  :config (global-anzu-mode +1))

(use-package evil-anzu)

;; Completion in the minibuffer (snippet from vertico)
(use-package vertico
  :init
  (vertico-mode)

  ;; Different scroll margin
  ;; (setq vertico-scroll-margin 0)

  ;; Show more candidates
  ;; (setq vertico-count 20)

  ;; Grow and shrink the Vertico minibuffer
  ;; (setq vertico-resize t)

  ;; Optionally enable cycling for `vertico-next&#39; and `vertico-previous&#39;.
  ;; (setq vertico-cycle t)
  )

;; Persist history over Emacs restarts. Vertico sorts by history position.
;; (use-package savehist
;;   :init
;;   (savehist-mode))

;; A few more useful configurations...
(use-package emacs
  :init
  ;; Add prompt indicator to `completing-read-multiple&#39;.
  ;; We display [CRM&lt;separator&gt;], e.g., [CRM,] if the separator is a comma.
  (defun crm-indicator (args)
    (cons (format &quot;[CRM%s] %s&quot;
                  (replace-regexp-in-string
                   &quot;\\`\\[.*?]\\*\\|\\[.*?]\\*\\&#39;&quot; &quot;&quot;
                   crm-separator)
                  (car args))
          (cdr args)))
  (advice-add #&#39;completing-read-multiple :filter-args #&#39;crm-indicator)

  ;; Do not allow the cursor in the minibuffer prompt
  (setq minibuffer-prompt-properties
        &#39;(read-only t cursor-intangible t face minibuffer-prompt))
  (add-hook &#39;minibuffer-setup-hook #&#39;cursor-intangible-mode)

  ;; Emacs 28: Hide commands in M-x which do not work in the current mode.
  ;; Vertico commands are hidden in normal buffers.
  ;; (setq read-extended-command-predicate
  ;;       #&#39;command-completion-default-include-p)

  ;; Enable recursive minibuffers
  (setq enable-recursive-minibuffers t))

;; Optionally use the `orderless&#39; completion style.
;; Get completion even if you type substrings that don&#39;t match in the
;; same order you typed them in.
(use-package orderless
  :init
  ;; Configure a custom style dispatcher (see the Consult wiki)
  ;; (setq orderless-style-dispatchers &#39;(+orderless-consult-dispatch orderless-affix-dispatch)
  ;;       orderless-component-separator #&#39;orderless-escapable-split-on-space)
  (setq completion-styles &#39;(orderless basic)
        completion-category-defaults nil
        completion-category-overrides &#39;((file (styles partial-completion)))))

;; Enable rich annotations in the completion
(use-package marginalia
  ;; Either bind `marginalia-cycle&#39; globally or only in the minibuffer
  :bind ((&quot;M-A&quot; . marginalia-cycle)
         :map minibuffer-local-map
         (&quot;M-A&quot; . marginalia-cycle))

  ;; The :init configuration is always executed (Not lazy!)
  :init

  ;; Must be in the :init section of use-package such that the mode gets
  ;; enabled right away. Note that this forces loading the package.
  (marginalia-mode))

;; Searching commands and lots of other stuff
;; This is a snippet taken from consult
(use-package consult
  ;; Replace bindings. Lazily loaded due by `use-package&#39;.
  :bind (;; C-c bindings in `mode-specific-map&#39;
         (&quot;C-c M-x&quot; . consult-mode-command)
         (&quot;C-c h&quot; . consult-history)
         (&quot;C-c k&quot; . consult-kmacro)
         (&quot;C-c m&quot; . consult-man)
         (&quot;C-c i&quot; . consult-info)
         ([remap Info-search] . consult-info)
         ;; C-x bindings in `ctl-x-map&#39;
         (&quot;C-x M-:&quot; . consult-complex-command)     ;; orig. repeat-complex-command
         (&quot;C-x b&quot; . consult-buffer)                ;; orig. switch-to-buffer
         (&quot;C-x 4 b&quot; . consult-buffer-other-window) ;; orig. switch-to-buffer-other-window
         (&quot;C-x 5 b&quot; . consult-buffer-other-frame)  ;; orig. switch-to-buffer-other-frame
         (&quot;C-x r b&quot; . consult-bookmark)            ;; orig. bookmark-jump
         (&quot;C-x p b&quot; . consult-project-buffer)      ;; orig. project-switch-to-buffer
         ;; Custom M-# bindings for fast register access
         (&quot;M-#&quot; . consult-register-load)
         (&quot;M-&#39;&quot; . consult-register-store)          ;; orig. abbrev-prefix-mark (unrelated)
         (&quot;C-M-#&quot; . consult-register)
         ;; Other custom bindings
         (&quot;M-y&quot; . consult-yank-pop)                ;; orig. yank-pop
         ;; M-g bindings in `goto-map&#39;
         (&quot;M-g e&quot; . consult-compile-error)
         (&quot;M-g f&quot; . consult-flymake)               ;; Alternative: consult-flycheck
         (&quot;M-g g&quot; . consult-goto-line)             ;; orig. goto-line
         (&quot;M-g M-g&quot; . consult-goto-line)           ;; orig. goto-line
         (&quot;M-g o&quot; . consult-outline)               ;; Alternative: consult-org-heading
         (&quot;M-g m&quot; . consult-mark)
         (&quot;M-g k&quot; . consult-global-mark)
         (&quot;M-g i&quot; . consult-imenu)
         (&quot;M-g I&quot; . consult-imenu-multi)
         ;; M-s bindings in `search-map&#39;
         (&quot;M-s d&quot; . consult-find)
         (&quot;M-s D&quot; . consult-locate)
         (&quot;M-s g&quot; . consult-grep)
         (&quot;M-s G&quot; . consult-git-grep)
         (&quot;M-s r&quot; . consult-ripgrep)
         (&quot;M-s l&quot; . consult-line)
         (&quot;M-s L&quot; . consult-line-multi)
         (&quot;M-s k&quot; . consult-keep-lines)
         (&quot;M-s u&quot; . consult-focus-lines)
         ;; Isearch integration
         (&quot;M-s e&quot; . consult-isearch-history)
         :map isearch-mode-map
         (&quot;M-e&quot; . consult-isearch-history)         ;; orig. isearch-edit-string
         (&quot;M-s e&quot; . consult-isearch-history)       ;; orig. isearch-edit-string
         (&quot;M-s l&quot; . consult-line)                  ;; needed by consult-line to detect isearch
         (&quot;M-s L&quot; . consult-line-multi)            ;; needed by consult-line to detect isearch
         ;; Minibuffer history
         :map minibuffer-local-map
         (&quot;M-s&quot; . consult-history)                 ;; orig. next-matching-history-element
         (&quot;M-r&quot; . consult-history))                ;; orig. previous-matching-history-element

  ;; Enable automatic preview at point in the *Completions* buffer. This is
  ;; relevant when you use the default completion UI.
  :hook (completion-list-mode . consult-preview-at-point-mode)

  ;; The :init configuration is always executed (Not lazy)
  :init

  ;; Optionally configure the register formatting. This improves the register
  ;; preview for `consult-register&#39;, `consult-register-load&#39;,
  ;; `consult-register-store&#39; and the Emacs built-ins.
  (setq register-preview-delay 0.5
        register-preview-function #&#39;consult-register-format)

  ;; Optionally tweak the register preview window.
  ;; This adds thin lines, sorting and hides the mode line of the window.
  (advice-add #&#39;register-preview :override #&#39;consult-register-window)

  ;; Use Consult to select xref locations with preview
  (setq xref-show-xrefs-function #&#39;consult-xref
        xref-show-definitions-function #&#39;consult-xref)

  ;; Configure other variables and modes in the :config section,
  ;; after lazily loading the package.
  :config

  ;; Optionally configure preview. The default value
  ;; is &#39;any, such that any key triggers the preview.
  ;; (setq consult-preview-key &#39;any)
  ;; (setq consult-preview-key &quot;M-.&quot;)
  ;; (setq consult-preview-key &#39;(&quot;S-&lt;down&gt;&quot; &quot;S-&lt;up&gt;&quot;))
  ;; For some commands and buffer sources it is useful to configure the
  ;; :preview-key on a per-command basis using the `consult-customize&#39; macro.
  (consult-customize
   consult-theme :preview-key &#39;(:debounce 0.2 any)
   consult-ripgrep consult-git-grep consult-grep
   consult-bookmark consult-recent-file consult-xref
   consult--source-bookmark consult--source-file-register
   consult--source-recent-file consult--source-project-recent-file
   ;; :preview-key &quot;M-.&quot;
   :preview-key &#39;(:debounce 0.4 any))

  ;; Optionally configure the narrowing key.
  ;; Both &lt; and C-+ work reasonably well.
  (setq consult-narrow-key &quot;&lt;&quot;) ;; &quot;C-+&quot;

  ;; Optionally make narrowing help available in the minibuffer.
  ;; You may want to use `embark-prefix-help-command&#39; or which-key instead.
  ;; (define-key consult-narrow-map (vconcat consult-narrow-key &quot;?&quot;) #&#39;consult-narrow-help)

  ;; By default `consult-project-function&#39; uses `project-root&#39; from project.el.
  ;; Optionally configure a different project root function.
  ;;;; 1. project.el (the default)
  ;; (setq consult-project-function #&#39;consult--default-project--function)
  ;;;; 2. vc.el (vc-root-dir)
  ;; (setq consult-project-function (lambda (_) (vc-root-dir)))
  ;;;; 3. locate-dominating-file
  ;; (setq consult-project-function (lambda (_) (locate-dominating-file &quot;.&quot; &quot;.git&quot;)))
  ;;;; 4. projectile.el (projectile-project-root)
  ;; (autoload &#39;projectile-project-root &quot;projectile&quot;)
  ;; (setq consult-project-function (lambda (_) (projectile-project-root)))
  ;;;; 5. No project support
  ;; (setq consult-project-function nil)
)

;; workspaces
(use-package perspective
  :bind (&quot;C-x C-b&quot; . persp-list-buffers)         ; or use a nicer switcher, see below
  :custom (persp-mode-prefix-key (kbd &quot;C-c M-p&quot;))  ; pick your own prefix key here
  :init (persp-mode))

;; theme
(use-package doom-themes
  :config
  ;; Global settings (defaults)
  (setq doom-themes-enable-bold t    ; if nil, bold is universally disabled
        doom-themes-enable-italic t) ; if nil, italics is universally disabled
  (load-theme &#39;doom-one t)

  ;; Corrects (and improves) org-mode&#39;s native fontification.
  (doom-themes-org-config))

;; modeline
(use-package powerline
  :straight (:host github :repo &quot;milkypostman/powerline&quot;)
  :config (powerline-default-theme))

;; modeline theme
(use-package airline-themes
  :config (load-theme &#39;airline-onedark t))

;; makes temporary or non-editing buffers darker
(use-package solaire-mode
  :config (solaire-global-mode +1))

;; snippets
(use-package yasnippet
  :diminish yas-minor-mode
  :straight (:host github :repo &quot;joaotavora/yasnippet&quot;)
  :config (yas-global-mode 1))

;; projects
(use-package projectile
  :bind-keymap
  (&quot;C-c p&quot; . projectile-command-map))

(use-package rg)

;;;;;;;;;;;
;;; Org ;;;
;;;;;;;;;;;

(use-package org
  :commands (org-mode)
  :init (setq org-directory &quot;~/org/&quot;
              org-noter-notes-search-path &#39;(&quot;~/org/roam/&quot;)
              org-cite-global-bibliography &#39;(&quot;~/org/biblio.bib&quot;)
              org-capture-templates
                     &#39;((&quot;n&quot; &quot;Note&quot; entry
                              (file &quot;~/org/todo.org&quot;)
                              &quot;* %^{prompt}\n%U\n\n%?&quot;)
                       (&quot;r&quot; &quot;Reading list note&quot; entry
                              (file &quot;~/org/reading.org&quot;)
                              &quot;* %^{prompt}\n%U\n\n%x&quot;
                              :immediate-finish :jump-to-captured)))
  :config (require &#39;org-crypt)
          (org-crypt-use-before-save-magic)
          (require &#39;org-id)
          (defun tgdnt/advice-org-ctrl-c-ctrl-c (&amp;rest args)
            &quot;Run `org-todo&#39; if point is on a visible heading.&quot;
            (let ((do-not-run-orig-fn (org-at-heading-p t)))
                (when do-not-run-orig-fn
                (call-interactively #&#39;org-todo))
                do-not-run-orig-fn))
          (advice-add &#39;org-ctrl-c-ctrl-c :before-until #&#39;tgdnt/advice-org-ctrl-c-ctrl-c)
  :hook (org-mode . auto-fill-mode)
  :bind (&quot;C-x h&quot; . visible-mode)
        (&quot;C-c n a&quot; . org-agenda)
  :custom (org-tags-column 2)
          (org-tags-exclude-from-inheritance &#39;(&quot;crypt&quot;))
          (org-crypt-key &quot;90A77BEA68A05915&quot;)
          (org-crypt-disable-auto-save t)
          (org-adapt-indentation nil)
          (org-clock-ask-before-exiting nil)
          (org-startup-folded t)
          (org-startup-indented t)
          (org-priority-start-cycle-with-default nil)
          (org-id-link-to-org-use-id &#39;use-existing)
          (org-agenda-files (append (directory-files &quot;~/org/&quot; t &quot;.+\.org$&quot;)))
          (org-agenda-custom-commands
                &#39;((&quot;A&quot; &quot;Agenda and Unscheduled TODOs&quot;
                   ((agenda &quot;&quot;)
                    (todo &quot;TODO&quot; ((org-agenda-overriding-header &quot;Unscheduled actions:&quot;)))
                    (todo &quot;PROJ&quot; ((org-agenda-overriding-header &quot;Projects:&quot;)))
                    (todo &quot;OPEN&quot; ((org-agenda-overriding-header &quot;Open items:&quot;)))
                    (todo &quot;HOLD&quot; ((org-agenda-overriding-header &quot;On Hold:&quot;))))
                    ((org-agenda-dim-blocked-tasks &#39;invisible))
                                    nil)))
          (org-agenda-todo-ignore-with-date t)
          (org-agenda-start-day nil)
          (org-agenda-start-on-weekday nil)
          (org-agenda-span 1)
          (org-agenda-skip-deadline-prewarning-if-scheduled t)
          (org-agenda-prefix-format &#39;((agenda . &quot;%?-12t% s&quot;)
                                      (todo . &quot;  &quot;)
                                      (tags . &quot;  &quot;)
                                      (search . &quot;  &quot;)))
          (org-agenda-deadline-leaders &#39;(&quot;!&quot; &quot;%1d&quot; &quot;&#x203C;&quot;))
          (org-agenda-scheduled-leaders &#39;(&quot;#&quot; &quot;%1d&quot;))
          (org-enforce-todo-dependencies t)
          (org-refile-targets &#39;((nil :maxlevel . 2)
                                (org-agenda-files :maxlevel . 2)))
          (org-attach-id-dir &quot;~/org/attachments&quot;)
          (org-crypt-disable-auto-save t)
          (org-crypt-tag-matcher &quot;crypt&quot;)
          (org-archive-location &quot;~/org/archive/archive.org::&quot;)
          (org-deadline-warning-days 5)
          (org-archive-save-context-info &#39;(time file olpath ltags itags category))
          (org-id-link-to-org-use-id &#39;use-existing)
          (org-todo-keywords &#39;((type &quot;TODO(t)&quot; ;; A clearly defined action
                                     &quot;OPEN(o)&quot; ;; An open item, must be clarified
                                     &quot;HOLD(h)&quot; ;; An open item, must be clarified
                                     &quot;PROJ(p)&quot; ;; A project, with actions within it
                                   &quot;|&quot; &quot;DONE(d)&quot; &quot;QUIT(q)&quot;))))

;; make visible-mode automatic when entering insert mode
(use-package org-appear
  :init (setq org-hide-emphasis-markers t)
  :hook (org-mode . org-appear-mode)
  :custom (org-appear-autolinks t))

(use-package evil-org
  :after org
  :hook (org-mode . (lambda () evil-org-mode))
  :config
  (require &#39;evil-org-agenda)
  (evil-org-agenda-set-keys))

;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; more basic settings ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq backup-directory-alist
              `((&quot;.&quot; . ,(concat user-emacs-directory &quot;backups&quot;)))
      backup-by-copying t
      delete-old-versions t
      kept-new-versions 6
      kept-old-versions 2
      version-control t)

(setq-default fill-column 64
              indent-tabs-mode nil
              display-time-day-and-date t
              display-time-24hr-format t)

(setq custom-file (expand-file-name &quot;custom.el&quot; user-emacs-directory))
(load custom-file t)

(when window-system
  (scroll-bar-mode -1)
  (menu-bar-mode -1)
  (tool-bar-mode -1))

;; (toggle-frame-fullscreen)
(display-time)
(display-battery-mode)
(server-start)
(setq inhibit-startup-screen t)

;; If on a graphical env, load init-base, if not on windows, load init-extra
(when window-system
  (load-file (expand-file-name &quot;init-base.el&quot; user-emacs-directory))
  (require &#39;init-base)
  (unless (string= (x-server-vendor) &quot;Microsoft Corp.&quot;)
      (load-file (expand-file-name &quot;init-extra.el&quot; user-emacs-directory))
      (require &#39;init-extra)))

(provide &#39;init)
;;; init.el ends here</code></pre>
<p>In part 2, coming soon, we'll go through init-base.el and
init-extra.el.</p>
