i see this post. but i still dont see any way to be able to quickly step through a bunch of search results, making edits, and using a shortcut key to advance to the next result. the Find Next shortcut only works in the Search Tab window, not in the Editor window, where i have focus, while editing. I have to keep clicking on the next result and then clicking in the editor window to make my edits.
Seems so basic, i must be missing something.
i now see that Ctl+K is set to do something similar.
Ctrl+Alt+G is a default shortcut to search currently selected text in the whole workspace (Search>Text>Workspace from menu).
There are no default key mappings for searching selected text in file and in the current project but I find it very usefull added (Ctrl+Alt+F, and Ctrl+Alt+P respectively (Window>Preferences>Keys))
Related
Sometimes when closing vscode, or a tab therein, I get a dialogue asking "Do you want to save the changes you made to filename?" However, the unsaved edits are actually from a previous session that was closed without such a query, probably when turning off the computer, so I can't remember if it was meaningful edits, or maybe just an accidental key-press, like a shortcut gone wrong; and doing undo to revisit the last edits doesn't work either.
My question: How can I see the diff between the saved version of a file, and the version in the editor window? I think it would be nicest just to have a "show diff" option in the dialogue, but for now I'm also happy with a command line diff command.
I'm using ubuntu 20.04.
I'm using VSCode version 1.52.1 on MacOS and I had a similar problem that may not be the same problem, but I'm guessing it will work for you as well.
When you're in the Explorer view, in the upper left part of Explorer you have your "Open Editors." If that shows a dot to the left indicating that the buffer has changes in it, you can right click the file name and select "Compare with Saved." This will open another buffer to the side that will show you any unsaved changes.
To get rid of that window (it took me a bit to figure this out I'm sorry to say!), you can click the 'X' to the left of the extra buffer in "Open Editors."
Hope this works for you!
A few bright notes for the keyboard players out there:
The command you are asking about has a default shortcut. Unless you've applied a keyboard map extension, the Ctrl+Kd arpeggio opens the very same diff view between the active and saved versions of the current file. The default shortcut to close an editor tab (be it the diff or a file or anything at all) is Ctrl+W.
The command, like any command in VSCode, is also accessible via the Ctrl+Shift+P command dropdown (on Linux, F1 opens it too). Start typing e.g. compa sav (it saves your keyboard wear and tear to shorten words to a prefix which is unambiguous enough), and the list will shrink dynamically to just a few commands. Yours is File: Compare Active File with Saved. When it's close to the top enough, navigate the list of commands with the down arrow and execute it with Enter. As a bonus, you may click on the little gear to the right of the command currently highlighted in the list and redefine its shortcut, if you use it very often and prefer a chord shortcut to the default arpeggio one. Sorry, there does not seem to be a shortcut in lieu of the gear click. If there is, please let me know!
But if you really, really want to right-click on the filename in the Open Editors view of the Explorer sidebar, you can open that view directly with, you guessed it, a shortcut: Ctrl+Ke. And if you change your mind on a dime right at this moment, or realize that you in fact never had a mouse to do the right-click in the first place, use Shift+F10 to drop down the "right-click menu", properly called the context menu, which you navigate with arrows and execute with Enter (that's kinda a common theme, as you probably noticed). This works mostly anywhere the right-click does.
While in the Open Editors view, to switch to an editor file tab, move the selection to the desired file. Press Space to bring the file into view but stay in the Open Editors view, or Enter to bring the file into view and shift the keyboard focus to it. Pressing Ctrl+Shift+E brings focus back to the editor from any view in the Explorer sidebar. The same shortcut moves focus to the Explorer sidebar from the editor.
Happy ♬ k'boarding ♬!
ctrl+shift+P (or command+shift+P on mac) and fuzzy search for "compare changes with saved files"
I searched and was very surprised that I can't find a possibility to make CTRL+A, CTRL+E work. So I can jump to the beginning or end of the line. I'm working on a Mac and don't have Pos1 or Home Button on my keyboard.
I'm pretty used to it, because everywhere I need it, it exists, not so in eclipse.
When you set custom keys in eclipse - just make sure that the keys you assign are not already assigned to different actions.
e.g.
enter "ctrl+a" into the filter field and "unbind" the shortcut from all actions that you don't need
select action you want ("line start"), put cursor in "Binding" field and click Ctrl+A
Enter command + -->). this will work.
Another option I found was:
going to preferences
to general -> Editors -> keys
from Scheme select Emacs
Sorry I tried to post a pic, but apparently I need more points...
Home (goes to beginning of the line),End(goes to end of the line) works for me )
Eclipse has this great feature of searching text in Workspace(Ctrl+Alt+G), Project, File or Working Set.
The results are displayed neatly in a Search tab/view and when I double-click (i.e. mouse) a particular line, the file (in which that searched text is found) is open exactly at where the search text is.
Is there a keyboard shortcut for that double-click? To open the next one?
There is not one keyboard shortcut to perform this action that I know of, but there are two of them that could work in sequence.
Go to Window > Prefs > Keys
Search for "Show view search"
Set some custom keyboard shortcut because the default one is too long to be efficient (I like to use Alt+Shift+S)
Perform your search
With the search view in focus double-click the first result
When you are ready to go to next item, use a keyboard shortcut to show search view again (Alt+Shift+S for me)
Then press 'Ctrl+.'
This shortcut will display the next result and open a new file is needed.
So with this sequence you can use two keyboard shortcuts (Alt+Shift+S then Ctrl+.) to do what you want.
Checkout the Eclipse Keyboard Shortcuts PDF list for v2.1, v3.0, and v3.1 HERE
#gamerson has the right answer, but for the future I wanted to make sure you are aware of two key meta keyboard shortcuts:
Ctrl-Shift-L (Command-Shift-L on Mac) - Opens up a searchable list of available shortcuts.
Ctrl-3 (Command-3 on Mac) - Quick Access gives you a searchable, prioritized list of a bunch of stuff - commands, menu items, windows, tabs, etc. It's pretty darn useful.
For searching a document, I like using the floating Find/Replace window that pops up. Lately, however, hitting command-F pulls up this Find/Replace bar at the bottom of the editor window. I suppose I wouldn't mind it so much, except instead of selecting the text to search it puts the insertion point after whatever I've searched for before. Very annoying. Clicking on the magnifying glass pops up the other Find/Replace dialog.
How can I get the normal dialog to pop-up by default?
I should add that for some reason search is no longer working in Preferences, so I can no longer just search for "Find" to locate the setting I might need to change. So you'll have to give me the exact location.
A little more experimenting reveals that this is PyDev-specific behavior but I still can't find the setting that needs changing.
type Ctrl-Shift-L twice brings up Preferences window.
In Preferences window: type 'find bar' in the search field. This finds 'Find bar' in category 'Aptana Studio' (assuming you have Aptana Studio included in Eclipse). Click this entry 'Find Bar' to bring up the 'Find Bar' settings page.
On the Find Bar settings page uncheck 'Use custom find bar on Aptana editors' See shot.
This did the trick for me!
I added a feature request to the Pydev tracker for a setting to suppress the find bar: https://sourceforge.net/tracker/?func=detail&aid=3097964&group_id=85796&atid=577332
Could you make sure the 'command-f' is binding with menu item 'edit' - 'find/replace...'?
Might other plug-in hook the key binding.
And another way is using 'spy' to see which one contribute it. Focus on the search widget, then click 'alt - shift - f1'.
I could have sworn I saw it once before in a screencast where someone had the find/replace window docked in their Eclipse environment.
However looking through the list of options in "Window > Show" the closest thing I can find is the Search window.
I find that I use it quite a bit and with larger monitors these days I figure I could afford to have it open in my perspective all the time.
Is this possible?
Thanks.
One poor-man's workaround is to dock a view that you don't need in a part of Eclipse where you want the find/replace view and then place the find/replace dialog on top of that like this:
Clearly this is a huge kludge but it does work.
I am not sure about that, since Fast views are:
icons allowing users to quickly display different views that have been created as fast views
And the search/replace is a Dialog, not a View..
(source: bpsite.net)
(That Dialog box is not like Views, which support editors, also have their own menus. Some views also have their own toolbars.)
The help page mentions:
Fast views are hidden views that can be quickly opened and closed. They work like other views except they do not take up space in your Workbench window.
This might not be an exact answer for the question. But this works like a charm.
Press ctrl + j and keep typing...
Use ctrl + k to go on
Use shift key wherever required.
Use Edit > Incremental Find Next (Ctrl+J) or Edit > Incremental Find Previous (Ctrl+Shift+J) to enter the incremental find mode, and start typing the string to match. Matches are found incrementally as you type. The search string is shown in the status line. Press Ctrl+J or Ctrl+Shift+J to go to the next or previous match. Press Enter or Esc to exit incremental find mode.