Turn off 100% of all code auto-formatting everywhere forever under every circumstance
已回答
I know many of you find auto-complete of various stripes helpful, but I am odd and would like to disable all automatic functions that involve inserting or deleting text without me directly requesting that specific character be inserted or deleted by virtue of an explicit keystroke under any and all circumstances. Is there a way to achieve this?
请先登录再写评论。
Hi,
You can turn off autocomplete in Settings | Editor | General | Code completion. Just turn off "Auto insert" check and "Autopopup code completion" check. To turn off auto import go to Settings | Editor | General | Auto import and remove checks from "Add unambiguous imports" and "Optimize imports".
@Petr Rastegaev
That doesn't seem to work, I'm afraid. There seem to be multiple settings for disabling autocomplete, it's a bit annoying having to ferret them all out. Webstorm is a great editor and nothing else comes close, but the settings section has become a bit ... turgid as of late.
+1. This is really annoying. Especially silent removal of whitespace can mess things up a lot and there is too many settings.
I seem to have run into a new variety of IntelliJ trying to do things for me that I would rather it not. When I paste multiline strings into scala triple-quote blocks, IntelliJ seems really excited about formatting it for me in its own particular way. Except that this formatting displeases me. It's probably The Right Way To Do It, I don't doubt. Nevertheless, I have decided that I don't like it, and that means I don't like it when it adds hundreds of lines of formatting.
What incantation can I use to persuade IntelliJ that really it would be better for everyone if it just executed a paste command as requested without having to add its own two cents to what I'm pasting?
Hello,
Please try to set "None" for "Reformat on paste" option in "Settings | Editor | General | Smart Keys"
As with most documentation, the steps to turn off autocomplete are an outright lie. I tried ALL if this and it don't work.
I have a COMMENT in rubymine that if I try to type in the word "the" it automagically turns it into a "Then do<carriage return>end".
I'm using a Mac, which already tries to think for me constantly, but turning a comment into code? Puh-lease...
Because of all the extra "cleverness" I am seriously reconsidering my recent purchase of the whole suite of JetBrains IDE licenses. When technology thinks for people, it is usually wrong...
Hello Jeff,
could you please specify what RubyMine version you're using. Have you tried the last 2018.2 EAP?
+1 for constant struggles with code completion settings in PHPstorm. Is there a simple toggle to override all code completion of any kind? It has been driving me crazy, and has also lead me looking for other code editors. I understand there are specific settings for different language types, but I seem to have a great deal tracking them down and consistently run into trouble with single apostrophes when different language types are present in one script (PHP, HTML). I would prefer to have no automatic code completion occur whatsoever (Im about to go back to notepad!).
reformat on paste: None -> does not work at all in my case. adds unwanted whitespaces + \n
how to disable?
Hello,
Do you face this issue for all languages or for specific one? Also please share idea.log ("Help | Show Log in...") after restarting IDE.
Same here, on Scala, the auto-formatting is causing a lot of issues as I'm working on an existing code base and changes all the files adding spaces, new lines, etc.
@Crorella
The best solution here is to configure Code Style for Scala, so it matches the code style of the project you are working with. You can find a lot of options to configure under Preferences | Editor | Code Style | Scala.
Alternatively, you can add scopes where formatter (as well as import optimizer) will not work. See Preferences | Editor | Code Style | Formatter control. Here you could find more information regarding the feature:
https://www.jetbrains.com/help/idea/reformat-and-rearrange-code.html#exclude_file_from_reformat
On my recent IntelliJ installation on a new Mac, every time I'm about to commit, IntelliJ reformats. I don't have "reformat code" checked. I don't see anywhere how to control this behavior, and what the behavior is even called. The worst part is that it forces a reformat and it does it right when I hit "commit".
@...
Make sure "Reformat code" is disabled under Preferences | Version Control | Commit Dialog > Before Commit
The reformat option is not checked. Here are two examples of what I see when I commit (SVN):
I reverted:
and tried reformatting the file deliberately:
Now, undo reformatting. I would expect the file to be identical to the last revision. Notice that some diffs remain:
This is clearly some other formatting behavior that's not triggered by me.
@...
Please file an issue on https://youtrack.jetbrains.com/issues/IDEA with steps to reproduce
HOW COMPLETELY DISABLE CODE FORMATTING in RubyMine editor:
1. Preferences > Editor > Code Style > Formatter Control > Do not format, optimize imports, arrange code
2. Click "+" to create a new scope, this will open the "Scopes" window
3. In the "Scopes" window, click "+", and create a new scope:
Name: "Ruby files" (adapt it to your needs)
Pattern: file:*.rb
Done! The stubborn auto formatter is gone.
PS: Jetbrains, I like your products, but you guys need to invest more on code formatting. Code formatting in RubyMine is extremely frustrating, it is impossible to properly ident `do |x|...end` blocks when they are part of a method chain to satisfy my rubocop rules.
Hello David,
could you please provide a code sample where the formatting doesn't work as you'd expect?
I'm having this problem too, and it's really pretty bad. For me, it's in Pythnon3, and the examples are too numerous to document.
Here are some ones that have occurred in the past two minutes::
x=0 -> gets replaced with -> complex=0
y=0 -> turns into -> any() = 0
i= gets cut off and is immediately replaced with if=
def main() -> converts to -> def if __name__ == '__main__':
And on and on. I'm also looking for a way to turn it off.
Adding:
Mine doesn't happen on paste, it happens as I'm typing. It auto-corrects what I'm typing to the wrong thing, and it's really hard to work around it. I have to mash the <esc> key at just the right time in the process, then backspace over the incorrect text, then re-type the correct text.
I just started using IJ again after a 3 month hiatus and I've never known the auto-complete/correct to be this aggressive before.
Pease accept my apologies ... my "problem" was due to a plugin. Auto-complete and auto-correct work nicely now.
It's really embarrassing that this feature still does not exists. All the autocomplete "features" are a distraction. An option to turn them *ALL OFF* is required for this IDE to be valuable. Currently it is distracting and annoying. I have an expectation that every key I press will be respected and not conditionally typed if the editor thinks its ok. I have no desire for an editor to type or not type for me. Basic text like ((object)) will not allow me to complete because it "knows" what I want. It's like the people that create these misfeatures have no idea what it's like to write code.
@Dwalters what code generation scenarios do you find distracting and would like to disable, could you name some examples?
Hello, same problem here. I have the autocomplete when I write jsx tag (*=cursor)
o => <Button colo*
r => <Button color*
= => <Button color={*}
And I don't want the editor to make these braces. It's disturbing.
I also don't want the editor to auto create closing tag for my html/jsx tags.
I would preffer to write all the visible (=not whitespace) characters myself (or on request).
I cannot find where to turn these features off. Thank you. Webstorm here.
@Pavel have you tried disabling Settings (Preferences on macOS) | Editor | General | Smart Keys | Insert paired brackets (), [], {}, <> and other scenarios of inserting pair symbols in 'Smart Keys' settings? Does it help?
yes, I tried.
It didn't help.
I found a way. It's
in
. I don't understand the 'Add quotes for attribute ...' sentence. Whatever, problem solved for me. Thanks for pointing to Smart Keys!
I set a file pattern in the Editor >Code Style >Formatter Control > Do not format, arrange code... in order to ignore xml files.
But the IDE keeps re-fomatting my XML file no matter what I do. I even switched the file type to text to no avail - it keeps reformatting even if I use the version comparison window to revert changes. As soon as I leave the window my code gets re-formatted back. Is it the evil spirit inside? Please, chase away the evil spirit!
With all my love for IntelliJ IDE I have to switch to Eclipse. I cannot waste half-a-day fighting with auto-formatting...
Andrew Zakovorotny It doesn't look like IntelliJ IDEA is formatting your files as it would definitely not reformat XML files that are mapped to the Text file type, probably some file watcher, git hook or a third-party plug-in is doing this.
If you believe it's IntelliJ IDEA, please file a bug at https://youtrack.jetbrains.com/newIssue?project=IDEA and provide a sample project with the exact steps to reproduce, also share the logs (Help | Collect Logs and Diagnostic Data).