Skip to content

Commit

Permalink
Update chapter 5 on addtional QoL, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
nobiot committed Jul 26, 2020
1 parent b23761e commit 6f7b16e
Show file tree
Hide file tree
Showing 11 changed files with 98 additions and 66 deletions.
6 changes: 6 additions & 0 deletions 40.Qol.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ My selection is purely subjective, and aimed at long-form writing as opposed to
- Small aesthetic changes

![Photo by MILKOVÍ on Unsplash](images/milkovi-FTNGfpYCpGM-unsplash.jpg)
<caption>Photo by MILKOVÍ on Unsplash</caption>


## Show Emacs full-screen

This is not configuration. Just to be sure that this is an option you have natively on Windows. Press <kbd>F11</kbd> to toggle the full-screen mode on and off. No need for special configuration in Emacs.

## Set your font

Expand Down
80 changes: 80 additions & 0 deletions 50.Additional-QoL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
## Additional configuration to improve your writing environment

The last chapter shows you how small amount of configuration changes the look & feel of your Emacs -- I believe this is an important part of our writing system. In this section, I will introduce a little more of configuration I have done for myself. This section is also completely optional, and can be used for you to pick and choose ideas you find useful.

![I am writing this guide using the very configuration](images/2020-06-23_23-00-07.png)

To improve my own writing environment, I have made some changes to my Emacs as below. This has made my Emacs better for writing in Markdown files and looks a bit nicer (my subjective judgement):

1. I have installed `markdown-mode` in order to help me write this very guide I am writing with this set up.

2. I have made some changes to configuration in [`.emacs` at the commit before Part 2](https://github.com/nobiot/Zero-to-Emacs-and-Org-roam/blob/a3e74aaef1cebb7b80f44ed5aa6634c4837c4a90/.emacs) and provided explanation of these select changes below

3. Updated packages. See the section below.

### Get `M-x` to remember commands I have used

You seem to call the same command again and again?

Install a package called Smex. That's it. It works out-of-the-box with Ivy with no need for additional configuration.

Now Emacs remembers the commands you have called, and list the immediate last one on top of the `M-x` list.

### Line spacing

```
;;; Line spacing, can be 0 for code and 1 or 2 for text
(setq-default line-spacing 2)
```

The spacing is measured in pixels[^1].

[^1]: Refer to the in-system manual via `C-h v line-spacing RET` -- this is a great way to discover things to help you personalise Emacs.

### Fixed-pitch fonts

The font section of my .emacs now looks like this.

```
;; Font
;;; If you want to know how to correct specify a font in Windows,
;;; invoke `eval-last-sexp' for (w32-select-font)
(set-face-attribute 'variable-pitch nil :font "iA Writer Quattro S-13")
(set-face-attribute 'fixed-pitch nil :font "iA Writer Mono S-12")
(set-face-attribute 'default nil :font "iA Writer Mono S-12")
(set-fontset-font nil 'symbol (font-spec :family "Segoe UI Symbol" :size 11.0))
(add-hook 'text-mode-hook 'variable-pitch-mode)
```

This way, when you are in Markdown or Org mode, you will get variable-pitch font, and fixed-pitch font when you are in programming mode or Helm buffer (e.g. to select a bibliographic entry to cite).

### Stop Emacs from "littering" your folder with #file# and file~

These configurations will stop Emacs creating backup files, etc. I find them annoying. Some of you may find them useful as backup files -- in this case, there is no problem keeping them.

```
;; Avoid #file.org# to appear
(auto-save-visited-mode)
(setq create-lockfiles nil)
;; Avoid filename.ext~ to appear
(setq make-backup-files nil)
```

This one is handy when you are dealing with links and images in Markdown files, in addition to Emacs configuration. It highlights the pair of parentheses and brackets.

```
;; Turn on highlighting the pair of parenthesis when cursor is on one of the pair
(show-paren-mode 1)
```

Refer to the [`.emacs` at the commit before Part 2](https://github.com/nobiot/Zero-to-Emacs-and-Org-roam/blob/a3e74aaef1cebb7b80f44ed5aa6634c4837c4a90/.emacs), and [its history](https://github.com/nobiot/Zero-to-Emacs-and-Org-roam/commit/a3e74aaef1cebb7b80f44ed5aa6634c4837c4a90#diff-1281e836e719f3cdc3750acfe4a4cf89) to see the incremental changes.

### Updating (upgrading) packages installed

`M-x package-list-packages` or equivalently `M-x list-packages`, and then in the list <kbd>Shift</kbd> + <kbd>U</kbd> to mark packages installed. Press <kbd>X</kbd> to execute the update.

![`Shift` + `U` to mark those installed, and `x` to execute](images/2020-06-20_18-51-46.png)

```
Package menu: Operation finished [Upgraded 7]
```
64 changes: 0 additions & 64 deletions 50.Part2.md

This file was deleted.

10 changes: 10 additions & 0 deletions 60.Org-ref_ORB.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Part 2

In Part 2, I will explore a new territory. I will be also learning along the way with you.

I do not use Org-ref, nor Org-ref-bibtex. For my own notes, I use markdown files, and my own plug-in for Org-roam to support them ([Md-roam](https://github.com/nobiot/md-roam)). For bibliographic notes, instead of Org-ref, I just use `helm-bibtex` with customization for Pandoc Markdown format.

Having said this, I am making sure that I am building this guide as accurately as possible, while I configure and use the features I describe here.

You can judge the validity and usefulness of my guide from the outcome. All is open here in GitHub, so you can check what I am writing is correct or not. I will appreciate your feedback or correction.

## Set up Org-ref and Org-roam-bibtex (ORB)

In this section, we will look at how to quickly set up ORB together with Org-ref to manage your bibliographic notes.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ Part 1
2. [Use Emacs to write some text (including copy & paste)](./20.Use-Emacs.md)
3. [Set up Org-roam (including sqlite3)](./30.Set-up-Org-roam.md)
4. [Improve quality-of-life with your font, theme, and minimal select packages ](./40.Qol.md)
5. [Some more quality-of-life improvements for your typography -- font variations and line-spacing -- and other things](./50.Additional-QoL.md)

The config file at the end of Part 1 is [located in this repo](https://github.com/nobiot/Zero-to-Emacs-and-Org-roam/blob/926c0f07708514bbdc6952dc3bac520d8668cbc1/.emacs), too. Refer to [its history](https://github.com/nobiot/Zero-to-Emacs-and-Org-roam/commits/main/.emacs) if you wish to see the incremental changes as we move along advanced chapters.

![What your Emacs will look like at the end of Part 1](images/2020-06-16_21-32-39.png)

Part 2

5. [Some more quality-of-life improvements for your typography -- font variations and line-spacing -- and other things](./50.Part2.md)
6. [Set up Org-ref and Org-roam-bibtex (ORB)](./60.Org-ref_ORB.md)
7. [Export to MS Word](./70.publish.md)
8. [Set up a spell checker (Hunspell, including how to get it)](./80.Spell-checker.md)
Expand All @@ -28,7 +28,7 @@ Part 3

I consider the following "extra" features because they require a certain level of "hacking the system". I suggest that you selectively decide whether or not you would like to take on the challenges, depending on your familiarity wth the technical stuff on Windows.

9. [Set `org-protocol`, `org-roam-graph`, and `org-roam-server` (incl. Windows registry)](./90.org-protocol.md)
9. [Set up `org-protocol`, `org-roam-graph`, and `org-roam-server` (incl. Windows registry)](./90.org-protocol.md)
10. (maybe) How to swap CapsLock with Ctrl
11. (maybe) Org-noter (incl. How to open PDF within Emacs on Windows)
12. (maybe) Export to PDF
Expand Down
Binary file modified images/2020-06-16_21-32-39.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/2020-07-16_19-09-13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/2020-07-18_12-37-28.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/2020-07-18_13-46-15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/2020-07-18_13-50-35.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/2020-07-18_15-58-23.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6f7b16e

Please sign in to comment.