Skip to content

Using vscode with Jupyter extension, how to find/replace text within a notebook cell #141493

Closed

Description

In Jupyter Lab and Notebook web UI, it is possible to find and replace in the selected cell or entire notebook.

How to instruct vscode to replace only in the selected cell?

https://stackoverflow.com/questions/70043037/using-vscode-with-jupyter-extension-how-to-find-replace-text-within-a-notebook

Activity

  1. rchiodo commented on Jan 25, 2022

    @rchiodo
    Contributor

    Thanks for the suggestion. Find/Replace is handled by VS code core. Transferring.

  2. Repository owner unassigned on Jan 25, 2022
  3. rebornix commented on Jan 25, 2022

    @rebornix
    Contributor

    Luis Gonzalez (@lgonzalezsa) thanks for your feedback, this can be a great addition to the new filter UX we introduced for the find widget

    image

  4. added
    feature-request
    on Jan 25, 2022
  5. added this to the On Deck milestone on Jan 25, 2022
  6. lgonzalezsa commented on Jan 25, 2022

    @lgonzalezsa
    Author

    Awesome!

  7. 392781 commented on Feb 4, 2022

    @392781

    Peng Lyu (@rebornix) Why not just make it so that you search within the current selection?

    If you're focusing a cell, you search the cell.
    If you're focusing the notebook, you search the notebook.

    It seems unnecessary to make this a toggle.

  8. sterafix commented on May 30, 2022

    @sterafix

    Any update on this? I think find/replace is still a nightmare in Jupyter notebooks.

  9. rouzki commented on Jun 6, 2022

    @rouzki

    Hi any update ?

  10. wandli commented on Jul 1, 2022

    @wandli

    Wanting update +1

  11. jiawen1998 commented on Jul 5, 2022

    @jiawen1998

    Any solutions to find/replace within the selected notebook cell?

  12. Greco1899 commented on Jul 8, 2022

    @Greco1899

    +1. This would be really helpful!

  13. Chipmunk91 commented on Jul 22, 2022

    @Chipmunk91

    This is going to be huge help!

  14. rouzki commented on Jul 22, 2022

    @rouzki

    The solution that I am using :

    1. Select one occurrence of the text that you want to change.
    2. Press Ctrl+Shift+L, to select all occurrences of current selection.
    3. Then start editing all selection occurrences at the same time.
  15. luchungi commented on Jul 22, 2022

    @luchungi

    The solution that I am using :

    1. Select one occurrence of the text that you want to change.
    2. Press Ctrl+Shift+L, to select all occurrences of current selection.
    3. Then start editing all selection occurrences at the same time.

    The other way is to use Alt+Click of the mouse on all areas you want to edit at the same time if Ctrl+Shift+L ends up selecting beyond parts which you wish to edit.

    For the VS Code solution to this problem, I think we need the find/replace function to have the option of restricting it to the selected text instead of just confining it to the selected cell as the prior option can also easily achieve the selected cell option. Of course, having both options is even better.

  16. rouzki commented on Jul 22, 2022

    @rouzki

    The solution that I am using :

    1. Select one occurrence of the text that you want to change.
    2. Press Ctrl+Shift+L, to select all occurrences of current selection.
    3. Then start editing all selection occurrences at the same time.

    The other way is to use Alt+Click of the mouse on all areas you want to edit at the same time if Ctrl+Shift+L ends up selecting beyond parts which you wish to edit.

    For the VS Code solution to this problem, I think we need the find/replace function to have the option of restricting it to the selected text instead of just confining it to the selected cell as the prior option can also easily achieve the selected cell option. Of course, having both options is even better.

    If I want to restrict my selection I don't use the mouse (as it's not easy, and takes too much time), I simply select the occurrence then keep pressing Ctrl+D to select only the next occurrence.

  17. lgonzalezsa commented on Jul 27, 2022

    @lgonzalezsa
    Author

    I learned from https://stackoverflow.com/a/73109147/1729896 that using F3 enables the find and replace for the cell, just what I need, hope this helps others.
    CTRL-D also is a nice feature. Closing for now.

  18. gjsjohnmurray commented on Aug 3, 2022

    @gjsjohnmurray
    Contributor

    See also #121218

  19. locked and limited conversation to collaborators on Sep 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requestnotebook-find

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions