Search code examples
rknitrlyx

Setting up a shortcut for knitr chunk in Lyx


I'm new to Lyx and would very much like to set up a new shortcut for inserting a new Chunk (Insert > Custom Insets > Chunk)

I saw here how to set one up, but this is not the same; the Chunk menu item from the Custom Insets doesn't require the <<>>= and @ characters in the chunks.

Any help appreciated on how to (if possible) assign this command to a new shortcut.


Solution

  • Here's how to do it, thanks to scottkosty's instructions on tex.

    Go to Tools > Preferences > Editing > Shortcuts and create a new shortcut entering the following text as the function:

    flex-insert "Chunk"

    Then, just assign a key combination to it and you're done.