Underscores in markdown

In markdown, _italic_ starts with the same character that fires a blank. blank-trigger-mode decides when a typed _ counts: the instant it is typed, or only once a space confirms it.

Underscores in markdown

The two modes

blank-trigger-modeBehaviour
immediatethe default: _ fires the moment it is typed at the end of your text
spaced_ is inert until a space follows it; _italic_ completes untouched, and a real blank costs one extra keystroke

The problem spaced solves

Typing emphasis should not summon an answer.

you type

make it _italic_ please

you get

make it _italic_ please

In spaced mode the first _ is just a character, so the closing one can be typed. A real request fires on its confirming space:

you type

the capital of japan is _ 

you get

the capital of japan is Tokyo

Which mode where

Spaced suits anywhere _ means emphasis: Reddit, GitHub, Discord, any markdown-aware page in the browser. Immediate suits terminals and plain inputs, where an underscore almost always means a blank and the extra space would only slow you down.

Setting it

Set blank-trigger-mode: spaced in ~/.cues/OPENCUES.md, or cycle it from the settings blank: opencues settings _. Changes are picked up within about two seconds.