IntelliJ IDEA equivalent of Edit.GoToNext/PrevLocation - intellij-idea

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.

Related

How to undo in Intellij IDEA replace in files?

In intellij 2022.1, I use Ctrl+Shift+R to bring up the Replace in Files window - it shows 100+ matches in 40+ files. The search string and the replace string differ in only one character, for example: this.bar.is.fooed and this.barf.is.fooed. I only need to replace certain instances based on nearby text.
I'm in the groove, clicking the Replace button, checking the next entry, clicking, checking, ... and thinking my brain can keep things straight (it can't; neither can yours:-) I'm halfway through when I realize the last few replaces were wrong.
How can I undo them? Ctrl+Z is grayed out. This related SO question doesn't say and neither does the JetBrains documentation!
Use Local History to revert the changes.
Undo/redo is not supported for Replace dialog, vote for the related request.

How to jump to the next search result in the project tree?

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

Saving a position while coding?

Back in olden times, I used to code with an editor that allowed you to mark where you were in the code with a keypress. You could jump to another point in the same or another file to check a reference or somesuch. When you were ready, you could hit another keypress and return to the point you saved.
I've long since migrated to Dreamweaver and wanted this functionality. Does it exist in DW? If so, I missed that part of the manual. If not, any suggestions on an editor that DOES have that functionality?
Scott.
There is no official way to do it, but you could use the code collapse feature to create something like a bookmark. Collapse the single line and DW will have a mark at that line number until you clear it.

Rename using suggested var name with resharper

I'm Using resharper 6 nighty builds and VB.net. I've a big medium project with multiple files that don't follow the code style conventions of my company.
I've configured resharper with my own convenctions and It suggest to me the right name for each variable (perfect!).
But I can't find any automagic way to make the current name to be replaced with the suggested name.
Are there any way to do it? If not ... did you know ane fearure of coderush Xpress to achieve it?
Thanks.
If you've configured ReSharper with your naming conventions, then it should show a warning (blue squiggly underline) under any identifiers that don't comply. If you put the text cursor on one of those misnamed identifiers, you should see a pyramid icon appear near the left margin. Then you can press Alt+Enter (or click the pyramid icon) to drop down a quick-fix menu. There should be an option in the menu to "Rename to '_myField'". Usually it's the first item in the list, so you can just press Enter again to do the rename.
If you want to do this on everything in a source file, you can use the ReSharper > Inspect > Next Issue in File command (or its keyboard shortcut -- F12 in the IDEA keymap) to move the cursor to the next warning in the file. Then, if it's another name warning, you can use Alt+Enter, Enter again to fix it.
Unfortunately, there isn't a way to automatically fix every instance of a warning at once (though it's been requested; please feel free to vote for RSRP-126551 in their issue tracker).

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)