I tried to select the word that want to replace for multiple times and it did not. Finally I had to close the eclipse and start it.**
Rename (Alt+Shift+R) is a refactoring option. E.g. this could be used to rename a class or a method without renaming classes/methods with the same name but in different packages/classes if it was selected.
To search replace words in Eclipse within a single file, the replace option is there in the Find/Replace dialog that shows when you press Ctrl+F.
To search replace across files, go to Search/Search (Ctrl+H), and look for the File Search tab at the top (you normally need to scroll the tabs to the left to see it). This will let you search across a range of files, and then replace those matches.
Related
As per the answers in this question, there are two primary ways to search for files in VSCode:
By using CTRL/CMD + P/E to search and "go to file"
By clicking anywhere in the explorer tree and typing
Why do the above solutions not suit my needs?
I need a way to search for files and get a full list of them (in plain view) so I can easily scan them.
The 1st method returns only partial results unless I scroll down.
The 2nd method only searches the folder tree that's currently open.
I know I can use the find command in Linux to achieve this, but can I achieve something similar in the editor itself?
I have been working in Notepad++ recently, and last night, spent at least an hour manually selecting many of the same phrase with Ctrl+Select. I needed to select all occurrences of 'yyty' (Just a phrase so I could easily find it), but could not see or find a quick way to do that. I ended up just using the Ctr+Select method, but when doing this 80 times, it gets quite annoying. I need something that will allow me to select a word, then have all matching words become selected (NOT highlighted or marked, as I need to be able to run the column editor tool on the selection to auto-number all of the selections) automatically (by automatically, I mean after clicking something to run the auto-selector). I am willing to install a plugin for NP++ if needed.
I am having a block of code in Eclipse IDE and I want to replace that with new block of code in the whole project, can any one help me out regarding this issue.
First consider to refactor the repeated code into a function and then you can easily find/replace the function name. It will save you a lot of work.
If its just one line of code, just click ctrl+H select the so it should search in your project, when eclipse finds all results right click on the search window and select "replace all".
If its more than one line of code, enable first regular expression search, so when you select the code and hit ctrl+H eclipse will convert your text to regex, then do the search and select replace all...
(in the search window, make sure to be in the "File Search" tab.)
I have many source code files which are idented with 8 space characters, I want to convert these to 4 character indents. What is the best way of doing this? A technique using eclipse would be preferable.
Select the project(s), then press Ctrl+H to open the Search dialog (or click the Search > File menu).
Make sure the File Search tab is selected at the top.
Enter 8 spaces into the Containing text: field
Select your File name pattern (probably *.java or just *)
Select the scope (probably Selected Resources)
Press the *Replace... button.
As I said in the comments above, however, using spaces for indentation is a fool's game; tabs are the proper abstraction for indentation so that you don't have this problem.
Good file comparison tools were already discussed to the pain, but my problem is more exotic. Is there any visual text comparison tool (like WinMerge) that would allow me easily do visual comparison on two sections within the same file?
I have multiple configurations within vcproj file and need to maintain them. It is a pain to do this manually -- splitting windows, scrolling character-by character. On top of that xml is very verbose and takes lots of screen real-estate. I cannot believe there is no tool to do automatic file section comparison, since this sounds like a very common problem.
Please, do not offer me to use property pages, I do not want more complexity, I want less. Splitting manually into files and then comparing them is also too medieval (I am doing this now anyways).
I use Beyond Compare (not free, but I think a shareware version is available). You can select the same file for left and right sides, then right-click the beginning of your section on each side and select "Align Manually". This would allow you to compare two sections of the same file relatively easily.
Overall, I highly recommend the product. I haven't tried version 3, which is what they currently have on their Web site, but version 2 is a fabulous tool. A+
Emacs Ediff.
I use UltraEdit for most of my text editing and they have a product called UltraCompare that does a visual compare.
Update by Mofi
UltraCompare Professional supports also a comparison of text snippets in addition to entire files.
After starting UltraCompare, select Text Compare in menu Mode if not already selected. Select in text editor the first text block which should be compared, press Ctrl+C, switch back to UC and paste with Ctrl+V the block into left text area pane. Switch again to text editor, select the other block in same file, press Ctrl+C, switch back to UC, click into right pane and paste the block with Ctrl+V. The two blocks are immediately compared and the differences are displayed.
Such a text snippet comparison for two blocks in same file can be started also directly from within UltraEdit. Select the first block in file, press Ctrl+C, Ctrl+N, Ctrl+V and Ctrl+A to copy, paste and reselect this block in a new file. Select the second block in file. Execute command Compare from menu File in UltraEdit with option Compare selected text automatically being enabled and click on button Compare. UC Professional is started with just the 2 selected blocks for comparison.
You can use Meld to do this
Open up meld without specifying file names
Meld with prompt which type of comparison you want. Choose file comparison
Meld will present the the icon to select the file names. Below that it will prompt for a Blank comparison. Choose that.
In the file comparison window, paste the sections of the file you want to compare.