Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
IDE Tip: CTRL/CMD click for multi-cursor editing

One of the most entertaining experiences of being a developer is learning about an awesome feature that you never knew existed in your own application. This happened to me today, and I suspect I'm not the only one (or even the only Quantopian employee!) who didn't know that this feature existed.

If you hold the Control key (or the Command key if you're on OSX), and click multiple times in the Quantopian IDE, the UI will create a new cursor at each location where you clicked. If you then start typing, the IDE will insert text at each location where you have a cursor! This is super useful if you ever want to perform the same sequence of keystrokes on multiple lines (e.g. if you want to change a bunch of invocations of order`into order_target.

As it turns out this is actually feature of the excellent CodeMirror Javascript library, which powers not only our IDE, but also the IPython Notebook project on top of which we've built our new Research Environment...which means multiple-cursor editing also works in Research!

Happy Parallel Editing,
-Scott

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

3 responses

And Shift + Alt + Mouse gives you a columnar selection cross (+) which is a whole lot easier than multi-Ctrl clicking. (Note: Shift + Alt + keyboard / mouse is Visual Studio's columnar editing magic.)

Thanks Scott, glad to know that.
MT I'll see your VS magic and raise you that the find, date and dollar fields all have undo with ctrl-z. :)

Awesome -- feels like the matrix. Need the old green on black theme from the 90s!