How to set IntelliJ IDEA to keep tabs open even if file is deleted? - intellij-idea

I often place my tabs in an order I like, or ctrl-tab to recently used tabs. But then I temporarily checkout a branch in git in which those files are missing, and the tabs automatically disappear. Even in simpler editors such as notepad++, deleted files can be kept open in the editor. Can this be done in IntelliJ IDEA? Thanks.
(There seems to be no such option in the obvious File -> Settings -> Editor -> General -> Editor Tabs)

There is unfortunately no such option.
I typically use ctrl-e key very often, to re-open recently used files.
There is another option you could look at, and that is "restore workspace" configuration on switching branches.
You can try settings -> version control -> Confirmation -> Restore workspace on branch switching and see if that helps.

Related

Intellij turn off delete file confirmtion?

This is about the popup when deleting a file from the Project Tool window (right-click file, click Delete...)
Various searches on this returned null and it's both annoying and an extra click/keystroke many times a week. Maybe some buried setting or macro magic will solve it?
Check out the options under:
File -> Settings -> Version Control -> Confirmation
There are option for "When files are created" and "When files are deleted"

IDEA IDE - disable inspection for one file

Is there a way to disable inspection for one file opened in the editor? I occasionally open large library file in the editor to inspect its source code, and don't want IDEA to run inspections on this particular file.
Use Hector the Inspector guy. You can access it by clicking on "guy in a hat" icon in Status Bar or via Code | Configure Current File Analysis... from the main menu.
Once there you can move the "Highlighting Level" slider from "Inspections" to "Syntax" .. or even "None" in case of a large or complex file.
Notes:
Settings here affect current file only (excludes "Power Save Mode" option)
Depending on a file, you may have multiple sliders (e.g. in .php file you will see separate sliders for HTML and PHP languages: this may change depending on some other settings):
P.S.
If your file is actually part of the library (PHP or JavaScript; "Library" in terms of IDE, of course) then they by default should not have inspections enabled in them:
UPDATE 2021-06-11:
Hector the Inspector has been removed from the status bar since 2020.2 version or so. You can get it back by installing Hector the Inspector plugin from Settings/Preferences | Plugins
You can set scope for your project and run inspections only for selected scopes.
#see Inspection severity and scopes

IntelliJ/Clojure: shortkey for Sync Files in REPL

I want to find the keybinding for "Sync Files in REPL".
I can find the keybinding for this action in:
File -> Settings -> Keymap -> CLojure Keybinding -> Bind Set: Cursive
I see that the keybinding for this action is Ctrl+Shift+M. However, when I use this keybinding, nothing happens. Do you have any idea why and how to use the keybinding?
I ran into the same issue. This github issue explains it:
The Clojure->Keybindings panel isn't where you make general changes to
the key mappings for actions - you'll find that in the generic
IntelliJ Keymap panel. The Keybindings panel is for setting a bunch of
key mappings in bulk - it's something you'll only do probably once
when you're initially setting Cursive up. For changing mappings for
particular actions after that point, you'll use the Keymap panel.
If you look in KeyMap (not Clojure Keybindings), make a new keymaps profile (or copy one of the existing ones), and the go to Plug-ins -> Cursive -> Sync files in REPL. The key binding specified there should work (unless of course you have it set to something that conflicts with something else).

IntelliJ IDEA Puts Checkout Files in Changelist Other Than Default for Perforce

My IDEA is linked to perforce. When I check out files for editing in IDEA, it automatically puts the checked out files into a changelist other than the default one. How can I change the settings so that the checked out files are to be put in default changelist?
It turned out that I needed to change the "Active Changelist" in Idea. Here are the steps:
In Idea, open “Change Tool Window” by clicking on Menu “View” -> “Tool Windows” -> “Changes"
Right click on the “Default” changelist(or any changelist you want to set to active/default) in the Tool Windows and click “Set Active"

IntelliJ - not asking if I want to save a file

I'm new to the IntelliJ IDE. In the past I was working with Visual Studio or Eclipse.
In those IDEs there was an asterisk * above the name of the file which has been modified.
But in IntelliJ with the default configuration I can't see if the file is modified. What's more the file is saved automatically when I change focus to another window.
I've found some options under Settings -> IDE Settings -> General -> Synchronization:
Synchronize files on frame activation
Save files on frame deactivation
Save files automatically if application is idle for...
After unchecking all that options the file is not saved automatically every time I change focus to another window, which is good. But still I can't:
see if the file is modified (no asterisk)
decide if the file should be saved when I'm closing it (IDE doesn't ask for that)
And when I'm closing IntelliJ file which has been modified is saved without even noticing.
Do you know what can I do to change how IntelliJ behaves?
After unchecking mentioned options go to:
Settings/Editor(IDE Settings)/Editor Tabs:
Check "Mark modified tabs with asterisk"
On 2019.3 Ultimate it's under:
Settings/Editor/General/Editor Tabs:
Mark modified (*)
The exact Save feature like eclipse is not available in IntelliJ.
Because IntelliJ IDEA has the ability to change so many files
simultaneously in large refactoring actions, and change them without
ever opening them, single file saves don't make very much sense. In
recognition of this, IntelliJ IDEA reserves the right to save any of
your files literally whenever it wishes. It's actually quite nice to
never have to worry about your file's save statuses, once you get used
to it.
"What if I don't like some changes I made, and want to roll them
back?", I hear you say. Well, for that IntelliJ IDEA includes this
amazing feature called the Local History. Every time it saves your
files, IntelliJ IDEA actually saves a diff of your file from it's
previous state, and saves that as well. You can see the entire edit
history of your files (going back some number of days), see the
changes you've made, and roll back any change. It rules triumphantly,
and more than makes up for the temporary disorientation caused by lack
of single-file save.
https://intellij-support.jetbrains.com/hc/en-us/community/posts/206336279/comments/207351939
To show an asterisk when a file is modified: open Settings (CTRL+ALT+S), switch to Editor > General > Editor Tabs and select the Mark modified tab with asterisk checkbox.
To remove autosave, uncheck: Appearance & Behavior > System Settings > Save files on frame deactivation