Aptana won't save editor preferences - ide

I've got a little (big) problem in Aptana. Whenever I try to edit my settings for a specific editor, I click "Apply", then "OK", but my preferences don't get saved, and if I open the settings again, the default ones are shown. What might be causing the problem?
I'm using Ubuntu 11.04 with Aptana build 3.0.4.201108101506.
I'm looking forward to reading your suggestions.
Alessandro Desantis
EDIT: The situations changed with version 3.0.5. Now, YAML editor's preferences get erased when closing the settings window as before, while others editors' ones are overridden with defaults when closing the IDE... This is very strange.

open preferences (settings)
click General
click editors
click text editors
change displayed tab width to 4
check insert spaces for tabs
click apply
click ok
open preferences (settings)
click aptana studio
click editors
click YAML (or desired editor)
change tab policy to use spaces
change tab size to 4
this worked for me

Related

How can I see multiple tabs in IntelliJ?

The situation is when I open some files it isn't added on editor tab(red box).
The file that I double-clicked is located in green box with replacing existing file.
problem on editor tab in intellij
I want to see multiple tabs in editor tab in IntelliJ.
But I can see just only one tab like below.
I try to look around settings - Editor - General - Editor tab. But I couldn't find answer.
I wish I could get a hint here. Thank you.
Click on gear on the right -> view options -> Open in a new tab

Disable copying entire line when nothing is selected in Intellij

I have recently started using Intellij and I noticed that by default, when you do ctrl+c for copying something when you have nothing selected, it copies the entire line into the clipboard overriding what I had in there before.
This is really annoying yet I cannot seem to figure out how to disable it. I am aware that there is a paste history you can use however this is not what I am after, I just want to disable it like you can do with sublime text.
Is there a way to disable this behaviour so that when I press ctrl+c and nothing is selected it just leaves the clipboard alone?
Since version 2021.2 there is a dedicated Don't copy/cut the current line when invoking the Copy or Cut action with no selection setting for this in Preferences | Advanced Settings on the Mac, Settings | Advanced Settings on other platforms.
For older IntelliJ Platform based IDE's the setting is more hidden:
Invoke Help | Find Action... (Ctrl (Cmd on Mac)+Shift+A), type Registry and select the Registry... item that appears. Enable the editor.skip.copy.and.cut.for.empty.selection option there. Be careful with the other configuration options, because it is possible to break your IntelliJ IDEA installation with an incorrect setting.
In Mac OS X:
Press cmd+shift+a.
Type registry and press return to
open the Registry.
Enable the editor.skip.copy.and.cut.for.empty.selection option.
Click Close.
I suppose it should be same as in WebStorm, or someone might be searching WebStorm solution as I did:
Open the settings: File > Settings > Advanced Settings (bottom of the list).
Start typing "editor".
Check the editor.skip.copy.and.cut.for.empty.selection
Click "OK" or "Apply"
On: WebStorm 2022.3.1
in PHPStorm -> From the Help menu, select Edit Custom Properties.
and paste
editor.skip.copy.and.cut.for.empty.selection = true

Disable click and drag cut and paste in IntelliJ Idea IDE

In my IntelliJ Idea 13.1.2 IDE I keep running into situations where I'm selecting on a click and drag via my laptop touch pad. I keep accidentally clicking and dragging text and cutting lines. I've searched the options and settings panels for the words click and drag but I don't see a way to turn this feature off. IntelliJ's help talks about how to use click and drag cutting but doesn't say how to disable it.
Does anyone know how to disable cut and paste through click and drag in the IntelliJ IDE?
I found it in Settings → Editor → General.
Under the Mouse heading. The option is called "Enable Drag'n'Drop functionality in editor".
This also seems to disable drag and drop moving of files though.
In WebStorm 2020.1 (and presumably in other Jetbrains IDEs), the related option 'Move code fragments with drag-and-drop' is in Preferences > Editor > General:
Unchecking the checkbox does the trick without unwanted side effects such as also disabling the drag-and-drop operations for files etc.
There is no way to disable Drag-n-drop highlighted text in the editor itself!!! ALT guard for drag-n-drop files is a good idea as I accidentally drag and drop files on daily basis. Kudos for discovering that I just enabled it.
I have contacted Intellij support to give us a setting that we can disable in editor drag and drop. I think that is a stupid feature in the first place...

How to disable auto show hints in JetBrains IDEs (IntelliJ IDEA, PyCharm, WebStorm) on mouse over

How to disable auto show hints in IntelliJ IDEA on mouse over?
Edit:
This hint could be very big if you call existing method with incorrect parameters. It's very uncomfortable.
There are the same behaviour in PyCharm:
and WebStorm:
Those popups (or tooltips) has been my worst annoyance in the editor for a while. There is how I fixed it:
On the editor, at the bottom-right of the window, there is a head icon. Click it and uncheck the box "Import popup".
You can have a look at this guide (with images) to help you finding the checkbox:
http://www.jetbrains.com/idea/webhelp/disabling-inspections.html
I hope that can help you
TOTALLY: Open Settings (or Pereferences, if you are OS X user) dialog, choose Editor | Inspections. On the Mange tab (right pane of the dialog) select Copy. Then click the language node. Here you can find the setion that is probably responsible for your tooltips and disable it. Or disable the whole language node, if you like. This way you have all the IDE features working and no tooltips at all. You can return back to Project Default inspections profile when you need it.
PARTIALLY: Try to disable the respected intention action. Press Alt+Enter when you see the tooltip, select the action from the list and press the right arrow key. In the context menu, select "Disable".
From JetBrains Forum.
You probably need to uncheck the Inlay Hints.
For Windows 10 & PyCharm Community 2020.3.3 :
File > Settings > Editor > Inlay Hints
Uncheck Show hints for:

Intellij reformat on file save

I remember seeing in either IntelliJ or Eclipse the setting to reformat (cleanup) files whenever they are saved. How do I find it (didn't find it in the settings)
This solution worked better for me:
Make a macro (I used Organize Imports, Format Code, Save All)
Assign it a keystroke (I overrode Ctrl+S)
Note: You will have to check the box "Do not show this message again" the first time for the organized imports, but it works as expected after that.
Step-by-step for IntelliJ 10.0:
Code -> "Optimize Imports...", if a dialogue box appears, check the box that says "Do not show this message again.", then click "Run".
Tools -> "Start Macro Recording"
Code -> "Optimize Imports..."
Code -> "Reformat Code..."
File -> "Save all"
Tools -> "Stop Macro Recording"
Name the macro (something like "formatted save")
In File -> Settings -> Keymap, select your macro located at "Main Menu -> Tools -> "formatted save"
Click "Add Keyboard Shortcut", then perform the keystroke you want. If you choose Ctrl+S like me, it will ask you what to do with the previous Ctrl+S shortcut. Remove it. You can always reassign it later if you want.
Enjoy!
For IntelliJ 11, replace
step 2. with: Edit -> Macros -> "Start Macro Recording"
step 6. with: Edit -> Macros -> "Stop Macro Recording"
Everything else remains the same.
IntelliJ 12
8. The Preferences contain the Keymap settings. Use the input field to filter the content, as shown in the screenshot.
I suggest the save actions plugin. It also supports optimize imports and rearrange code.
Works well in combination with the eclipse formatter plugin.
Search and activate the plugin:
Configure it:
Edit: it seems like it the recent version of Intellij the save action plugin is triggered by the automatic Intellij save. This can be quite annoying when it hits while still editing.
This github issue of the plugin gives a hint to some possible solutions:
https://github.com/dubreuia/intellij-plugin-save-actions/issues/63
I actually tried to assign reformat to Ctrl+S and it worked fine - saving is done automatically now.
Below is Neil's answer updated.
IntelliJ 13 Steps:
Code -> Reformat Code
Edit -> Macros -> Start Macro Recording
Code -> Reformat Code
File -> Save all
Edit -> Macros -> Stop Macro Recording
Name the macro (something like "formatted save")
File -> Settings -> Keymap
Right click on the macro. Add Keyboard Shortcut. Set the keyboard shortcut to Control + S.
IntelliJ will inform you of a hotkey conflict. Select "remove" to remove other assignments.
I set it to automatically clean up on check-in, which is usually good enough for me. If something is too ugly, I'll just hit the shortcut (Ctrl-Alt-L, Return). And I see they have an option for auto-formatting pasted code, although I've never used that.
If you have InteliJ Idea Community 2018.2 and above the steps are as fallows:
In the top menu you click: Edit > Macros > Start Macro Recordings
(you'll see a window lower right corner of your screen confirming
that macros are being recorded)
In the top menu you click: Code >
Reformat Code (you'll see the option being selected in the lower
right corner)
In the top menu you click: Code > Optimize Imports
(you'll see the option being selected in the lower right corner)
In the top menu you click: File > Save All
In the top menu you click: Edit > Macros > Stop Macro Recording
You name the macro: "Format Code, Organize Imports, Save"
In the top menu you clock: File > Settings. In the settings windows you click Keymap
In the search box on the right you search "save". You'll find Save All (Ctrl+S). Right click on it and select "Remove Ctrl+S"
Remove your search text from the box, press on the Collapse All button (Second button from the top left)
Go to macros, press on the arrow to expand your macros, find your saved macro and right click on it. Select Add Keyboard Shortcut, and press Ctrl+S and okay.
Restart your IDE and try it.
I know what you're going to say, the guys before me wrote the same thing. But I got confused using the steps above this post, and I wanted to write a dumb down version for people who have the latest version of the IDE.
Ctrl + Alt + L is format file (includes the two below)
Ctrl + Alt + O is optimize imports
Ctrl + Alt + I will fix indentation on a particular line
I usually run Ctrl + Alt + L a few times before committing my work. I'd rather it do the cleanup/reformatting at my command instead of automatically.
Rejoice! In IDEA 2021.2 there is finally "File->Settings->Tools->Actions on Save" where you can select "Reformat code", "Optimize imports", "Rearrange code", "Run code cleanup", "Run eslint --fix" etc.
If you're developing in Flutter, there's a new experimental option as of 5/1/2018 that allows you to format code on save.
I wound up rebinding the Reformat code... action to Ctrl-S, replacing the default binding for Save All.
It may sound crazy at first, but IntelliJ seems to save on virtually every action: running tests, building the project, even when closing an editor tab. I have a habit of hitting Ctrl-S pretty often, so this actually works quite well for me. It's certainly easier to type than the default bind for reformatting.
IntellIJ 14 && 15: When you are checking in code in Commit changes dialog, tick the Reformat code checkbox, then IntelliJ will reformatting all the code that you are checking in.
Source: www.udemy.com/intellij-idea-secrets-double-your-coding-speed-in-2-hours
For PyCharm/IntelliJ IDEA:
Install black.
$ pip install black
Locate your black installation folder.
On macOS / Linux / BSD:
$ which black
/usr/local/bin/black # possible location
On Windows:
$ where black
%LocalAppData%\Programs\Python\Python36-32\Scripts\black.exe # possible location
Note that if you are using a virtual environment detected by PyCharm, this is an unneeded step. In this case the path to black is $PyInterpreterDirectory$/black.
Open External tools in PyCharm/IntelliJ IDEA
On macOS: PyCharm -> Preferences -> Tools -> External Tools
On Windows / Linux / BSD: File -> Settings -> Tools -> External Tools
Click the + icon to add a new external tool with the following values:
Name: Black
Description: Black is the uncompromising Python code formatter.
Program: <install_location_from_step_2>
Arguments: "$FilePath$"
Format the currently opened file by selecting Tools -> External Tools -> black.
Alternatively, you can set a keyboard shortcut by navigating to Preferences or Settings -> Keymap -> External Tools -> External Tools - Black.
Optionally, run Black on every file save:
Make sure you have the File Watchers plugin installed.
Go to Preferences or Settings -> Tools -> File Watchers and click + to add a new watcher:
Name: Black
File type: Python
Scope: Project Files
Program: <install_location_from_step_2>
Arguments: $FilePath$
Output paths to refresh: $FilePath$
Working directory: $ProjectFileDir$
Uncheck “Auto-save edited files to trigger the watcher” in Advanced Options
To format Python files with Black, I followed this guide, which also uses File Watcher:
https://black.readthedocs.io/en/stable/editor_integration.html
Since version 2020.1, you can activate Run on save for files directly in the Preferences of the Prettier plugin:
I thought there was something like that in IntelliJ, but I can't find it. The only clean-up that happens at save is that white space at the ends of lines is removed. I thought I had to specify that behavior at one point, but I don't see anything related at this point.
If it's about Prettier, just use a File Watcher :
references => Tools => File Watchers => click + to add a new watcher => Prettier
https://prettier.io/docs/en/webstorm.html#running-prettier-on-save-using-file-watcher