Using emacs to edit Gemini files

Go back

Todo: Add links to sources when you get power

Everyone knows emacs is the best text editor ever made so it makes sense you would wanted to edit .gmi files with it.

This page has no advanced "modifications" and is meant mostly for begginers such as myself. I just summed up what already existing features can be used to make current gemini markdown writing more comfortable

Optimizing gemini-mode

gemini-mode is pretty great and (to my knowledge) covers entire gemini markdown syntax (which is not that much but still). There are however some tweaks that can make it's editing even better.

Gemini markdown limitations

First of all gemini treats all \n as hard wraps and recommends using softwrap in editor which doesnt really look good in emacs by default - the words are split just how they go, they go over the enitre screen and overall it's not very pretty.

However there some built-in and installable packages that can make softwrapping look like hard wrapping and thus making writing in gemini less painful.

The actuall customization code

Without any further bloat here are the things you can set:

1. visual-line-mode

Visual line mode soft-wraps your text on lenght set by the fill-column variable. I recomend putting this to 130 or some prefered lenght. Normally you can the variable by pressing C-x f or if you want it to have always your value you can put this in your .emacs file.

(setq-default fill-column 130)

2. visual-fill-column-mode

This does exactly what standard auto-fill-mode does but with just soft-wraps. Making it work better for gemini editing

You can activate both mods on every gemini file by adding these lines:

(add-hook 'gemini-mode-hook 'visual-fill-column-mode)
(add-hook 'gemini-mode-hook 'visual-line-mode)