How can I create a keyboard shortcut for highlighting text in LO Writer?

I have set a custom KB shortcut under Tools → Customize → Keyboard but it isn’t working. Any help would be appreciated.

1 Like

Highlighting text is not an “action” on text. It is an additional attribute on a character.

To achieve your goal, you must first define a character style with the specific colour selected as Background. Give a name to this style. You can now give it a keyboard shortcut.

This shortcut is not auto-toggling like Ctrl+B or I. I suggest you also associate a keyboard shortcut to character style Default Style so that you can cancel the effect of highlighting from the keyboard.

To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

Thanks a lot @ajlittoz I followed your logic and it worked. I created a character style (corrected by your bold text since I had first created a paragraph style) then assigned it a shortcut. But to undo the highlighting, I created another character style calling it “Unhighlight” then assigned it a shortcut. I’m so happy to have this shortcut as it will save me much time when typing. Thank you very much. Unfortunately I can’t upvote your answer since I have less than 5 points. All the same, you’ve been of great help.

CAUTION! Applying a style with forced highlighting “None” is not the same as having no character style applied. If you want to cancel your highlighting style, it is better to apply Default Style character style. It is not a real style. Its effect is to remove any character style to restore formatting state to the one defined in the current paragraph style. This is why I gave you this advice.

Thanks for that. I’ve just implemented your advice and it works well. Strangely though, upon closing Writer, my shortcut is not saved. The name of the new character style is no longer displaying in the “Category” and “Function” boxes while the shortcut key in the “Shortcut Keys” box is replaced by a string which looks like a reference. Is there something I am doing wrongly? By the way this happened even before implementing your followup advice.

I tested it just now. The shortcut is kept after close/reopen as expected. My OS is Linux.

Shortcuts are stored in user profile. Path to it is hinted in Tools>Options, LibreOffice>Paths. Check that write permission is enable on the main directory and all others above it.

I’m using Win 10 and I’ve seen that the new character style and its shortcut are saved with the open document. If I reopen the document used to create the new style, both the style and shortcut are present and working. If I open a new Writer document, the style is missing and the s/cut indicates a reference instead of the KB keys set for the shortcut. I’m thinking of creating a template which has the s/cut working and using that.

Custom styles are always stored in the document. It is intentional. I don’t know for shorcuts and, effectively, I reopened the same document. Consequently, my test is not conclusive.

A template is the recommended way to ensure all documents will look the same. It is also an excellent idea to store shortcuts inside.

You’ve been of great help. Thanks and God bless you.

Thanks for the help.

Creation of a new Character style e.g. HL_YELLOW
apply highlighting yellow and save the new HL_YELLOW character style.


Click into the shortcuts->type the desired shorctcut. e.g. CTRL+H

Into the function, Styles→Character→HL_YELLOW

Remark:we shouldn’t have to go to ‘Styles→Character’. Typing HL_YELLOW should be enough!

Click on ‘modify’

Do the same a same for CTRL+SHIFT+H and assign ‘default character style’.It is not a toggle. It means we put back the ‘default character style’.

Click on ‘OK’



To the developers of Libre Office.
In the keyboard shortcuts we can find 2x ‘Highlight Color’ and 1x ‘Highlight fill’.
It is misleading and fustrating to allow the user to assign those functions to keyboard shortcuts with no effect at all!
If the function can’t be used then do not list it!
Read above. We should be able to type HL_YELLOW and assign it to a shortcut. This is extremely frustrating…


First, this is not an answer to the question.

Next, the audience here is peers - we are users just as you are and trying to help others with our experience.

Finally, all feature requests should be made to Bugzilla. See → Feature Requests

Thanks for the suggestion. I will fill a ‘feature request’.