how to shortcut to em dash

would anyone be so kind to teach me haw to set a shortcut to type em dashes
like e.g. [CTRL]+[-]
OR [CTRL]+[SHIFT]+[-]
I mean, something that does not break the workflow and let me feel comfortable when writing some short stories.
I know :—: does the thing, but oh! five shots for just one character…
Or [compose key] + —. The same four shots for a single character.
Or – [space] + [backspace] (auto correct way) Again: four keys to one character (I don’t want a space between the dash and the word).
Those options are not comfortable.

I just would like to use writer to write.

I tried to set up a macro but i couldn’t. I am not smart enough. But shure there is a better and easier way.
I use Libreoffice 6.0 and I find it great.

I use MX Linux 17 (Debian 9 base)

1 Like

In Linux, you can (relatively) easily modify your keyboard layouts to your needs and to hook em-dash to, say, AltGr + -. Read this topic (in Russian).

One more comment:

I know :—: does the thing

You can create an autocorrect entry with, say, :--: in Replace and in With. Well, just two strokes.

Thank you gabix, I think I will need to learn to modifiy the keyboard through the os.
And I did not understand your second suggestion.

See RGB-es’s more detailed answer, I meant the same thing. If you follow it, you’ll be able to get A—B simply typing A--B.

There is an autocorrect that do not need spaces: :--: As soon as you insert the second colon, an en-dash will be inserted. To insert an em-dash: :---:

EDIT: That means that you can define your own autocorrects, for example changin :n: by an en-dash.

image description

just pick the right language :wink:

1 Like

:slight_smile: well - OP has mentioned that (in the section “too many keystrokes”)

@mikekaganski ups! I edited the answer: I hope that three keys are OK :wink:

@RGB-es: let’s wait what OP thinks :wink:

Thank you. To create autocorrect replacement like :n: is not that bad.
I’ll see if i get used to it.

If you’re just using em-dashes for stylistic breaks—like this—the built-in dash conversion should do what you need.

Make sure it’s enabled: Tools > AutoCorrect> AutoCorrect Options > Options and select “Replace Dashes”.

Then, when you type a word, two hyphens, another word, and finally a space, the two hypens will be replaced with an em-dash.

This might not work perfectly in all circumstances, but for the usual case, it’s as easy as can be.

Otherwise, I might be inclined to use the AutoCorrect replacement table to replace a triple hypen with an em-dash, without the usual surrounding colons, as suggested elsewhere.

Not only for sylistic breaks. In spanish, dashes (em-dashes, also called as Dialog bar (raya de diálogo)) are used also to indicate that someone is speaking (with his own voice), at the begining of the sentece. As quotes ( ’ ), are used in english instead for the same purpose. So, it is a very, very used typo if you write literature.

But then a space is expected between the dash and the first word, isn’t it? (at least in Russian, it is) - it’s better to consult language-specific normative guides…

Well, I think i found a solution at the Operating System level.
Modifying the keyboard map with the command xmodmap.
I realized that on my keyboard layout (Spanish - Latin American) [AltGr] + [1] did the same as [AltGr] + [<], they both typed the vertical bar “|”. And also the key at the left of [1] typed the same symbol. To much redundancy for a symbol that I barely use.
So, I decided to modify the [<] key, so [AltGr] + [<] result in the em-dash.

With this command:

xmodmap -e “keycode 94 = less greater less greater emdash brokenbar bar”

I read this: Modifica la configuración de tu teclado con Xmodmap | Desde Linux
and this: Remapear teclas de SLIMBOOK, simbolos programadores: menos que, mayor, etc - SLIMBOOK: ultrabooks, portátiles y ordenadores GNU/Linux

Although, I think LO should give an option for writers to do this kind of things.

I have just found a little app called Focus writer that types the emdash with the [ctrl]+[-] combo. Which is very good.

xmodmap -e “keycode 94 = less greater less greater emdash brokenbar bar”

Good choice, I see the “|” symbol written on the “1” key, that doesn’t happen on the “<” key. Also, doing that at the operating system level is useful for every program.

For making it permanent, I executed:

echo "keycode 94 = less greater less greater emdash brokenbar bar" >> ~/.Xmodmap

Thank you very much for all the information, God bless you :slight_smile:

You can use the – for this: – (dash)

Why not create a new one?

— for — (em dash)

Just edit in AutoCorrection. It’s really easy.

More information: AutoCorrect

See also https://wiki.documentfoundation.org/images/0/0d/WG54-WriterGuideLO.pdf (Using AutoCorrect;
page 62ff)

the user’s point is “I don’t want a space between the dash and the word” - so the entry needs to take that into account (using .* syntax)