Using the menu entry Insert > Formatting > Horizontal Line I can insert a WYSIWYG horizontal line into a LyX document. I want to figure out the internal command(s) used to do this so I can set up a binding to do this via a keyboard shortcut. However, Tools > Preferences > Editing > Shortcuts doesn't show anything, and the functions listed under Help > LyX Functions doesn't show anything either.
I could make a binding to insert the \hrulefill LaTeX command, but that wouldn't be WYSIWYG.
Looking in the .lyx
file, I can see that a WYSIWYG line is done by:
\begin_layout Standard
\begin_inset CommandInset line
LatexCommand rule
offset "0.5ex"
width "100col%"
height "1pt"
\end_inset
\end_layout
However, using a command-sequence
of multiple self-insert
to insert those lines one after the other doesn't work.
I'm using LyX version 2.1.2
Best Answer
Go to View > Messages Pane:
Then click on the "Settings" tab in the bottom right corner:
Then click on the "Selected" radio button:
Then double click on "User commands" so that "no" turns to "yes":
Then click on the "Output" tab:
Then do the action that you want to copy the shortcut of. In this case, insert your horizontal line. In the output tab at the bottom, you will see:
This tell us that the correct command is:
Verify that the command is correct by inserting it directly into the mini buffer (Alt + X or View > Toolbars > Command Buffer) at the bottom of the screen:
Run the command by pressing return. If it has the desired effect, then you know you have the right command and can create the shortcut in the usual way.
Note that you can have one shortcut do multiple commands by using
command-sequence
.