# Via UX prompt: Ctrl-F to find code in someone's notebook

**URL:** https://talk.observablehq.com/t/via-ux-prompt-ctrl-f-to-find-code-in-someones-notebook/1460
**Category:** Uncategorized
**Created:** [December 4, 2018, 10:29pm UTC](https://talk.observablehq.com/t/via-ux-prompt-ctrl-f-to-find-code-in-someones-notebook/1460 "2018-12-04T22:29:19Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![thadk](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/thadk/32/251_2.png) [@thadk](https://talk.observablehq.com/u/thadk)
#### Post date: [December 4, 2018, 10:29pm UTC](https://talk.observablehq.com/t/via-ux-prompt-ctrl-f-to-find-code-in-someones-notebook/1460/1 "2018-12-04T22:29:19Z")

</div>

I saw Tom’s solicitation on Twitter and wanted to share my early UX challenge.

The problem is simple and I’d be surprised if no one else had encountered it: If I know that a long notebook uses a little snippet of code, I haven’t noticed a way to pop open all the cells at one time to search them to find the correct cell, say with ctrl-f, besides exporting it.

Good luck and keep up the good work.

---

<div class="post-metadata">

### Author: ![mbostock](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbostock/32/9_2.png) [@mbostock](https://talk.observablehq.com/u/mbostock)
#### Post date: [December 4, 2018, 11:32pm UTC](https://talk.observablehq.com/t/via-ux-prompt-ctrl-f-to-find-code-in-someones-notebook/1460/2 "2018-12-04T23:32:44Z")

</div>

Not an ideal solution, but you can use Safe mode for this: Safe mode shows all the code (and only the code) for your notebook. To access Safe mode, either add `/safe` to the URL in the address bar, or from your profile, click on the little menu for your notebook and then click Safe mode.

(Because Observable syncs your changes in realtime as you commit them, you can also develop notebooks in safe mode and non-safe mode in two side-by-side windows, if you prefer that style of development.)

---

<div class="post-metadata">

### Author: ![thadk](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/thadk/32/251_2.png) [@thadk](https://talk.observablehq.com/u/thadk)
#### Post date: [December 5, 2018, 7:41am UTC](https://talk.observablehq.com/t/via-ux-prompt-ctrl-f-to-find-code-in-someones-notebook/1460/3 "2018-12-05T07:41:20Z")

</div>

Thanks, I had heard of Safe Mode once but hadn’t remembered to use it like that.

The parenthetical method is pretty cool. The websocket sync capability perhaps conflicts with the “safe mode” name: it is a hidden side effect, albeit of the “backend” still being smart, even if the front-end is mostly not.

Happy to resolve this if it’s best.

---

<div class="post-metadata">

### Author: ![Job](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/job/32/1185_2.png) [@Job](https://talk.observablehq.com/u/Job)
#### Post date: [December 5, 2018, 10:14am UTC](https://talk.observablehq.com/t/via-ux-prompt-ctrl-f-to-find-code-in-someones-notebook/1460/4 "2018-12-05T10:14:57Z")

</div>

I think a keyboard shortcut to open/close all (non-pinned) cells would be an excellent addition though!

---

<div class="post-metadata">

### Author: ![jrus](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/jrus/32/586_2.png) [@jrus](https://talk.observablehq.com/u/jrus)
#### Post date: [December 13, 2018, 11:30pm UTC](https://talk.observablehq.com/t/via-ux-prompt-ctrl-f-to-find-code-in-someones-notebook/1460/5 "2018-12-13T23:30:03Z")

</div>

Is there any way to get the browser to still have the text content of a hidden code block as part of the DOM, and then show the cell in question when it gets a selection event from Find?

Might be unnecessarily complicated / hard to make work across browsers / etc. Just an idea.

---

<div class="post-metadata">

### Author: ![thadk](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/thadk/32/251_2.png) [@thadk](https://talk.observablehq.com/u/thadk)
#### Post date: [June 12, 2019, 5:01am UTC](https://talk.observablehq.com/t/via-ux-prompt-ctrl-f-to-find-code-in-someones-notebook/1460/6 "2019-06-12T05:01:47Z")

</div>

Hi team,  
I was just pairing with my advanced JS (volunteer) colleague today who had worked as a new user solo otherwise successfully on the collaborative oHQ notebook. He said he was trying to ctrl-F but didn’t realize about safe mode. He did an “Ohhh” and said the find-a-thing-quickly limitation was a significant reason he had been pushing to move us to vanilla GitHub initially.

Consider raising it up in prominence somehow for searchers, besides just the button on the hanging-∞-notebook warning or the maki roll on the notebook profile. Really, everything you said above is gold.

---

<div class="post-metadata">

### Author: ![jashkenas](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/jashkenas/32/1778_2.png) [@jashkenas](https://talk.observablehq.com/u/jashkenas)
#### Post date: [June 12, 2019, 10:28pm UTC](https://talk.observablehq.com/t/via-ux-prompt-ctrl-f-to-find-code-in-someones-notebook/1460/7 "2019-06-12T22:28:17Z")

</div>

Lucky timing! After today’s launch of cell keyboard shortcuts:

> [@Cell shortcuts!](https://talk.observablehq.com/t/cell-shortcuts/2051):
>
> We just introduced new [cell shortcuts](https://observablehq.com/@observablehq/cell-shortcuts) on Observable - see all of them in the Keyboard Shortcuts reference: [https://observablehq.com/@observablehq/keyboard-shortcuts#cell](https://observablehq.com/@observablehq/keyboard-shortcuts#cell) These add a bunch of keyboard-centric new abilities. You can navigate cells with j & k, select cells with x, delete multiple cells at the same time with Option-Delete, move cells with Shift Up/Down, pin or unpin multiple cells with Ctrl-Shift-P, and more. All of the commands that work with one cell in this mode work with multip…

… you can now quickly press Shift-A to select all of the cells in the notebook, and then Ctrl-Shift-P to pin them all open at once, before using Ctrl-F to find the relevant bit of code.

(And you can use the same commands to close them all later, if you choose.)

---

<div class="post-metadata">

### Author: ![1wheel](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/1wheel/32/57_2.png) [@1wheel](https://talk.observablehq.com/u/1wheel)
#### Post date: [March 5, 2020, 2:05am UTC](https://talk.observablehq.com/t/via-ux-prompt-ctrl-f-to-find-code-in-someones-notebook/1460/8 "2020-03-05T02:05:26Z")

</div>

Has the pin all command changed? Shift-A selects all the cells, but Ctrl-Shift-P doesn’t seem to do anything.

When I’m editing a single cell Ctrl-Shift-P does pin it; I’m looking for a quick way to view all the code in a notebook though.

---

<div class="post-metadata">

### Author: ![mbostock](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbostock/32/9_2.png) [@mbostock](https://talk.observablehq.com/u/mbostock)
#### Post date: [March 5, 2020, 3:44am UTC](https://talk.observablehq.com/t/via-ux-prompt-ctrl-f-to-find-code-in-someones-notebook/1460/9 "2020-03-05T03:44:35Z")

</div>

> [@1wheel](#):
>
> Has the pin all command changed? Shift-A selects all the cells, but Ctrl-Shift-P doesn’t seem to do anything.

In visual focus mode, you just need to hit P to pin or unpin cells. Ctrl-Shift-P is only in editing mode (with an editor focused). See the full list of [keyboard shortcuts](https://observablehq.com/@observablehq/keyboard-shortcuts#cell) for more.
