1

In LyX, I can define a hot-key for listing-insert. But in this case, what appears is the \begin{lstlisting}...\end{lstlisting} environment. In fact I want to insert a inline listings command \lstinline{...}. There is no predefined lyx command for insert an inline listings. How can I do this?

1

Does the following do what you want?

command-sequence ert-insert; self-insert \lstinline{; char-forward; ert-insert; self-insert }; char-forward; word-backward

Press "alt-x" and insert that in the mini-buffer to test it. If it does what you want, make a shortcut for it.

| improve this answer | |
  • 1
    This can insert ERT for inline listing. However it's not what I really want. I want the xxxx command in command-sequence listing-insert; inset-settings; xxxx; which can set "inline true" for the inset. – goodluck Aug 30 '12 at 5:05
  • @goodluck, ah I see what you mean. I don't know how to automate that. – scottkosty Aug 30 '12 at 6:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.