Multiple cursors from find result - sublimetext3

I have a regex in my find box and want a cursor at each found location (I'm actually trying to delete a load of new lines in paragraphs but there's far to many to do by hand).
How can I get a cursor at each location that matches [\w]$?

Click the "Find All" button at the far right of the find panel, and ST will select all the matches.

The shortcut Opt + Enter should work if you're looking to stay on the keyboard.

If you want to search for a simple string, you may select it right in editor and use Find All:
Windows/Linux: Alt+F3
Mac: ⌃+⌘+G

Related

select the same words in the Vim

I know there is a lot of information on how to do it, but I can't do it anyway. I use vs with vim expansion.
I have text with variables, I want to select for example variable btn in all text and change it to button. How can I do it?
I tried with select and press key n,but it selects all text until next btn;
also '*' is not working, it's just jumping to next btn;
Thank you!
You can use the *or viw to visually select the word under the cursor.
Found a good solution:
:%s/oldText/newText/g
more here: https://www.thegeekstuff.com/2009/04/vi-vim-editor-search-and-replace-examples/

intelliJ -> is there any way to scope your search to be within a function

Very often while coding, I need to search for keywords which are common and happen throughout a large file, but I am looking for an instance within a function.
The default search functionality often gives me all results starting from the top. Is there any way/workflow to search only within a specific method/function or block of code?
Update
Do Ctrl + F
Then Ctrl + Alt + E
Type the text to search
On MacOS, it's cmd instead of Ctrl
Original Post
You can do it like this (mentioned keymaps are for Linux):
Let's take as an example the following code, where we will be searching for the word "key" inside the method "clear". As you can see there are many occurrences of that word (in red, highlighted the ones we want in our results, and in blue other occurrences, which we do not want to appear in our search results)
1- Select the area you want to limit the search scope to.
2- Press Ctrl+Shift+F. It will pop up a search window with the selected text pre-filled in the search box.
3- Select the options "Scope" and, in the combo next to it, "Selection" (if they are not selected by default)
4- Type the word(s) you want to search (in this example, the key word).
5- The results shown will be limited to the selected area. Notice how there are only 9 matches in the upper right corner ("Match case" option is checked), despite in the same file there are many other occurrences of the same word.
However, I was neither able to find a key combination in order to do this as a single action nor assign a new one. Also, notice how the search includes the text in the method documentation.
Tested using IntelliJ IDEA 2018.1.4 (Ultimate Edition), Build #IU-181.5087.20 on Ubuntu 18.04
Looks like we're finally getting this feature in IDEA 2019.3:
https://blog.jetbrains.com/idea/2019/09/whats-new-in-intellij-idea-2019-3-eap-2/ (Ctrl-F for subtitle "Ability to search in a selected area when using the Find action")
It’s now possible to search only in a selected area using the Find action (cmd+F / Ctrl +F). Simply select the code piece you need in the editor and invoke the Find action and the IDE will perform the search only in the selected area.
Screenshot from the article (was a GIF originally)
There is a way to search inside a method, however, it doesn't seem to work for other scopes.
When searching in file as usual, click "Find all"
You'll get a list of results in the bottom panel. If you enable "Group by file structure" (I had it disabled by default), you can get a list of matches for a particular method.
On IntelliJ in Mac:
In a file select the specific block in which we want to find
something
Press CMD + F
Press CTRL + OPTION + G
Notice that the cursor has automatically landed in the find toolbar's text field
Type in what is intended to be found
Press enter to move the cursor
to the first occurrence.

Incremental search in Idea the word under cursor

I would like to search in current file the word under cursor like Alt+F3, except manually selecting current word? Is there alike keyboard shortcut?
Not entirely sure what you are looking to do when you say "manually selecting current word", but F3 (Next) and Shift+F3 (previous) will search for the word under the cursor. You can use Ctrl+W (Extend selection) to select the word under the cursor. Finally Ctrl+F will open the find/search tool. More options are listed in help: https://www.jetbrains.com/help/idea/search.html
EDIT
I forgot to mention, if you first use the mouse or Ctrl+W to select the word, and then open the search bar using Ctrl+F, or search & replace using Ctrl+R, IDEA will populate the search field with the selected text.
Ctrl+F3 - Find Next
Unfortunately, I have failed to find any keyboard shortcut for Find Previous shortcut.

microsoft visual studio 2012 find and replace focus to find all

When you do a search in vs 2012 via the Find and Replace (cntrl shift f) the default focus is on the Find Next. How can you set the default focus to Find All.
Because its very frustrating because it will do a very slow search on find next and I want to do a find next (just like in the prev Vs Studios)
Ctrl+Shift+F puts default focus on "Find All". So if you press Enter, you will get Find All. If you want to select "Find Next" from this box, press Alt+F while focused on this search window instead of Enter. This tip doesn't change default focus, but it does give you keyboard access to Find Next.
If you want a search box where Enter does "Find Next", try the Ctrl+F search box. In the Ctrl+F window, you could change the search scope from "Current Document" to "Entire Solution". Then the Enter key would Find Next through the entire solution.
You may also use the F3 function key as a workaround. Who in his right mind would think Enter key is for finding all matches instead of cycling through each find?

Replace String in all files in Eclipse [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed last month.
Improve this question
How can I search and replace a String in all files of my current project?
Let's say I have the string "/sites/default/" now I want it to be "/public/sites/default/", but there are almost 1000 files.
Goto "Search"->"File" from menubar at the top left
Enter text, file pattern and projects
Click "Replace..." button at the bottom
Enter new text click ok
Voilà...
Depending on the file type you are focused on, Ctrl+H will open up different types of search screens.
A more consistent hotkey would be using the Alt method: Tap Alt, then A, then F.
Efficient Order of Operations:
Ctrl+C the text you want to do the replacing (if available)
Highlight the text you want to be replaced
Tap ALT, then A, then F. Brings you to File Search. The selection from (2) will auto-fill the search box
In the “File name patterns” input box, type in “.java” for replacing all Java files or type in "" to replace in all files
Click “Replace…”
Ctrl+V (Paste). Or type in the value you want to do the replacing
Enter
You can find more details in my blog post: http://blog.simplyadvanced.net/android-how-to-findreplace-in-multiple-files-using-eclipse/
Use Ctrl+H for opening Eclipse search dialog, select appropriate search tab and select "Replace..." to get you to the "Search and replace" dialog
Strange but it is a two step task:
Search what you want
In the search tab right click and select replace , or replace all:
A demo at:
http://www.avajava.com/tutorials/lessons/how-do-i-do-a-find-and-replace-in-multiple-files-in-eclipse.html
Tonny Madsen said it right, but sometimes this is too simplistic.
What if you want to be more selective in your replacements since not all replacements are correct for what you're trying to do?
Here's how to get more granularity to do the replacements only in certain folders, files, or instances:
First, do like he said:
Click Search --> File... OR press Ctrl + H and choose the "File Search" tab.
Enter text, file pattern and choose your Workspace or Working Set.
Then:
Click Search
When your results come up, make some folder, file, or instance selections by Ctrl + clicking on the ones you'd like to select. Ex: here's my selection. I've chosen 3 instances, 1 file, and 1 folder:
Now, right-click on your selection and go to --> Replace Selected.... Here's a screenshot of that:
Enter what you'd like to replace it "With". In my case you can see it says it is "Replacing 190 matches in 4 files". Now click OK.
Voilà!
References:
Here's the tutorial I came across that taught me this: http://www.avajava.com/tutorials/lessons/how-do-i-do-a-find-and-replace-in-multiple-files-in-eclipse.html?page=2
ctrl + H will show the option to replace in the bottom .
Once you click on replace it will show as below
There is an option in search => file and shortcut is Ctrl+H. Go for further refer follow link. This is work fine with Eclipse Neon
Is there a way to find/replace across an entire project in Eclipse?
If you want to replace two lines of code with one line, then this does not work. It works in notepad++. I end up open all files in notepad++ and replaced all.
Ctrl+F gives me Find/Replace dialog box.
Or you can,
First Alt+A
Next Alt+F
Then press on Replace button.
If non of them worked:
Goto -> Window -> Preferences -> General -> Keys and search for replace then you will see binding for Find and replace. In the bottom of that window, you can add your key to Binding text box. There you can add or edit any keys as shortcut.
I have tried the following option in Helios Version of Eclipse.
Simply press CTRL+F you will get the "Find/Replace" Window on your screen

Resources