Playing with fonts in Emacs and Alacritty.

This commit is contained in:
Derek Taylor 2021-04-16 18:17:35 -05:00
parent f040a34a28
commit d600f28b47
5 changed files with 105 additions and 52 deletions

View File

@ -109,7 +109,7 @@ font:
# - (macOS) Menlo
# - (Linux/BSD) monospace
# - (Windows) Consolas
# family: SauceCodePro Nerd Font
family: Source Code Pro
# family: CodeNewRoman Nerd Font
# family: RobotoMono Nerd Font
# family: Hack
@ -117,7 +117,7 @@ font:
# family: UbuntuMono Nerd Font
# family: Monofur Nerd Font
# family: TerminessTTF Nerd Font
family: Mononoki Nerd Font
# family: Mononoki Nerd Font
# The `style` can be specified to pick a specific face.
style: Regular
@ -128,7 +128,7 @@ font:
#
# If the bold family is not specified, it will fall back to the
# value specified for the normal font.
# family: SauceCodePro Nerd Font
family: Source Code Pro
# family: CodeNewRoman Nerd Font
# family: RobotoMono Nerd Font
# family: Hack
@ -136,7 +136,7 @@ font:
# family: UbuntuMono Nerd Font
# family: Monofur Nerd Font
# family: TerminessTTF Nerd Font
family: Mononoki Nerd Font
# family: Mononoki Nerd Font
# The `style` can be specified to pick a specific face.
style: Bold
@ -147,7 +147,7 @@ font:
#
# If the italic family is not specified, it will fall back to the
# value specified for the normal font.
# family: SauceCodePro Nerd Font Mono
family: Source Code Pro
# family: CodeNewRoman Nerd Font
# family: RobotoMono Nerd Font
# family: Hack
@ -155,7 +155,7 @@ font:
# family: UbuntuMono Nerd Font
# family: Monofuritalic Nerd Font Mono
# family: TerminessTTF Nerd Font
family: Mononoki Nerd Font
# family: Mononoki Nerd Font
# The `style` can be specified to pick a specific face.
style: Italic
@ -166,7 +166,7 @@ font:
#
# If the bold italic family is not specified, it will fall back to the
# value specified for the normal font.
# family: SauceCodePro Nerd Font Mono
family: Source Code Pro
# family: CodeNewRoman Nerd Font
# family: RobotoMono Nerd Font
# family: Hack
@ -174,7 +174,7 @@ font:
# family: UbuntuMono Nerd Font
# family: Monofuritalic Nerd Font Mono
# family: TerminessTTF Nerd Font
family: Mononoki Nerd Font
# family: Mononoki Nerd Font
# The `style` can be specified to pick a specific face.
style: Bold Italic

View File

@ -6,7 +6,6 @@
#+SETUPFILE: https://fniessen.github.io/org-html-themes/org/theme-readtheorg.setup
#+OPTIONS: num:nil ^:{}
* TABLE OF CONTENTS :TOC:
- [[#put-this-in-your-initel][PUT THIS IN YOUR INIT.EL]]
- [[#about-this-config][ABOUT THIS CONFIG]]
@ -21,6 +20,9 @@
- [[#evil-mode][EVIL MODE]]
- [[#finding-files][FINDING FILES]]
- [[#dired][DIRED]]
- [[#keybindings-to-open-dired][Keybindings To Open Dired]]
- [[#keybindings-within-dired][Keybindings Within Dired]]
- [[#keybindings-for-peep-dired-mode][Keybindings For Peep-Dired-Mode]]
- [[#fonts][FONTS]]
- [[#setting-the-font-face][Setting The Font Face]]
- [[#zooming-in-and-out][Zooming In and Out]]
@ -29,7 +31,9 @@
- [[#display-line-numbers-and-truncated-lines][Display Line Numbers and Truncated Lines]]
- [[#change-modeline-to-dooms-modeline][Change Modeline To Doom's Modeline]]
- [[#ivy-counselswiper][IVY (COUNSEL/SWIPER)]]
- [[#ivy-posframe][IVY-POSFRAME]]
- [[#installing-ivy-and-basic-setup][Installing Ivy And Basic Setup]]
- [[#making-m-x-great-again][Making M-x Great Again!]]
- [[#ivy-posframe][Ivy-posframe]]
- [[#language-support][LANGUAGE SUPPORT]]
- [[#magit][MAGIT]]
- [[#org-mode][ORG MODE]]
@ -182,16 +186,26 @@ Though 'recentf' is one way to find recent files although I prefer using 'counse
* DIRED
Dired is the file manager within Emacs. Below, I setup keybindings for image previews (peep-dired). I've chosen the format of 'SPC d' plus 'key'.
| COMMAND | DESCRIPTION | KEYBINDING |
|-------------------------------------------+-------------------------------------------------+------------|
| dired | /Open dired file manager/ | SPC d d |
| dired-jump | /Jump to current directory in dired/ | SPC d j |
| (in dired) peep-dired | /Toggle image previews within dired/ | SPC d p |
| (in dired) dired-view-file | /View file in dired/ | SPC d v |
| (in dired) dired-up-directory | /Go up in the directory tree/ | h |
| (in dired) dired-find-file | /Go down in the directory tree (or open if file)/ | l |
| (in peep-dired-mode) peep-dired-next-file | /Move to next file in peep-dired-mode/ | j |
| (in peep-dired-mode) peep-dired-prev-file | /Move to previous file in peep-dired-mode/ | k |
** Keybindings To Open Dired
| COMMAND | DESCRIPTION | KEYBINDING |
|------------+------------------------------------+------------|
| dired | /Open dired file manager/ | SPC d d |
| dired-jump | /Jump to current directory in dired/ | SPC d j |
** Keybindings Within Dired
| COMMAND | DESCRIPTION | KEYBINDING |
|--------------------+---------------------------------------------+------------|
| dired-view-file | /View file in dired/ | SPC d v |
| dired-up-directory | /Go up in directory tree/ | h |
| dired-find-file | /Go down in directory tree (or open if file)/ | l |
** Keybindings For Peep-Dired-Mode
| COMMAND | DESCRIPTION | KEYBINDING |
|----------------------+------------------------------------------+------------|
| peep-dired | /Toggle image previews within dired/ | SPC d p |
| peep-dired-next-file | /Move to next file in peep-dired-mode/ | j |
| peep-dired-prev-file | /Move to previous file in peep-dired-mode/ | k |
#+begin_src emacs-lisp
(use-package all-the-icons-dired)
@ -218,23 +232,27 @@ Dired is the file manager within Emacs. Below, I setup keybindings for image pr
#+end_src
* FONTS
Defining our fonts.
Defining our fonts. Right now I'm using Source Code Pro (SauceCodePro) from the nerd-fonts repository. Installed from the AUR, it does =NOT= include all variations of the font (such as italics). You can download the italics Source Code Pro font from the nerd-fonts GitHub though.
** Setting The Font Face
#+begin_src emacs-lisp
(set-face-attribute 'default nil
:font "Mononoki Nerd Font 11"
:font "Source Code Pro"
:height 110
:weight 'medium)
(set-face-attribute 'variable-pitch nil
:font "Ubuntu Nerd Font 11"
:font "Ubuntu Nerd Font"
:height 120
:weight 'medium)
(set-face-attribute 'fixed-pitch nil
:font "Mononoki Nerd Font 11"
:font "Source Code Pro"
:height 110
:weight 'medium)
;; Makes commented text italics (working in emacsclient but not emacs)
;; Makes commented text and keywords italics.
;; This is working in emacsclient but not emacs.
;; Your font must have an italic face available.
(set-face-attribute 'font-lock-comment-face nil
:slant 'italic)
;; Makes keywords italics (working in emacsclient but not emacs)
(set-face-attribute 'font-lock-keyword-face nil
:slant 'italic)
@ -242,7 +260,7 @@ Defining our fonts.
(setq-default line-spacing 0.12)
;; Needed if using emacsclient. Otherwise, your fonts will be smaller than expected.
(add-to-list 'default-frame-alist '(font . "Mononoki Nerd Font 11"))
(add-to-list 'default-frame-alist '(font . "Source Code Pro-11"))
;; changes certain keywords to symbols, such as lamda!
(setq global-prettify-symbols-mode t)
#+end_src
@ -281,8 +299,9 @@ Let's make GNU Emacs look a little better.
#+end_src
* IVY (COUNSEL/SWIPER)
Ivy is a generic completion mechanism for Emacs.
Ivy, counsel and swiper are a generic completion mechanism for Emacs. Ivy-rich allows us to add descriptions alongside the commands in M-x.
** Installing Ivy And Basic Setup
#+begin_src emacs-lisp
(use-package counsel
:after ivy
@ -290,12 +309,15 @@ Ivy is a generic completion mechanism for Emacs.
(use-package ivy
:defer 0.1
:diminish
:bind (("C-c C-r" . ivy-resume)
("C-x B" . ivy-switch-buffer-other-window))
:bind
(("C-c C-r" . ivy-resume)
("C-x B" . ivy-switch-buffer-other-window))
:custom
(ivy-count-format "(%d/%d) ")
(ivy-use-virtual-buffers t)
:config (ivy-mode))
(setq ivy-count-format "(%d/%d) ")
(setq ivy-use-virtual-buffers t)
(setq enable-recursive-minibuffers t)
:config
(ivy-mode))
(use-package ivy-rich
:after ivy
:custom
@ -304,14 +326,28 @@ Ivy is a generic completion mechanism for Emacs.
ivy-rich-path-style 'abbrev)
:config
(ivy-set-display-transformer 'ivy-switch-buffer
'ivy-rich-switch-buffer-transformer))
'ivy-rich-switch-buffer-transformer)
(ivy-rich-mode 1)) ;; this gets us descriptions in M-x.
(use-package swiper
:after ivy
:bind (("C-s" . swiper)
("C-r" . swiper)))
#+end_src
** IVY-POSFRAME
** Making M-x Great Again!
The following line removes the annoying '^' in things like counsel-M-x and other ivy/counsel prompts. The default '^' string means that if you type something immediately after this string only completion candidates that begin with what you typed are shown. Most of the time, I'm searching for a command without knowing what it begins with though.
#+begin_src emacs-lisp
(setq ivy-initial-inputs-alist nil)
#+end_src
Smex is a package the makes M-x remember our history. Now M-x will show our last used commands first.
#+begin_src emacs-lisp
(use-package smex)
(smex-initialize)
#+end_src
** Ivy-posframe
Ivy-posframe is an ivy extension, which lets ivy use posframe to show its candidate menu. Some of the settings below involve:
+ ivy-posframe-display-functions-alist -- sets the display position for specific programs
+ ivy-posframe-height-alist -- sets the height of the list displayed for specific programs
@ -427,18 +463,18 @@ This lets us create the various TODO tags that we can use in Org.
** Source Code Block Tag Expansion
Org-tempo is a package that allows for '<s' followed by TAB to expand to a begin_src tag. Other expansions available include:
| Characters Preceding TAB | Expands to ... |
|--------------------------+-----------------------------------------|
| <a | '#+BEGIN_EXPORT ascii' … '#+END_EXPORT |
| <c | '#+BEGIN_CENTER' … '#+END_CENTER' |
| <C | '#+BEGIN_COMMENT' … '#+END_COMMENT' |
| <e | '#+BEGIN_EXAMPLE' … '#+END_EXAMPLE' |
| <E | '#+BEGIN_EXPORT' … '#+END_EXPORT' |
| <h | '#+BEGIN_EXPORT html' … '#+END_EXPORT' |
| <l | '#+BEGIN_EXPORT latex' … '#+END_EXPORT' |
| <q | '#+BEGIN_QUOTE' … '#+END_QUOTE' |
| <s | '#+BEGIN_SRC' … '#+END_SRC' |
| <v | '#+BEGIN_VERSE' … '#+END_VERSE' |
| Typing the below + TAB | Expands to ... |
|------------------------+-----------------------------------------|
| <a | '#+BEGIN_EXPORT ascii' … '#+END_EXPORT |
| <c | '#+BEGIN_CENTER' … '#+END_CENTER' |
| <C | '#+BEGIN_COMMENT' … '#+END_COMMENT' |
| <e | '#+BEGIN_EXAMPLE' … '#+END_EXAMPLE' |
| <E | '#+BEGIN_EXPORT' … '#+END_EXPORT' |
| <h | '#+BEGIN_EXPORT html' … '#+END_EXPORT' |
| <l | '#+BEGIN_EXPORT latex' … '#+END_EXPORT' |
| <q | '#+BEGIN_QUOTE' … '#+END_QUOTE' |
| <s | '#+BEGIN_SRC' … '#+END_SRC' |
| <v | '#+BEGIN_VERSE' … '#+END_VERSE' |
#+begin_src emacs-lisp
(use-package org-tempo
@ -523,7 +559,22 @@ We need a nice colorscheme. The Doom Emacs guys have a nice collection of theme
* 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.
=NOTE:= Which-key has an annoying bug that in some fonts and font sizes, the bottom row in which key gets covered up by the modeline.
#+begin_src emacs-lisp
(use-package which-key)
(use-package which-key
:init
(setq which-key-side-window-location 'bottom
which-key-sort-order #'which-key-key-order-alpha
which-key-sort-uppercase-first nil
which-key-add-column-padding 1
which-key-max-display-columns nil
which-key-min-display-lines 6
which-key-side-window-slot -10
which-key-side-window-max-height 0.25
which-key-idle-delay 0.8
which-key-max-description-length 25
which-key-allow-imprecise-window-fit t
which-key-separator " → " ))
(which-key-mode)
#+end_src

View File

@ -9,7 +9,7 @@
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(package-selected-packages
'(org-tempo all-the-icons-dired which-key vterm use-package toc-org projectile peep-dired org-bullets magit-todos magit-lfs ivy-rich ivy-posframe haskell-mode general evil-collection eshell-syntax-highlighting doom-themes doom-modeline dired-open dashboard counsel)))
'(smex org-tempo all-the-icons-dired which-key vterm use-package toc-org projectile peep-dired org-bullets magit-todos magit-lfs ivy-rich ivy-posframe haskell-mode general evil-collection eshell-syntax-highlighting doom-themes doom-modeline dired-open dashboard counsel)))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.

View File

@ -526,7 +526,8 @@ myKeys =
, ("C-e n", spawn "emacsclient -c -a 'emacs' --eval '(elfeed)'") -- elfeed emacs rss client
, ("C-e s", spawn "emacsclient -c -a 'emacs' --eval '(eshell)'") -- eshell within emacs
, ("C-e t", spawn "emacsclient -c -a 'emacs' --eval '(mastodon)'") -- mastodon within emacs
, ("C-e v", spawn "emacsclient -c -a 'emacs' --eval '(+vterm/here nil)'") -- vterm within emacs
, ("C-e v", spawn "emacsclient -c -a 'emacs' --eval '(vterm nil)'") -- vterm within emacs
, ("C-e w", spawn "emacsclient -c -a 'emacs' --eval '(eww \"distrotube.com\")'") -- vterm within emacs
-- emms is an emacs audio player. I set it to auto start playing in a specific directory.
, ("C-e a", spawn "emacsclient -c -a 'emacs' --eval '(emms)' --eval '(emms-play-directory-tree \"~/Music/Non-Classical/70s-80s/\")'")

View File

@ -1,4 +1,4 @@
-- Base
-- Base
import XMonad
import System.Directory
import System.IO (hPutStrLn)
@ -426,7 +426,8 @@ myKeys =
, ("C-e n", spawn "emacsclient -c -a 'emacs' --eval '(elfeed)'") -- elfeed emacs rss client
, ("C-e s", spawn "emacsclient -c -a 'emacs' --eval '(eshell)'") -- eshell within emacs
, ("C-e t", spawn "emacsclient -c -a 'emacs' --eval '(mastodon)'") -- mastodon within emacs
, ("C-e v", spawn "emacsclient -c -a 'emacs' --eval '(+vterm/here nil)'") -- vterm within emacs
, ("C-e v", spawn "emacsclient -c -a 'emacs' --eval '(vterm nil)'") -- vterm within emacs
, ("C-e w", spawn "emacsclient -c -a 'emacs' --eval '(eww \"distrotube.com\")'") -- vterm within emacs
-- emms is an emacs audio player. I set it to auto start playing in a specific directory.
, ("C-e a", spawn "emacsclient -c -a 'emacs' --eval '(emms)' --eval '(emms-play-directory-tree \"~/Music/Non-Classical/70s-80s/\")'")