Skip to content

Commit

Permalink
Add show notes for the first 10 Emacs From Scratch episodes
Browse files Browse the repository at this point in the history
  • Loading branch information
daviwil committed Feb 10, 2021
1 parent 4589dcc commit a2101c1
Show file tree
Hide file tree
Showing 11 changed files with 1,222 additions and 10 deletions.
20 changes: 10 additions & 10 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ This repo now contains configuration from multiple series on the channel!

Here is a list of all the episode videos with links to the configuration we built for each one:

1. [[https://www.youtube.com/watch?v=74zOY-vgkyw][Live-Coding a Custom Emacs Configuration from Scratch]] ([[https://github.com/daviwil/emacs-from-scratch/tree/c0266ff684f670ecc5e41615c0282912e6615214][Code]])
2. [[https://www.youtube.com/watch?v=IspAZtNTslY][Adding Helpful UI Improvements]] ([[https://github.com/daviwil/emacs-from-scratch/tree/43c0401355c7971cb4491690ee4b8449505a5d58][Code]])
3. [[https://www.youtube.com/watch?v=xaZMwNELaJY][Key Bindings and Evil]] ([[https://github.com/daviwil/emacs-from-scratch/tree/29e542c79632853d85124019e47506cc0571cd05][Code]])
4. [[https://youtu.be/INTu30BHZGk][Projectile and Magit]] ([[https://github.com/daviwil/emacs-from-scratch/tree/500370fa06889dad313e60473d73090fcfbe106d][Code]])
5. [[https://www.youtube.com/watch?v=VcgjTEa0kU4][Org Mode Basics]] ([[https://github.com/daviwil/emacs-from-scratch/tree/1a13fcf0dd6afb41fce71bf93c5571931999fed8][Code]])
6. [[https://youtu.be/PNE-mgkZ6HM][Organizing Your Life with Org Mode]] ([[https://github.com/daviwil/emacs-from-scratch/tree/c55d0f5e309f7ed8ffa3c00bc35c75937a5184e4][Code]])
7. [[https://youtu.be/kkqVTDbfYp4][Configure Everything with Org Babel]] ([[https://github.com/daviwil/emacs-from-scratch/tree/9388cf6ecd9b44c430867a5c3dad5f050fdc0ee1][Code]])
8. [[https://youtu.be/E-NAM9U5JYE][Build Your Own IDE with lsp-mode]] ([[https://github.com/daviwil/emacs-from-scratch/tree/6d078217a41134cc667f969430d150c50d03f448][Code]])
9. [[https://youtu.be/wa_wZIuT9Vw][Learn to Love the Terminal Modes]] ([[https://github.com/daviwil/emacs-from-scratch/tree/bbfbc77b3afab0c14149e07d0ab08d275d4ba575][Code]])
10. [[https://youtu.be/PMWwM8QJAtU][Effortless File Management with Dired]] ([[https://github.com/daviwil/emacs-from-scratch/blob/8c302a79bf5700f6ef0279a3daeeb4123ae8bd59/Emacs.org#dired][Code]])
1. [[https://www.youtube.com/watch?v=74zOY-vgkyw][Live-Coding a Custom Emacs Configuration from Scratch]] ([[https://github.com/daviwil/emacs-from-scratch/tree/c0266ff684f670ecc5e41615c0282912e6615214][Code]], [[file:show-notes/Emacs-01.org][Notes]])
2. [[https://www.youtube.com/watch?v=IspAZtNTslY][Adding Helpful UI Improvements]] ([[https://github.com/daviwil/emacs-from-scratch/tree/43c0401355c7971cb4491690ee4b8449505a5d58][Code]], [[file:show-notes/Emacs-02.org][Notes]])
3. [[https://www.youtube.com/watch?v=xaZMwNELaJY][Key Bindings and Evil]] ([[https://github.com/daviwil/emacs-from-scratch/tree/29e542c79632853d85124019e47506cc0571cd05][Code]], [[file:show-notes/Emacs-03.org][Notes]])
4. [[https://youtu.be/INTu30BHZGk][Projectile and Magit]] ([[https://github.com/daviwil/emacs-from-scratch/tree/500370fa06889dad313e60473d73090fcfbe106d][Code]], [[file:show-notes/Emacs-04.org][Notes]])
5. [[https://www.youtube.com/watch?v=VcgjTEa0kU4][Org Mode Basics]] ([[https://github.com/daviwil/emacs-from-scratch/tree/1a13fcf0dd6afb41fce71bf93c5571931999fed8][Code]], [[file:show-notes/Emacs-05.org][Notes]])
6. [[https://youtu.be/PNE-mgkZ6HM][Organizing Your Life with Org Mode]] ([[https://github.com/daviwil/emacs-from-scratch/tree/c55d0f5e309f7ed8ffa3c00bc35c75937a5184e4][Code]], [[file:show-notes/Emacs-06.org][Notes]])
7. [[https://youtu.be/kkqVTDbfYp4][Configure Everything with Org Babel]] ([[https://github.com/daviwil/emacs-from-scratch/tree/9388cf6ecd9b44c430867a5c3dad5f050fdc0ee1][Code]], [[file:show-notes/Emacs-07.org][Notes]])
8. [[https://youtu.be/E-NAM9U5JYE][Build Your Own IDE with lsp-mode]] ([[https://github.com/daviwil/emacs-from-scratch/tree/6d078217a41134cc667f969430d150c50d03f448][Code]], [[file:show-notes/Emacs-08.org][Notes]])
9. [[https://youtu.be/wa_wZIuT9Vw][Learn to Love the Terminal Modes]] ([[https://github.com/daviwil/emacs-from-scratch/tree/bbfbc77b3afab0c14149e07d0ab08d275d4ba575][Code]], [[file:show-notes/Emacs-09.org][Notes]])
10. [[https://youtu.be/PMWwM8QJAtU][Effortless File Management with Dired]] ([[https://github.com/daviwil/emacs-from-scratch/blob/8c302a79bf5700f6ef0279a3daeeb4123ae8bd59/Emacs.org#dired][Code]], [[file:show-notes/Emacs-10.org][Notes]])
11. [[https://youtu.be/dtjq68F2dXw][Keeping Your Emacs Packages Up to Date]] ([[https://github.com/daviwil/emacs-from-scratch/blob/4e921ccbe603d5fdd9c7f16c2418ac7322c8ab71/Emacs.org#automatic-package-updates][Code]], [[file:show-notes/Emacs-Scratch-11.org][Notes]])

** [[https://www.youtube.com/watch?v=RQK_DaaX34Q&list=PLEoMzSkcN8oPQtn7FQEF3D7sroZbXuPZ7][Learning Emacs Lisp]]
Expand Down
16 changes: 16 additions & 0 deletions show-notes/Emacs-01.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#+title: Emacs from Scratch #1

* The plan
We're going to walk through a configuration of Emacs from scratch, starting with the most obvious improvements and then working our way to the more specialized changes as we proceed.

* Brief demo of my config
* Starting off with empty config, make the UI more minimal

#+begin_src emacs-lisp

(use-package command-log-mode)

#+end_src

* Set a theme
* Set up Ivy
85 changes: 85 additions & 0 deletions show-notes/Emacs-02.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
* Check out the GitHub repo

https://github.com/daviwil/runemacs

* General Improvements

** Line Numbers

#+begin_src emacs-lisp

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

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

#+end_src

** Rainbow Delimiters

#+begin_src emacs-lisp

(use-package rainbow-delimiters
:hook (prog-mode . rainbow-delimiters-mode))

#+end_src

* Packages

** which-key

https://github.com/justbur/emacs-which-key

#+begin_src emacs-lisp

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

#+end_src

** ivy-rich

https://github.com/Yevgnen/ivy-rich

#+begin_src emacs-lisp

(use-package ivy-rich
:init
(ivy-rich-mode 1)
:config
(setq ivy-format-function #'ivy-format-function-line)
(setq ivy-rich--display-transformers-list
(plist-put ivy-rich--display-transformers-list
'ivy-switch-buffer
'(:columns
((ivy-rich-candidate (:width 40))
(ivy-rich-switch-buffer-indicators (:width 4 :face error :align right)); return the buffer indicators
(ivy-rich-switch-buffer-major-mode (:width 12 :face warning)) ; return the major mode info
(ivy-rich-switch-buffer-project (:width 15 :face success)) ; return project name using `projectile'
(ivy-rich-switch-buffer-path (:width (lambda (x) (ivy-rich-switch-buffer-shorten-path x (ivy-rich-minibuffer-width 0.3)))))) ; return file path relative to project root or `default-directory' if project is nil
:predicate
(lambda (cand)
(if-let ((buffer (get-buffer cand)))
;; Don't mess with EXWM buffers
(with-current-buffer buffer
(not (derived-mode-p 'exwm-mode)))))))))

#+end_src

** helpful

https://github.com/Wilfred/helpful

** doom-themes
https://github.com/hlissner/emacs-doom-themes

- doom theme
- which-key
- Line numbers (hooks)
122 changes: 122 additions & 0 deletions show-notes/Emacs-03.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
* Check out the GitHub repo

https://github.com/daviwil/runemacs

* Notes from previous streams

We need to update the =load-theme= call to avoid a prompt at startup, =(load-theme 'doom-dracula t)=

Thanks to Kyle Sexton and Nathan Chen for pointing out that all-the-icons is needed for doom-modeline to display correctly!

* Basic Key Bindings

=define-key= and =global-set-key=

* Bindings with general.el

https://github.com/noctuid/general.el#general-examples

#+begin_src emacs-lisp

(use-package general
:config
(general-evil-setup t)

(general-create-definer rune/leader-keys
:keymaps '(normal insert visual emacs)
:prefix "SPC"
:global-prefix "C-SPC"))

(rune/leader-keys
"t" '(:ignore t :which-key "toggles")
"tt" '(counsel-load-theme :which-key "choose theme"))

#+end_src

* Becoming Evil

https://github.com/emacs-evil/evil
https://github.com/emacs-evil/evil-collection

#+begin_src emacs-lisp

(defun rune/evil-hook ()
(dolist (mode '(custom-mode
eshell-mode
git-rebase-mode
erc-mode
circe-server-mode
circe-chat-mode
circe-query-mode
sauron-mode
term-mode))
(add-to-list 'evil-emacs-state-modes mode)))

(use-package evil
:init
(setq evil-want-integration t)
(setq evil-want-keybinding nil)
(setq evil-want-C-u-scroll t)
(setq evil-want-C-i-jump nil)
:hook (evil-mode . rune/evil-hook)
:config
(evil-mode 1)
(define-key evil-insert-state-map (kbd "C-g") 'evil-normal-state)
(define-key evil-insert-state-map (kbd "C-h") 'evil-delete-backward-char-and-join)

;; Use visual line motions even outside of visual-line-mode buffers
(evil-global-set-key 'motion "j" 'evil-next-visual-line)
(evil-global-set-key 'motion "k" 'evil-previous-visual-line)

(evil-set-initial-state 'messages-buffer-mode 'normal)
(evil-set-initial-state 'dashboard-mode 'normal))

(use-package evil-collection
:after evil
:config
(evil-collection-init))

;; Mention evil-collection-mode-list

#+end_src

https://github.com/emacs-evil/evil-collection#configuration

If we want to be hardcore...

#+begin_src emacs-lisp

(defun rune/dont-arrow-me-bro ()
(interactive)
(message "Arrow keys are bad, you know?"))

;; Disable arrow keys in normal and visual modes
(define-key evil-normal-state-map (kbd "<left>") 'rune/dont-arrow-me-bro)
(define-key evil-normal-state-map (kbd "<right>") 'rune/dont-arrow-me-bro)
(define-key evil-normal-state-map (kbd "<down>") 'rune/dont-arrow-me-bro)
(define-key evil-normal-state-map (kbd "<up>") 'rune/dont-arrow-me-bro)
(evil-global-set-key 'motion (kbd "<left>") 'rune/dont-arrow-me-bro)
(evil-global-set-key 'motion (kbd "<right>") 'rune/dont-arrow-me-bro)
(evil-global-set-key 'motion (kbd "<down>") 'rune/dont-arrow-me-bro)
(evil-global-set-key 'motion (kbd "<up>") 'rune/dont-arrow-me-bro)

#+end_src

* Hydra

https://github.com/abo-abo/hydra

#+begin_src emacs-lisp

(use-package hydra)

(defhydra hydra-text-scale (:timeout 4)
"scale text"
("j" text-scale-increase "in")
("k" text-scale-decrease "out"))
("f" nil "finished" :exit t))

(rune/leader-keys
"ts" '(hydra-text-scale/body :which-key "scale text"))

#+end_src
90 changes: 90 additions & 0 deletions show-notes/Emacs-04.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
* Check out the GitHub repo

https://github.com/daviwil/runemacs

* Projectile

#+begin_src emacs-lisp

(use-package projectile
:diminish projectile-mode
:config (projectile-mode)
:bind-keymap
("C-c p" . projectile-command-map)
:init
(when (file-directory-p "~/Projects/Code")
(setq projectile-project-search-path '("~/Projects/Code")))
(setq projectile-switch-project-action #'projectile-dired))

#+end_src

https://github.com/bbatsov/projectile
https://docs.projectile.mx/projectile/index.html
https://docs.projectile.mx/projectile/projects.html#storing-project-settings
https://www.gnu.org/software/emacs/manual/html_node/elisp/Directory-Local-Variables.html

- Run project =C-c p u=
- Run tests: =C-c p P=
- Edit dir-locals: =C-c p E= (reload with =hack-dir-local-variables-non-file-buffer=)

** counsel-projectile

https://github.com/ericdanan/counsel-projectile

#+begin_src emacs-lisp

(use-package counsel-projectile
:after projectile
:config
(counsel-projectile-mode 1))

#+end_src

- Advanced project switching: =C-c p p=
- Quick searching with =counsel-projectile-rg= - =C-c p s r=
- Results to buffer with =C-c C-o=

* Magit

https://github.com/magit/magit
ttps://magit.vc/
https://magit.vc/manual/magit/

#+begin_src emacs-lisp

(use-package magit
:commands (magit-status magit-get-current-branch)
:custom
(magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1))

(use-package evil-magit
:after magit)

#+end_src

*Operations*

Run =magit-status= in buffer from Git repo, press =?= for command panel.

Refresh buffer with =g r=

- Diffs
- Commit log
- Blame
- Stashes
- Branches
- Rebase
- Pull/push

** Forge

https://github.com/magit/forge
https://magit.vc/manual/forge

Important: https://magit.vc/manual/ghub/Getting-Started.html#Getting-Started

#+begin_src emacs-lisp

(use-package forge)

#+end_src
Loading

0 comments on commit a2101c1

Please sign in to comment.