# 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)

edit retag close merge delete

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).

( 2018-10-26 09:33:18 +0100 )edit

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.

( 2018-10-26 10:37:21 +0100 )edit

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.

( 2018-10-27 18:48:04 +0100 )edit

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.

( 2018-10-27 18:54:41 +0100 )edit

Sort by » oldest newest most voted

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.

more

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.

( 2018-10-27 18:26:25 +0100 )edit

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...

( 2018-10-27 22:32:39 +0100 )edit

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.

just pick the right language ;)

more

:-) well - OP has mentioned that (in the section "too many keystrokes")

( 2018-10-26 12:35:27 +0100 )edit

@Mike Kaganski ups! I edited the answer: I hope that three keys are OK ;)

( 2018-10-26 12:42:57 +0100 )edit

@RGB-es: let's wait what OP thinks ;-)

( 2018-10-26 12:43:45 +0100 )edit

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

( 2018-10-27 19:01:12 +0100 )edit

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: https://blog.desdelinux.net/modifica-... and this: https://slimbook.es/tutoriales/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.

more

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

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)