5

Quick question for those, who are well acquainted with Overleaf: is there a keybinding that enables multiple selection? For example, when I work in the tabular environment, I select one \cellcolor command and see that all other instances of \cellcolor across the table are being put into frame. I would like to know if it possible to have multiple selections, so I can simultaneously edit all of them? I believe there should be some simple trick but I cannot find out. Your advice is appreciated!

  • 1
    Have you posed this question to the Overleaf Helpdesk folks? I hear the LaTeX group is very good. – Mico Jun 30 '20 at 04:29
  • 4
    [Disclaimer/Disclosure: I'm a support personnel at Overleaf.] The source editor currently uses the ACE library, so if you've already highlighted an instance of \cellcolor in the editor, then on Windows Ctrl+Alt+K (or Ctrl+Opt+G on the Mac for me) will also select all other \cellcolor. You can also use Ctrl-F (or Cmd-F on Mac) to open the search dialog; then use the "All" button to perform a bulk replacement. Another way to get multiple cursors at arbitrary locations, is to hold down the Ctrl key (or the Cmd key on a Mac) while clicking on the required locations. – imnothere Jun 30 '20 at 06:08
  • Thank you very much for such a comprehensive answer! I will put it to use tomorrow. – user136555 Jun 30 '20 at 06:14

2 Answers2

10

TL;DR the Ctrl+D as in Sublime Text or VS Code is Ctrl+Alt+Right in Overleaf.

The full list of keyboard shortcuts that work for me in Overleaf to create multiple cursors / selections:

  • Ctrl+Alt+Right (or additionally Ctrl+Alt+L in Vim mode): search for next occurence of word under cursor, add it to selection
  • Ctrl+Alt+Left (or additionally Ctrl+Alt+H in Vim mode): search for previous occurence of word under cursor, add it to selection
  • Ctrl+Alt+Down (or additionally Ctrl+Alt+J in Vim mode): add cursor one line below
  • Ctrl+Alt+Up (or additionally Ctrl+Alt+K in Vim mode): add cursor one line above

For these above, hold also Shift to skip items / lines.

  • Ctrl + click somewhere: add new cursor
  • Alt + click and drag through multiple lines: block selection, add multiple cursors
  • Ctrl+Alt+K if keybindings set to None: select all occurences of text under cursor

Furthermore, if using multiple selections with Vim mode, it's good to know that you need to press Shift+A or Shift+I to enter insert mode.

ha7ilm
  • 216
0

On Mac a more manual approach but similar to SublimeText / Code multi-cursor editing is with the mouse:

  1. Double click the word
  2. Maintain pressed the key
  3. Double click the other words you want to simultaneously edit.

This would put the cursor at the end of all the selected words. But you can arbitrarily put second, third, etc cursors anywhere if you just maintain pressed while you click.

Sdlion
  • 101