# Undocumented CodeMirror Shortcuts (multiple selection)

**URL:** <https://talk.observablehq.com/t/undocumented-codemirror-shortcuts-multiple-selection/1294>\
**Category:** Help\
**Created:** [October 9, 2018, 2:06pm UTC](https://talk.observablehq.com/t/undocumented-codemirror-shortcuts-multiple-selection/1294 "2018-10-09T14:06:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zzzev](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/zzzev/32/1113_2.png) [@zzzev](https://talk.observablehq.com/u/zzzev)\
**Post date:** [October 9, 2018, 2:06pm UTC](https://talk.observablehq.com/t/undocumented-codemirror-shortcuts-multiple-selection/1294/1 "2018-10-09T14:06:22Z")

</div>

Hey all, loving using Observable so far.

I noticed that the text input is based on CodeMirror, and allows multiple cursors (via ctrl-click to add/remove a cursor, or alt for rectangular selections). This isn’t listed in the ‘?’ shortcut popup, which kinda makes sense because it’s more about the code editor env than the Observable one. However, I think these aren’t common knowledge and would be good to list there, or somewhere else, especially because CodeMirror’s docs don’t have an obvious listing of their default keybindings (which I think is what’s being used?).

I suspect there are also other undocumented shortcuts; in particular I would love Sublime style ctrl-D for “add next instance of selected to selection”. Currently ctrl-D deletes the current line, and I haven’t been able to find an alternate shortcut that does what I’m looking for, though I know CodeMirror supports this.

There was also [this older discussion](https://talk.observablehq.com/t/is-it-possible-to-enable-the-codemirror-vim-keybindings/411) about enabling custom keybindings; doing that would also resolve this.

---

<div class="post-metadata">

**Author:** ![tom](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/tom/32/2262_2.png) [@tom](https://talk.observablehq.com/u/tom)\
**Post date:** [October 9, 2018, 11:26pm UTC](https://talk.observablehq.com/t/undocumented-codemirror-shortcuts-multiple-selection/1294/2 "2018-10-09T23:26:41Z")

</div>

Hey Zev!

Good question, and that’s right - we don’t currently document the built-in CodeMirror-inherited keybindings, and we should. I’m adding it to my list to add more complete documentation, but for now you can check out [the CodeMirror command documentation](https://codemirror.net/doc/manual.html#commands), which specifies the built-in bindings in gray on the right.

---

<div class="post-metadata">

**Author:** ![zzzev](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/zzzev/32/1113_2.png) [@zzzev](https://talk.observablehq.com/u/zzzev)\
**Post date:** [October 10, 2018, 2:19pm UTC](https://talk.observablehq.com/t/undocumented-codemirror-shortcuts-multiple-selection/1294/3 "2018-10-10T14:19:41Z")

</div>

Thanks for that link. Unfortunately it looks like the selectNextOccurrence command isn’t defined in the default bindings, only the Sublime ones. I’m guessing you probably don’t want to start adding one off bindings like that, so I’ll just say I’m very excited about being able to use alternate bindings at some point in the future 🙂

---

<div class="post-metadata">

**Author:** ![chrispahm](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/chrispahm/32/4203_2.png) [@chrispahm](https://talk.observablehq.com/u/chrispahm)\
**Post date:** [March 26, 2021, 3:07pm UTC](https://talk.observablehq.com/t/undocumented-codemirror-shortcuts-multiple-selection/1294/4 "2021-03-26T15:07:44Z")

</div>

Hey 👋

I’d like to use the opportunity to push this topic again given the current UI overhaul in Observable next ✨

I’d really love to have the Atom/Sublime/VSCode style ctrl-d / cmd-d “selectNextOccurrence” shortcut in Observable 😊 Personally, I think it’s a huge performance boost!

---

<div class="post-metadata">

**Author:** ![tophtucker](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/tophtucker/32/4781_2.png) [@tophtucker](https://talk.observablehq.com/u/tophtucker)\
**Post date:** [March 26, 2021, 4:32pm UTC](https://talk.observablehq.com/t/undocumented-codemirror-shortcuts-multiple-selection/1294/5 "2021-03-26T16:32:25Z")

</div>

One of our engineers working on Next just brought that up the other day! It’s [on our radar](https://github.com/observablehq/feedback/issues/62). Thanks Chris!

---

<div class="post-metadata">

**Author:** ![oscar6echo](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/oscar6echo/32/647_2.png) [@oscar6echo](https://talk.observablehq.com/u/oscar6echo)\
**Post date:** [April 20, 2021, 9:34pm UTC](https://talk.observablehq.com/t/undocumented-codemirror-shortcuts-multiple-selection/1294/6 "2021-04-20T21:34:43Z")

</div>

Ah I’m glad the subject comes to the table !  
It’s one of those small things that matter.

> [@multiple select/edit inside cell ?](https://talk.observablehq.com/t/multiple-select-edit-inside-cell/4457):
>
> I often find myself missing the multi select/edit feature (Ctrl+D shortcut in VS Code). While I realize Observable is not really an IDE, I’m lured by the pleasant editing experience ( +1:t3 for prettier integration). However when the code size increases, editing becomes more frequent. Then some IDE advanced features would help. A typical action is duplicating the content of a cell and modify a bit. This is not critical but I’m floating the idea. I don’t know if this is an isolated wish…?
