How to create custom shortcut for new paragraph in X style?

I am able to create a custom keyboard shortcut to set the style of the paragraph in which my cursor is placed (Tools>Customize). But I want to be able to create a new paragraph and switch style at the same time.

This will be extremely useful for anyone who is beginning to use styles, and is breaking the habit of alternating between line-breaks and paragraph-breaks, which I’ve been doing for many years on MS Word.
The idea is to have two general text body styles:

  • A with no space below paragraph (like a line-break). Assigned Shift + Enter (same keys as line-break)
  • B with space below paragraph (like MS default paragraph break). Assigned CTRL + Shift + Enter if not Enter.

I am using Linux Mint System Package.

What is a paragraph?

What you describe is only one paragraph with the same style. Usually I don’t even use line-breaks much, but just continue writing and Writer shall fit this according to the used style.
.
If necessary/useful you can set a following style in a style definition. So you may in most cases seldom set a style yourself.
.
Edit/PS:
If I really needed a customized paragraph to be inserted by shortcut, I’d maybe use an “autotext” at insertion point, but I’d never try to replace enter or shift-enter:
https://help.libreoffice.org/latest/en-US/text/swriter/guide/autotext.html
https://help.libreoffice.org/latest/en-US/text/swriter/guide/autotext.html

`What you describe is only one paragraph with the same style.

I think you misunderstood. I do NOT want to use line-breaks. I used to use line-breaks instead of paragraph-breaks, but figured this causes formatting issues. And no, I think I clearly distinguish the two paragraph styles: one with no space below paragraph. The other with space below paragraph. As the “indents/spacing” dialogue box when modifying a paragraph styles.

You need two paragraph styles.
Use the Body Text paragraph style for “without space” (it’s 0,25 cm).
Derive the second paragraph style from Body Text (e.g. Body Text Space).
In this paragraph style, set the value for “Below the paragraph” to e.g. 0.7 cm for indents and spacing.


To delve deeper into the subject matter, use the existing manual chapters for Writer.

You need two paragraph styles.

Yes, that’s what I said. Perhaps I caused confusion in saying “text body style.” I was not referring specifically to the style entitled that, but meant I would create customs which would be used in the body of my text.
They are already created.
The purpose of this question, is to try find a shortcut to enable me to switch between the two styles as quick as possible while writing.

“Body Text” already has the assignment Ctrl+0.
Ctrl+7 is still free.



Select Tools > Customise in the menu and select Keyboard tab in the “Customise” dialogue to make the assignment for “Body Text Space”.



Now you can switch from Ctrl+7 to Ctrl+0 etc.

105492 HB Two Paragraph styles.odt (20,1 KB)

Enter is so special that you can’t assign any shortcut to it or its variations with modifiers.

Define two AutoText entries containing Enter + paragraph style change after the paragraph break.

However, IMHO, this is less user-friendly than typing the paragraph break then a shortcut to chenge the style. AutoText is requested by typing its alias followed by F3, i.e. more keystrokes and you must take care the alias does not merge with any preceding alphabetic text.