IPython Notebook keyboard shortcut search for text

允我心安 提交于 2019-12-01 03:04:16

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

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:


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


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

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.

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

You are done!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!