Unfortunately in Eclipse you can't simply disable the "Smart Insert" feature just like that. I know you can uncheck a bunch of things to disable a lot of those smart insert features but at the end it cannot be disabled globally! For e.g. you cannot ever disable how it adds tabs when you past content.
So this is my take on to totally disable Smart Insert feature in Eclipse:
- Open Eclipse and create a new java project (call it Test or org.eclipse.ui or whatever you want)
-
Create the following directories/file within this project:
src/org/eclipse/ui/texteditor/AbstractTextEditor.java
-
Copy the content from the eclipse release you are using to this file, for e.g. this is version 4.17
AbstractTextEditor.java
-
Apply this patch to your new project:
AbstractTextEditor.java.patch
- Right click your project, select Properties -> Java Build Path -> Libraries -> Add External JARs and select all jars files from your eclipse installation plugins/ directory (just use shift to select all of them at once)
- Select "Run -> Run As -> Java Application"
-
Rename
plugins/org.eclipse.ui.workbench.texteditor_XXXXX.jar
in your eclipse installation directory (you version may change depending on release) toorg.eclipse.ui.workbench.texteditor_XXXXX.jar.zip
-
Replace the
org/eclipse/ui/texteditor/AbstractTextEditor.class
file within this zip file with the one from your own build located atbin/org/eclipse/ui/texteditor/AbstractTextEditor.class
-
Rename
org.eclipse.ui.workbench.texteditor_XXXXX.jar.zip
back to it's original name for e.g.org.eclipse.ui.workbench.texteditor_XXXXX.jar
- Restart eclipse and now independent of your source editor kind (java, c, php, css, javascript) they all should be in normal insert mode.
IMPORTANT: this will prevent you from switching to Smart Insert as it simply disables that possibility because for some reason for e.g. PHP and CSS editors directly switch to Smart Insert mode even if default is not smart insert mode so had to totally disable it.
Comments (528)