Prevent project recompiling on every keypress - stackblitz

Is there a way to set up a https://stackblitz.com project so it is not compiled automatically on every key press ?

You should go Settings -> Dev Server -> Hot reload trigger and change it to Save
Now it will recompile only after you've saved a project(Clicked on Save button or used shortcut, e.g Ctrl+S).

Related

Automatically save files in eclipse when closing tab

In Eclipse (CDT) when I close a modified file's tab in the code editor, I'm prompted with whether or not I want to save the file. Unlike when I run the project, I'm not given an option to autosave the file when closing a tab in the prompt that comes up. I haven't been able to find one yet, but is there any setting in the Eclipse Preferences that disable these prompts and automatically save modified files when I close their tabs (not every x time)?
You can use auto save feature in eclipse neon. See this answer also look at other answers to this question Eclipse save automatically

Is there a keyboard shortcut for stopping the current console in Eclipse?

I'm developping a Java application with a class containing main. I can start the application using Ctrl+Alt+X J subsequently the application can be re-run by hitting Alt+R T Enter to choose the menu option for the first item in the Run history.
But to stop the application, I have to click on the small red square in the console view. This is annoying, because it forces me to use the mouse, type Alt+R T Enter then re-focus the editor using the mouse again.
Eclipse being so configurable, there must be a keyboard shortcut to stop the application run in the current console I haven't found. There are an entry in Window > Preferences > Keys called Terminate and Terminate and Relaunch but no matter what binding I assign or what when conditions I set and no matter if I use the Debug perspective or not, they don't seem to fire.
Please help an Eclipse newbie avoiding the mouse :)
Go to Preferences -> General -> Keys
Find "Terminate" Set your binding to whatever you want.
Then change "When" from "Debugging" to "Editing Java Source".

Eclipse Shortcut for Team - Synchronize with Repository

What are the shortcuts for the context menu actions "Team -> Synchronize with Repository" and "Team -> Update" on the whole project?
I have already found shortcuts, but these are executed only on the file i have currently opened. But I want to execute it on the whole project without having to scroll the project explorer to the top and right-clicking on the project.
If there are no such shortcuts, how can I create them?
As john.k.doe indicates, that's the right solution, but you also need to do something else in order to make the shortcut actually work, which is go to Window > Customize Perspective > Command Groups Availability and there just check the SVN box ;)
you can almost always get the key shortcuts you want by
go to preferences type "keys" or go to General -> Keys
in the field presented when you click on "Keys"
in the left pane, type the command you are interested in setting up a shortcut for:
the image below is from my mac, but it works the same way on windows/linux, you just might choose something besides Cmd-Y as your shortcut modifier. the U under User indicates that i was the one to add that modification.
I have written a small Eclipse plug-in which selects the active project in the Package Explorer so you can execute other actions (like 'Sync with repo' and 'Update') on it. I think this approach is more flexible compared to writing a plug-in that selects the project and executes a predefined action.
You can get the plug-in at http://code.google.com/a/eclipselabs.org/p/eclipse-tweaks/downloads/list, it is named "com.xakcop.select". Download it and put it in the dropins/ folder of your Eclipse installation. Then when you restart Eclipse, you will find a new command Select project in Windows->Preferences->Keys. The default key binding is Ctrl+Shift+Backspace but you can change it to whatever you want.
When you are in the Java editor just press Ctrl+Shift+Backspace, this will select the project that the current file belongs to in Package Explorer. Then press the shortcut for "Synchronize with repository" and you are done.
The source code of the plug-in is also available as part of my eclipse-tweaks project: http://code.google.com/a/eclipselabs.org/p/eclipse-tweaks/source/browse/com.xakcop.select
I think the answer to this question adresses the issue.
The quickest way I've found to update/synchronize, after having set the shortcut keys, is to click on the minimize button in the Project/Package Explorer and then press the keys. After the update, simply clicking on the last used file in the editor returns to the previous workspace state (provided the "Link with Editor" button in Project Explorer is selected).
I should clarify: I use a working set for each project. The working sets are displayed as default Top Level Elements in the Package Explorer so, by clicking on the minimize button the desired Project' working set, they collapse and are easy to select. Then, I apply the shortcut on the selected working set.
From my point of view, the problem is the focus of the commands you execute.
The Team commands Snychronize and Update are executed on the current object (In my case). As you noticed, when you execute the command on the project, the project is synchonized - when you do it on a file, only the file is synchronized.
What I did as workaround is the following:
I created Key-Bindings for the commands Show in (Navigator) (Alt-N), Go to (Alt-G), and Show View (Naviator) (CTRL+SHIFT+Q, N).
With Alt-N I show the current File in the Navigator. I can then use the keys to navigate to the root that I want to synchronize (it's not always the whole project for me). If the root is to far away I use Alt-G and type the Project or Folder where I want to go to and execute afterwards the Synchronize commands.
(Go to works only in the current view)
If you have selected the Project once you just have to switch to the navigator (Show View command) and execute your synchronize commands.
You could also use rgerganov's plugin then you would not have to execute as many commands.
The procedure works also with other views (package explorer, project explorer)
What about this approach? It should also work for other SCM's or commands you want to execute on any object in the explorer views.

Eclipse: Save files without asking when I click run

Is there a way to save files without asking in Eclipse? Every time I click Run, it asks me if I want to save the file, and I always do.
Preferences > Run/Debug > Launching.
There's a setting called "Save required dirty editors before launching". Set it to "Always".
There should be a check box on that Save File dialog:
Or you can choose the option in Window->Preferences->General->Workspace and check the option called "Save automatically before build". This would make your life definitely easier
You can select the Automatically save resources checkbox the next time it prompts but I believe that's a per project setting.

Eclipse: How do I refresh an entire workspace? F5 doesn't do it

I have a workspace with a bunch of java projects. If I go to File->Refresh, it doesn't really refresh anything (perhaps the currently selected project). How do I get eclipse to refresh all of the projects?
It will indeed only refresh the current project (or, more specifically, the current selection in the project explorer). I just click somewhere in the project explorer, do Ctrl+A to select all projects and then press F5 to achieve a complete refresh.
If you want to refresh all Projects, ignoring closed projects, then the easiest way is to:
ctrl-click and item in the Project Explorer (to ensure the P. Explorer has focus)
ctrl-click the item again so that it's no longer highlighted (but the P. Explorer still has focus)
F5 will now Refresh the entire workspace
Effectively F5 refreshes the Workspace when a navigation view has focus and nothing is selected.
Ctrl-A, then F5.
You can set up the workspace to automatically refresh when it detects changes in the preferences. (Window > Preferences > General > Workspace > Refresh Automatically)
Easy.
Create an external tool: Run > External Tools > External Tools
Configuration...
Create a new Program configuration Point the location to an exe that is very fast (I use Cygwin's 'ls')
On the Refresh tab, choose Refresh Resources upon completion, The Entire Workspace
On the Build tab, deselect Build before launch
Run the tool to refresh all projects.
Control click all your projects together, then right click and hit refresh.
Usually I refresh all like that, then i make sure to clean all projects and rebuild in eclipse.
For anyone curious how to select all of those projects on OS X where Ctrl+A doesn't work:
Click the first project
Hold down Shift
Hold the ↓ key until they are all selected
Now press F5
This answer led me to an even simpler solution, no configuration necessary.
Cmd-3 build all (control-3 on windows)
Edit: Correction -- I need to both refresh and build. Build does not automatically refresh. I'm currently using two actions, "echo" from my comment in the linked answer I just referred to (an External Tool configuration with a hook to refresh all), followed by cmd-3 "build all"