IPython Notebook keyboard shortcut search for text

44,676

Solution 1

There is a find-and-replace command in Jupyter. It's key binding is F (command mode):

enter image description here

Of course you can find text with the browser's functionality, (I find it sometimes better), but the command in Jupyter is also very useful. I use a lot that function Replace in selected cells when I copy-paste a bunch of code and then change variables or something like that:

enter image description here


(Note: You can launch the Command Palette with shift+ctrl+P, and browse or run other commands)


Solution 2

Enter Command Mode by pressing esc, followed by find and replace key binding f, so

esc then f

Take the User Interface Tour (Help Menu) if you haven't already

Solution 3

As of Jupyter Lab v1.0.2 the CTRL+F twice press trick described in my comment above doesn't seem to work anymore.

I found the internal search functionality of jupyter lab pretty annoying, since it only searches in the current cell. I wanted to directly access the native browser search with CTRL+F.

To disable jupyter lab search function (and use browser search instead):

  • open Settings\Advanced Settings Editor
  • add the following to User Preferencec:
{
    "shortcuts": [
    {
            "command": "documentsearch:start",
            "keys": [
                "Accel F"
            ],
            "selector": ".jp-mod-searchable",
            "disabled": true
        }
    ]
}

This will override the System Default, with "disabled": true added, and enables Browser CTRL+F in all Jupyter Lab instances.

Solution 4

:Embarassed: "Running in" means use the browser "find text on this page" shortcut. Firefox shortcut for this is ctrl - F.

Solution 5

  1. Select the cell(s) in which you want to replace.
  2. Then just click outside those cells
  3. Press f.

You are done!

Share:
44,676

Related videos on Youtube

SpeedCoder5
Author by

SpeedCoder5

Code faster than Racer X.

Updated on July 09, 2022

Comments

  • SpeedCoder5
    SpeedCoder5 almost 2 years

    Is there a keyboard shortcut to search for text in an IPython Notebook?

    I looked under Help | Keyboard shortcuts and there are lots of cool shortcuts but none for searching for text?

    enter image description here


    The notebook is running in FireFox on Ubuntu.

    • Alex
      Alex about 5 years
      As for Jupyter Lab, just found out myself: Hit CTRL+F once and you're searching within a single cell. Hit CTRL+F twice and you're searching the whole notebook (though browser function).
  • SpeedCoder5
    SpeedCoder5 over 5 years
    had to use ctrl + shift + F to show command palette in my browser per github.com/jupyter/help/issues/72#issuecomment-310640463
  • Luis
    Luis over 5 years
    A couple of things changed in the meantime, I shall update the answer...