How to jump to the next search result in the project tree? - intellij-idea

Suppose this file tree. I'm searching for sass, and the first highlighted entry is .sass-cache. However, I want to navigate to _sass instead. Is there any shortcut to jump to the next/previous search result?
I know I could type _sass to make it more specific, but I'd still like to know a way to flip through search results if available.

It is surprisingly intuitive. Just use the arrow keys, Up or down to select the next or previous match

Related

Vscode "next search result" shortcut does not work

When I use the shortcut associated with "search.action.focusNextSearchResult" in vscode while searching something nothing happens.
This action is initially associated with F4 which is also used for other shortcuts. I thought it may be the problem so I reassigned it to an unused shortcut but it did not help.
I am using the extension "Emacs Friendly Keymap" (don't know if it can cause the problem).
Do you know how I could make it work?
That shortcut, used to go to the next search result, only works in a search editor. It has these context keys:
hasSearchResult || inSearchEditor
Are you using it in a separate search editor? It does work there. Here is one way to open a Search Editor:
If you are using the Find widget then use either of these:
Enter when focus is still in the Find widget or F3 when focus is in the editor.
If you are doing a search across files, then just a downarrow will go to the next result.

IntelliJ IDEA equivalent of Edit.GoToNext/PrevLocation

In Visual Studio 2019 I can use Find in Files to find some text in my code. Then I can use Edit.GoToNextLocation and Edit.GoToPrevLocation to move through the matches. (I have them mapped to Ctrl-N and Ctrl-Shift-N.) This allows me to jump from location to location and edit as necessary without having to use the mouse.
How can I do the same thing in IntelliJ IDEA?
There are many ways, I suggest you get familiar with "Action" shortcut (control+shift+A) and "type" what you want, see if there's an action and what shortcut (if any) it has.
For e.g.:
Get also familiar with "Bookmarks". (Control Tab, Double Shift are also good) Control-E (recent is nice) think all these you can "type" to search in them as well and narrow the results using fuzzy search (aka: type TM for "TimeManager" for example). You get the idea.
I think I found it!
IntelliJ IDEA appears to have a Next Occurrence command that does what I want.
It seems that to get a navigable list of found results, I need to do Find in Path... followed by Open in Find Window (Ctrl-Enter). Then Next Occurrence and Previous Occurrence (not to be confused with Move to Next Occurrence and Move to Previous Occurrence!) take me through the various places.
In IntelliJ IDEA it doesn't loop back to the first result like Visual Studio does, but I can live with that.
I do wish it would go straight to the Find Window instead of me having to tell it to.

How to search through TODO comment list in IntelliJ IDEA?

I'm working on a huge project that has thousands of TODO items. So when I go to the TODO tool window in IntelliJ IDEA it shows all of them. How can I search for a specific one?
If you want to define which TODOs should be found, you are able to set filter and patterns.
In TODO panel click on Filter TODO Items and select Edit Filters
Here you are able to set filters and patterns which should be used. More about that is on their site https://www.jetbrains.com/help/idea/2016.2/defining-todo-patterns-and-filters.html.
Keep in mind that after you define a new filter, Intellij will start with Indexing (long proccess for huge projects:( )
Also Intellij IDEA TODO tool lets you select from which part you want to see a TODOs (top bar on uploaded image) or you can simply show all TODOs and start typing (classic searching).
First, expand all the todos (view the side menu or by pressing CTRL+numpad +. Then just start typing, and IntelliJ will take you to the first place the string you searched for appears, be it a name of a folder, file or the text of the todo comment itself. Like any other search in IntelliJ, you can use the ↑ and ↓ keys to jump between items matching your search string.
If you are using a mac, keys ⌘6 (command key and number 6 key) will do the magic.
Press alt+6 to search *TODO* comment.
You might also want to view only the TODOs you have added in your current branch. You can use the Default Changelist tab for this:
The Scope Based tab also gives you some useful options for narrowing down the TODOs too:
This is not the exact answer to the given question, but it helped for me, so maybe it will also help someone else :)
What I haven't notice earlier is that TODO Tool Window/tab has some child tabs on the top. For me, the most usefull one, was the tab „Current file”. I was made aware of this feature after looking in official IDE documentation:
https://www.jetbrains.com/help/idea/todo-tool-window.html

IntelliJ Idea - search for a value in debugger

I need to know if it is possible to search for a value in debugger in IntelliJ Idea.
Example: you have a huge object tree and you need to find string variable that is set to same particular value.
Is there any way to do that?
Expand this tree so that you see all those strings, and start typing what you search for. The speed search should do the rest. To get to the next/previous results press the down/up arrows respectively.
Sorry to disappoint you, I don't think that this option exists.
The quick search will only look for values in expanded objects.
You can use some other tool to create a memory dump of this object, and look for your data there.
In the "Find action ..." menu, you select "Fully expand tree node" or use Numpad *

How to use multiple tabs when tagging to a function in Vim

I use ctags with my Vim and I rely heavily on C-] and C-T to tag back and froth between various functions in my project.
But if the function is in a different file, I'd like Vim to automatically open it in a new tab instead of the current tab. If I pop my tag stack using the C-T, I'd like it go back to the original tab where I pressed by C-] instead of changing the file in the current tab. I don't like to have the same file opened in multiple tabs in Vim. This is the normal behavior for most IDEs and I am wondering if there is a way to do this in Vim?
nmap <C-Enter> <C-w><C-]><C-w>T
Does this help ? You could probably figure out something similar for the way back.
Well, we need to decide what would be the wanted behaviour. We can go back to the original tab (not sure how, still investigating) but then the above given mapping is gonna open a new tab next time. So you'll end up with a lot of tabs after a while.
Or we can do <C-w>C, which will close the opened tab and take us back to the original one. I, personally, prefer this way of working (that way I don't lose my position in the file)
I go to the function I want, make my corrections there then return to the original file from which I started.
Let me know, what would you like (this didn't fit in comments so I put the answer here).
This might point you in the right direction:
http://vim.wikia.com/wiki/Open_every_buffer_in_its_own_tabpage
So, this is a feature I would like to see as well.
I'm not sure if it's possible.
What I usually do is
:tabnew
:tag somepartsoffunction*
and press tab to use globbing to easily find tag.
Sure, it's not an ideal solution, but it works most of the time.
Unfortunately, with VIM tabbing isn't totally integrated since it's a new feature since 7.0. Most people I know that use VIM weren't even aware of tabs until I told them, so with that, I have a feeling there is no way to do it right now.
(I would love to be proven wrong)