GNU Emacs config from video: Leaving Doom For GNU Emacs

This commit is contained in:
Derek Taylor
2021-04-15 20:57:03 -05:00
parent 5cc0835f5e
commit a6f211a7b5
+37 -20
View File
@@ -16,6 +16,8 @@
- [[#all-the-icons][ALL THE ICONS]] - [[#all-the-icons][ALL THE ICONS]]
- [[#general-keybindings][GENERAL KEYBINDINGS]] - [[#general-keybindings][GENERAL KEYBINDINGS]]
- [[#dashboard][DASHBOARD]] - [[#dashboard][DASHBOARD]]
- [[#configuring-dashboard][Configuring Dashboard]]
- [[#dashboard-in-emacsclient][Dashboard in Emacsclient]]
- [[#evil-mode][EVIL MODE]] - [[#evil-mode][EVIL MODE]]
- [[#finding-files][FINDING FILES]] - [[#finding-files][FINDING FILES]]
- [[#dired][DIRED]] - [[#dired][DIRED]]
@@ -30,8 +32,8 @@
- [[#ivy-posframe][IVY-POSFRAME]] - [[#ivy-posframe][IVY-POSFRAME]]
- [[#magit][MAGIT]] - [[#magit][MAGIT]]
- [[#org-mode][ORG MODE]] - [[#org-mode][ORG MODE]]
- [[#enabling-org-bullets][Enabling Org Bullets]]
- [[#defining-a-few-things][Defining A Few Things]] - [[#defining-a-few-things][Defining A Few Things]]
- [[#enabling-org-bullets][Enabling Org Bullets]]
- [[#org-link-abbreviations][Org Link Abbreviations]] - [[#org-link-abbreviations][Org Link Abbreviations]]
- [[#org-todo-keywords][Org Todo Keywords]] - [[#org-todo-keywords][Org Todo Keywords]]
- [[#source-code-block-tag-expansion][Source Code Block Tag Expansion]] - [[#source-code-block-tag-expansion][Source Code Block Tag Expansion]]
@@ -121,7 +123,9 @@ General.el allows us to set keybindings. As a longtime Doom Emacs user, I have
#+end_src #+end_src
* DASHBOARD * DASHBOARD
Emacs Dashboard is an extensible startup screen showing you recent files, bookmarks, agenda items and an Emacs banner. Emacs Dashboard is an extensible startup screen showing you recent files, bookmarks, agenda items and an Emacs banner.
** Configuring Dashboard
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package dashboard (use-package dashboard
:ensure t ;; install dashboard if not installed :ensure t ;; install dashboard if not installed
@@ -144,12 +148,12 @@ General.el allows us to set keybindings. As a longtime Doom Emacs user, I have
(bookmarks . "book")))) (bookmarks . "book"))))
#+end_src #+end_src
This setting ensures that emacsclient always opens on *dashboard* rather than *scratch*. ** Dashboard in Emacsclient
This setting ensures that emacsclient always opens on *dashboard* rather than *scratch*.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq initial-buffer-choice (lambda () (get-buffer "*dashboard*"))) (setq initial-buffer-choice (lambda () (get-buffer "*dashboard*")))
#+end_src #+end_src
* EVIL MODE * EVIL MODE
Evil is an extensible 'vi' layer for Emacs. It emulates the main features of Vim, and provides facilities for writing custom extensions. Evil Collection is also installed since it adds 'evil' bindings to parts of Emacs that the standard Evil package does not cover, such as: calenda, help-mode adn ibuffer. Evil is an extensible 'vi' layer for Emacs. It emulates the main features of Vim, and provides facilities for writing custom extensions. Evil Collection is also installed since it adds 'evil' bindings to parts of Emacs that the standard Evil package does not cover, such as: calenda, help-mode adn ibuffer.
@@ -229,7 +233,8 @@ Dired is the file manager within Emacs. Below, I setup keybindings for image pr
:font "SauceCodePro Nerd Font 11" :font "SauceCodePro Nerd Font 11"
:weight 'medium) :weight 'medium)
;;(setq-default line-spacing 0.10) ;; Uncomment the following line if line spacing needs adjusting.
;; (setq-default line-spacing 0.10)
;; Needed if using emacsclient. Otherwise, your fonts will be smaller than expected. ;; Needed if using emacsclient. Otherwise, your fonts will be smaller than expected.
(add-to-list 'default-frame-alist '(font . "SauceCodePro Nerd Font 11")) (add-to-list 'default-frame-alist '(font . "SauceCodePro Nerd Font 11"))
@@ -242,12 +247,13 @@ You can use the bindings CTRL plus =/- for zooming in/out. You can also use CTR
;; zoom in/out like we do everywhere else. ;; zoom in/out like we do everywhere else.
(global-set-key (kbd "C-=") 'text-scale-increase) (global-set-key (kbd "C-=") 'text-scale-increase)
(global-set-key (kbd "C--") 'text-scale-decrease) (global-set-key (kbd "C--") 'text-scale-decrease)
;;(global-set-key (kbd "C-0")'(lambda () (interactive) (text-scale-adjust 0)))
(global-set-key (kbd "<C-wheel-down>") 'text-scale-decrease)
(global-set-key (kbd "<C-wheel-up>") 'text-scale-increase) (global-set-key (kbd "<C-wheel-up>") 'text-scale-increase)
(global-set-key (kbd "<C-wheel-down>") 'text-scale-decrease)
#+end_src #+end_src
* GRAPHICAL USER INTERFACE TWEAKS * GRAPHICAL USER INTERFACE TWEAKS
Let's make GNU Emacs look a little better.
** Disable Menu, Toolbars and Scrollbars ** Disable Menu, Toolbars and Scrollbars
#+begin_src emacs-lisp #+begin_src emacs-lisp
(menu-bar-mode -1) (menu-bar-mode -1)
@@ -346,25 +352,19 @@ Available functions (positions) for 'ivy-posframe-display-functions-alist'
#+end_src #+end_src
* MAGIT * MAGIT
A git client for Emacs. Often cited as a killer feature for Emacs.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package magit (use-package magit
:ensure t) :ensure t)
(use-package magit-lfs
:ensure t)
(use-package magit-todos (use-package magit-todos
:ensure t :ensure t
:config (magit-todos-mode)) :config (magit-todos-mode))
#+end_src #+end_src
* ORG MODE * ORG MODE
Org Mode is THE killer feature within Emacs. But it does need some tweaking.
** Enabling Org Bullets
#+begin_src emacs-lisp
(use-package org-bullets
:ensure t)
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
#+end_src
** Defining A Few Things ** Defining A Few Things
#+begin_src emacs-lisp #+begin_src emacs-lisp
(add-hook 'org-mode-hook 'org-indent-mode) (add-hook 'org-mode-hook 'org-indent-mode)
@@ -382,8 +382,17 @@ Available functions (positions) for 'ivy-posframe-display-functions-alist'
org-edit-src-content-indentation 0) org-edit-src-content-indentation 0)
#+end_src #+end_src
** Enabling Org Bullets
Org-bullets gives us attractive bullets rather asterisks.
#+begin_src emacs-lisp
(use-package org-bullets
:ensure t)
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
#+end_src
** Org Link Abbreviations ** Org Link Abbreviations
This allows for the use of abbreviations that will get expanded out into a lengthy URL. This allows for the use of abbreviations that will get expanded out into a lengthy URL.
#+begin_src emacs-lisp #+begin_src emacs-lisp
;; An example of how this works. ;; An example of how this works.
@@ -396,7 +405,7 @@ Available functions (positions) for 'ivy-posframe-display-functions-alist'
#+end_src #+end_src
** Org Todo Keywords ** Org Todo Keywords
This lets us create the various TODO tags that we can use in Org. This lets us create the various TODO tags that we can use in Org.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq org-todo-keywords ; This overwrites the default Doom org-todo-keywords (setq org-todo-keywords ; This overwrites the default Doom org-todo-keywords
@@ -433,6 +442,8 @@ Org-tempo is a package that allows for '<s' followed by TAB to expand to a begin
#+end_src #+end_src
** Source Code Block Syntax Highlighting ** Source Code Block Syntax Highlighting
We want the same syntax highlighting in source blocks as in the native language files.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq org-src-fontify-natively t (setq org-src-fontify-natively t
org-src-tab-acts-natively t org-src-tab-acts-natively t
@@ -441,7 +452,7 @@ Org-tempo is a package that allows for '<s' followed by TAB to expand to a begin
#+end_src #+end_src
** Automatically Create Table of Contents ** Automatically Create Table of Contents
Toc-org helps you to have an up-to-date table of contents in org files without exporting (useful useful for README files on GitHub). Use :TOC: to create the table. Toc-org helps you to have an up-to-date table of contents in org files without exporting (useful useful for README files on GitHub). Use :TOC: to create the table.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package toc-org (use-package toc-org
@@ -459,6 +470,8 @@ Org-tempo is a package that allows for '<s' followed by TAB to expand to a begin
#+end_src #+end_src
* SCROLLING * SCROLLING
Emacs' default scrolling is annoying because of the sudden half-page jumps. Also, I wanted to adjust the scrolling speed.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq scroll-conservatively 101) ;; value greater than 100 gets rid of half page jumping (setq scroll-conservatively 101) ;; value greater than 100 gets rid of half page jumping
(setq mouse-wheel-scroll-amount '(3 ((shift) . 3))) ;; how many lines at a time (setq mouse-wheel-scroll-amount '(3 ((shift) . 3))) ;; how many lines at a time
@@ -503,9 +516,11 @@ Adding packages for programming langauges, so we can have nice things like synta
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package haskell-mode (use-package haskell-mode
:ensure t) :ensure t)
#+end_src #+end_src
* THEME * THEME
We need a nice colorscheme. The Doom Emacs guys have a nice collection of themes, so let's install them!
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package doom-themes) (use-package doom-themes)
(setq doom-themes-enable-bold t ; if nil, bold is universally disabled (setq doom-themes-enable-bold t ; if nil, bold is universally disabled
@@ -514,6 +529,8 @@ Adding packages for programming langauges, so we can have nice things like synta
#+end_src #+end_src
* WHICH KEY * WHICH KEY
Which-key is a minor mode for Emacs that displays the key bindings following your currently entered incomplete command (a prefix) in a popup.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package which-key) (use-package which-key)
(which-key-mode) (which-key-mode)