Sublime Text Indentation Settings Being Overwritten By a File - ide

I am working on a project where tab size is supposed to be 4 and tabs should not be spaces. I updated my Preferences.sublime-settings file to include
"detect_indentation": "false",
"tab_size": 4,
"translate_tabs_to_spaces": false,
When I open a new file these settings are set to how I want and everything works. However, if I open an existing file (scss or html) that has indentations as 2 spaces, my Sublime settings are overwritten and indentations change to 2 spaces. If I click View > Indentation I see that Tab Size is set to 2 and Indent Using Spaces is enabled, even though my preferences should be the opposite of that.
If I manually change Indentation via View > Indentation to Tab Width: 4 and deselect Indent Using Spaces, this works until I save the file, at which point the settings revert to Tab Width 2 and Indent Using Spaces turned on.
How can I force Sublime Text to honor my indentation preferences and not be overwritten by another file. I would assume that Sublime is detecting the indentations on the page, but I've turned that setting off.
Here is my preferences file showing that things should be working:
Here are the messed up settings for a scss file. All I did was open it:
I don't think any plugin is causing this, I disabled most of them and was still experiencing this issue. However, for reference, here is a list of all packages I have installed:
Alignment
BracketHighlighter
Capybara Snippets
ColorPicker
Dotfiles Syntax Highlighting
EditorConfig
Emmet
ERB Snippets
Gem Browser
Gist
Git
GitGutter
Haml
jQuery
JSHint
Package Control
Pretty JSON
PyV8
RSpec
SCSS
SideBarEnahancements
SublimeLinter
Terminal
TrailingSpaces
Thanks in advance for any help.

So I figured this out by completely uninstalling Sublime Text and all associated packages and settings, then reinstalling the app and one-by-one reinstalling my packages. It turns out that one of my packages, EditorConfig, was overwriting my Sublime Text style settings.
EditorConfig is actually a really cool plugin that allows a number of developers working on one project across multiple IDEs to have a consistent style by defining indentation type, size, charset, and other settings.
The answer to my problem was that in the particular project directory I was working some of the node modules I had downloaded had .editorconfig files that had indentation set as size 2 and spaces instead of tabs. I had to either uninstall the EditorConfig package from my Sublime Text or create a new .editorConfig file in the root directory of my project. This is the .editorConfig file I created that fixed my problem.
# top-most EditorConfig file
root = true
# 4 Tab Indentation
indent_style = tab
indent_size = 4

When a file is loaded, its contents are examined, and the "tab_size" and "translate_tabs_to_spaces" settings are set for that file. The status area will report when this happens. While this generally works well, you may want to disable it. You can do that with the "detect_indentation" setting.
This might be helpful: https://www.sublimetext.com/docs/2/indentation.html

Related

Code-Cleanup in VS2022 applies different tab/space formatting rules for closed solution files

Why would the VS2022 Code-Cleanup feature apply different keep-tabs formatting preferences depending on whether a source file is being viewed in VS2022 or is closed?
I have a new VS2022 install on a new Windows 11 dev machine and Resharper is not installed.
With all c-sharp source code windows closed, when I manually run Code-Cleanup all tab characters are converted to spaces. If I then open all source code files in VS2022 and run cleanup again, the spaces are converted back to tabs which is my Tools/Options keep-tabs preference.
I have 'view white-space' enabled and can see the indentation of my sourcde code flipping between tabs and spaces. This problem is repeatable.
Tools/Options 'Use adaptive formatting' is also disabled. I do not believe an .editorconfig settings file is applicable to my solution but even if there was a config file the open/close tabs/spaces formatting flip would be peculiar.

IntelliJ is treating all my files as text files

I created a file with an invalid extension (.jjs) from my sticky keyboard.
I deleted this file
all the icons for all my files turn into text icons. I lose my colour-theming, no variables are highlight, everything is like a plain text file.
How do I fix this? I can't find anything in the help docs
I am currently running IntelliJ 2017.3.2
I solved this by going to preferences -> editor -> file types -> text and removing ".js". Then adding ".js" under javascript files.
You do not have the directory marked as a source directory, hence it is not treated as a directory containing sources.
Either right click on the directory and then "mark directory as->sources root" or go into the module options and from the modules->sources tab mark the directory there.
got to file > project Strucutre click on modules and tab Sources select the directory where is your sourceCode (here src) and mark as Sources

How to remove material theme (or reset to defaults) from IntelliJ / PyCharm?

I have installed Material Theme UI and it made my IDE blackish. Later I decided to remove and and removed plugin. Unfortunately, this didn't give default colors back, some parts of IDE, for example Project pane, remained blackish.
How ro recover?
How to remove material theme from IntelliJ / PyCharm?
you can go to the Preferences->Plugins on the search bar, type Material UI
then press on the Uninstall button .
You should:
Go to Settings->Plugins and remove Material UI plugin
Switch to Default theme in Settings->Editor->Color Scheme
If it does not help (it happened to me) and you still have some colors/fonts from removed Material UI - looks like Material UI theme override some default colors. You should then close Intellij, go to Intellij config folder (on Windows it is C:/Users/<your username>/.IntellijIdeaXXXX.X/config) and remove this config folder and restart Intellij. It should show you a dialog window to import settings from previous version or use defaults (like when you install Intellij and make the first start). After that everything will be switched to default colors/fonts.
From the material-theme-jetbrains repo:
File Colors stuck after uninstallation The File Status Colors feature
is also a feature that sticks outside of the realm of the plugin as it
modifies the IDE itself. Therefore when uninstalling/disabling the
plugin the colors will stuck.
If you want to reset to the default colors, open the Settings at
Version Control -> File Status Colors in 2017.3+. In previous
versions, you will need to go to the config directory and delete the
_#user_Darcula.icls color scheme manually.
None of these worked for me as an acceptable solution. So here is what I figured out:
Go to plugins, uninstall Material UI.
Ensure colour scheme is Default/Darcula.
Restart Idea.
At this point most changes were back to default, but some things like colour of current tab, error highlights, modified files etc were still not back to usual. So I followed the advice of deleting config and things returned to normal. But with this option you lose everything, even the installed plugins. And worst thing was, I was using a settings repository to sync settings, few minutes later the colours were back! So I did a diff with older config directory and then a git log revealed that these files are the culprits.
Delete these 4 files from this path: .IntelliJIdea<version>/config/settingsRepository/repository/
colors/_#user_Darcula.icls
colors/_#user_Default.icls
material_custom_theme. xml
material_theme.xml
Then do a git commit and git push to ensure these are synced to your repository. And finally theme was back to normal!
Unfortunately whatever I was doing from the settings, I've couldn't get rid of that theme. So I uninstalled the program and reinstalled it again without material theme. Hope there will be better solution.
Tested with intellij 2018.3 go to settings->Type material then untick the material theme after that restart ide should fix the issue.
A tad brute force, but you could try and delete the theme directly.
Close IntelliJ
Go to: ..\JetBrains\themes
Delete Material UI
Open IntelliJ
Press Command + , (comma) (Shortcut to preferences) and search for material. Uninstall the material in plugins section.
Uninstall Material Theme UI plugin: Settings->Plugins
Delete colors from the config folder: C:\Users\User name\<.IdeaIC2018.2>\config\colors (don't remove the whole config folder because all the previous settings and tasks will be removed)
Delete material_theme file: C:\Users\User name\<.IdeaIC2018.2>\options\material_theme
If you are wondering how to do it in PHPStorm 2020.2 and above:
Settings (Alt + Ctrl + S) -> Plugins -> Uncheck the MaterialUI.
After unchecking, you would then be able to see an option to uninstall from the dropdown arrow found next to the install button.
2019 version File > Settings (or alt + f7 on windows), search for material theme ui
if you have the stupid accents persisting through uninstalling the plugin, deleting config files and so on the solution is under:
appearance and behavior > file colors > delete all of them
Another 2019 version (worked in my case):
open the settings editor (File->Settings)
search for Plugins page
inside the Plugins page, search for the Material UI plugin and uninstall it
search for Appearance & Behaviour->Appearance page
select the theme you prefer (IntelliJ or Darkula or High contrast). If your theme is already selected, chose another theme, apply the changes, than select back your preferred theme.
close IntelliJ (or PyCharm/WebStorm/etc)
open .IntelliJIdea<version>/config folder, usually it's in your home folder.
remove the following files:
material_theme.xml
colors/_#user_Darcula.icls or colors/_#user_Dafault.icls (beware: you may loose custom configurations you may have done)
Done.
This works for me in 2023.
Steps
Go to File --> Settings --> Plugins --> Go to "Installed" tab --> Search "Material Theme UI" --> Click on settings icon --> Click on "Uninstall" --> Click "Yes" in the dialog box --> Restart the IDE
Screenshot
Make sure to Restart the IDE

IntelliJ is hiding folder in project window mentioned in .gitignore file, how to show that folder in project window?

ignoring build folder does not show it in project window.
commenting .gradle in .gitignore does show it in project windows.
I want to show both .gradle and build folders in project windows but I also want to include them in .gitignore file.
Right click on a directory in the project view and make sure Hide ignored files option is not enabled.
This feature is provided by a third-party .ignore plug-in. IntelliJ IDEA doesn't hide ignored files out of the box.
Note: If you don't see the .gitignore-d files, then try clicking this option regardless of its label in this menu. Sometimes because of a bug the entry says "hide" but clicking it actually shows the hidden files.
Some updates to .ignore plugin suggested in this answer.
IntelliJ now suggests installing foldable-projectview
This plugin really provides flexible configuration options.

Error Less2CSS plugin while compiling less file in Sublime Text 2

I installed Sublime Text 2 and Node.js.After that i install less with that command npm install -g less with command console.When i install Less2CSS plugin and try to compile less file then i am getting error The compress option has been deprecated. We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.I found the same issue on here also.But i didn't understand what and which file to change.please help me if anyone have same issue.I attached the screen shot for more understand the issue.Thank you everyone.
To fix this issue, go to Sublime Text and:
Go to Preferences > Browse Packages
Open the Less2css folder
Open the lesscompiler.py file in a text editor
Go to line 184 and change this
cmd = [lessc_command, less, css, "-x", "--verbose"]
to this
cmd = [lessc_command, less, css, "--clean-css", "--verbose"]
Save the file, restart Sublime Text, and attempt to save your LESS file again.
It means that the option is not supported. it recommend you use a dedicated css minifier.
You can change the option.
Via "Preferences" -> "Package Settings" -> "Less2Css" -> "Settings - Default".
change ["minify": true,] to ["minify": false,]
and then, if you want to minify the css file, please use a dedicated css minifier to do this.