Keyboard shortcut to Un/Comment out code in Mathematica 7?

后端 未结 3 1419
广开言路
广开言路 2020-12-24 15:26

A keyboard shortcut to comment/uncomment out a piece of code is common in other programming IDE\'s for languages like Java, .Net. I find it a very useful technique when expe

3条回答
  •  时光说笑
    2020-12-24 15:44

    Here is code for your KeyEventTranslations.tr file that will comment out code. I am still working on the other half.

    Item[KeyEvent["/", Modifiers -> {Command}],
        FrontEndExecute[{
            NotebookApply[FrontEnd`InputNotebook[],
                "(*\[SelectionPlaceholder]*)"
            ]
        }]
    ], 
    

    This binds it to Alt+/ as it is in Mathematica 8.

提交回复
热议问题