Skip to content

Add "find all occurences" in the current file feature #14836

Description

@AxCoder

Using Search sidebar to find all items in current file requires too much clicks.
VS has a find all option

  • VSCode Version: 1.6.1
  • OS Version: Windows Server 2008

Steps to Reproduce:

  1. Ctrl + F
  2. Type search test

Expected

option to see all occurrences

Actual

No such option

Visual Studio

snip_20161103091325

VS Code

snip_20161103091454

Activity

  1. rebornix commented on Nov 2, 2016

    @rebornix
    Contributor

    Maxim Belugin (@AxCoder) can you provide a screenshot showing your request as I don't have Windows available right now. It sounds like highlight all selections to me but I'm not quite sure.

  2. added
    info-needed
    on Nov 2, 2016
  3. AxCoder commented on Nov 3, 2016

    @AxCoder
    Author

    The difference is that highlight only shows occurrences that are on the current screen while in VS I see all occurences condenced on the bottom pane (similar to the Search sidebar in VS Code). Using of the search sidebar is a workaround, but requires too many clicks
    (BTW I tried to copy the full path into the "files to include" it did not find anything)
    snip_20161103092432

  4. rebornix commented on Nov 3, 2016

    @rebornix
    Contributor

    So let me try to summarize it, you want to see all the search results while using the search palate.

  5. removed
    info-needed
    on Nov 3, 2016
  6. Bill-Stewart commented on Nov 3, 2016

    @Bill-Stewart

    Have you tried workbench.view.search (default keybinding ctrl+shift+f)?

  7. AxCoder commented on Nov 3, 2016

    @AxCoder
    Author

    Peng Lyu (@rebornix)

    Yes, thank you

    Bill Stewart (@Bill-Stewart)

    Using Search sidebar to find all items in current file requires too much clicks.

    I have not find out how to quickly search only the current file
    snip_20161103210238

  8. Bill-Stewart commented on Nov 7, 2016

    @Bill-Stewart

    I don't understand? Pressing the shortcut key means you don't have to use the mouse.

  9. AxCoder commented on Nov 7, 2016

    @AxCoder
    Author

    Bill Stewart (@Bill-Stewart) the problem with Ctrl+Shift+F hotkey is that is searches in ALL files in the folder, while I want to search only in CURRENT file (active tab). In the screenshot above I'd like to see only entries found in Program.cs not other files.

  10. added
    feature-request
    search
    on Nov 7, 2016
  11. alexdima commented on Nov 7, 2016

    @alexdima
    Member

    I think this could be implemented by having an action in the editor that invokes the global find in files but scoped only on the current file.

    Thus, the search viewlet could show only hits in the current file. fyi Sandeep Somavarapu (@sandy081)

  12. 132 remaining items

  13. jamesl-dm commented on Apr 17, 2025

    @jamesl-dm

    +1 on this. Can't believe this still requires a plugin. Even adobe acrobat can do this since the 90's. How can vscode be worse than adobe?

  14. albjeremias commented on Apr 30, 2025

    @albjeremias

    +1 on this. Can't believe this still requires a plugin. Even adobe acrobat can do this since the 90's. How can vscode be worse than adobe?

    what is the plugin you can use?
    thanks.

  15. bnason-nf commented on May 1, 2025

    @bnason-nf
  16. joaomoreno commented on Nov 4, 2025

    @joaomoreno
    Contributor

    This is supported today by pressing Alt Enter in the Find Widget. Do we really need a button for this?

  17. vldmrrr commented on Nov 4, 2025

    @vldmrrr

    This is supported today by pressing Alt Enter in the Find Widget. Do we really need a button for this?

    That shortcut by default opens search results in a new editor - it has no relation to the feature requested in this thread.

  18. bhanratt commented on Nov 4, 2025

    @bhanratt

    This is supported today by pressing Alt Enter in the Find Widget. Do we really need a button for this?

    That shortcut by default opens search results in a new editor - it has no relation to the feature requested in this thread.

    Not for me. It behaves as described. That said this is very unintuitive and should be a button in the find widget if you forget the shortcut.

  19. vldmrrr commented on Nov 4, 2025

    @vldmrrr

    That shortcut by default opens search results in a new editor - it has no relation to the feature requested in this thread.

    Not for me. It behaves as described. That said this is very unintuitive and should be a button in the find widget if you forget the shortcut.

    Interesting, here is screenshot of my settings:
    Image
    What command is bound to Alt+Enter in your instance?

  20. noam-zur commented on Nov 4, 2025

    @noam-zur

    When I press Alt+Enter on the Find box the editor puts a cursor on each result in current file. this is not the request - I want to have a list of all results in current file that you can press and jump to each one

  21. joaomoreno commented on Nov 5, 2025

    @joaomoreno
    Contributor

    When I press Alt+Enter on the Find box the editor puts a cursor on each result in current file. this is not the request - I want to have a list of all results in current file that you can press and jump to each one

    What do you mean exactly? Where do you expect to have that list of all results? Note that VS Code by default will highlight all results just by typing the search term.

  22. KernelLeak commented on Nov 5, 2025

    @KernelLeak

    "Find in Files" in the sidebar, limited to the one file currently being edited, not just "all open editors"...

  23. noam-zur commented on Nov 7, 2025

    @noam-zur

    When I press Alt+Enter on the Find box the editor puts a cursor on each result in current file. this is not the request - I want to have a list of all results in current file that you can press and jump to each one

    What do you mean exactly? Where do you expect to have that list of all results? Note that VS Code by default will highlight all results just by typing the search term.

    please see my suggestion above with screenshot regarding how to solve it: #14836 (comment)

  24. mat-m commented on Nov 22, 2025

    @mat-m

    What do you mean exactly? Where do you expect to have that list of all results? Note that VS Code by default will highlight all results just by typing the search term.

    A shortcut to "exclude */**; include current editor", in the sidebar.

  25. Rbascoe commented on Nov 25, 2025

    @Rbascoe

    When I press Alt+Enter on the Find box the editor puts a cursor on each result in current file. this is not the request - I want to have a list of all results in current file that you can press and jump to each one

    What do you mean exactly? Where do you expect to have that list of all results? Note that VS Code by default will highlight all results just by typing the search term.

    Simply, we want an equivalent of the "Find All in Current Document," feature in Notepad++ to be added to VSCode. This shows the search results in a split window

    Notepad++

    Image

    Here is an example of me using this feature to find all instances of "resource" in a file. This is useful when searching large files to find what you are looking for. We want to have the same capabilities in VS code.

    Image

    Hopefully the visuals help folks understand what is being requested.

  26. bnason-nf commented on Nov 25, 2025

    @bnason-nf

    Since this is unfortunately still relevant six years later, and not everyone may find it in the long list of comments:

    #14836 (comment)

    bnason-nf on Aug 27, 2019
    It's far from perfect, but I just hacked together a little extension to do this until VSCode supports it properly:

    https://marketplace.visualstudio.com/items?itemName=bnason-nf.findallinfile
    (or just search for FindAllInFile in the marketplace)

    Hopefully this will be added to VSCode at some point.

  27. FreHu commented on Jan 29, 2026

    @FreHu

    One more extension you can try (mine):
    https://github.com/FreHu/vscode-fmof
    https://marketplace.visualstudio.com/items?itemName=frehu.fmof

    It packs together multiple useful commands:

    • search in the open file
    • search in all open files
    • search for the open file name
    • search for all open file names

    https://github.com/FreHu/vscode-fresh-file-explorer
    This one can search in recently modified files (current contents), inside diffs (added/deleted lines), or inside search results (searches in the files found by the previous search result)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

editor-findfeature-requestsearch

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions