Sublime Text 3 settings always lost in a new file - sublimetext3

I've switched to sass recently because I like the indented flavor of it but now I have a problem with my SB3 text editor:
My initial tab settings are too big for sass (it just takes too much place tab size is set by default to 4) so what I did to change that I just went to
Preferences -> Settings More -> Syntax Specific User
And then I added:
{
"tab_size": 2,
"translate_tabs_to_spaces": true
}
And here is the trick, it works on the document itself only when I create/open a file and then press tab it's like I never changed it but within the settings document it works perfectly, I have tried many solutions but none of them were successful

The answer was provided to me by sergioFC ! Thanks a lot man !
The answer is that those spec setting depends on what file you are at the moment when you open the spec.
For example if I have a .css file, and I open the Syntax Specific user, everything I write in you will be applied only to the files that have the same extension.
Thanks a lot # sergioFC !!!

Related

SFTP file alignment issues

I have sublime text 3 with SFTP plugin installed. Using it im able to download the code but the python files that are opened are not aligned properly.
I opened a ticket in SO but its not resolved.
https://askubuntu.com/questions/959866/files-improperly-aligned-after-transfer-via-ftp?noredirect=1#comment1533479_959866
Not sure I need to change in my py files either in the server or the editor. The lines are not aligned only after the SFTP.
My SFTP settings:-
"translate_tabs_to_spaces": true,
"detect_indentation": false,
"tab_size": 8,
"tab_width": 8
Indentation changes when viewing files on different computers or in different software are indicative of using tabs for indentation, as unlike spaces the amount of space that a tab takes up changes based on usage and configuration settings, and is one of the more hotly fought Holy Wars in the development arena.
As you have correctly surmised, you need to tell Sublime how wide you think a tab should be, since it's defaults are out of sync with what you expect.
For the most part your issue is that the settings you've mentioned in your post aren't SFTP Settings (the available settings are in the documentation). SFTP just moves files around as a series of bytes, it's not involved with the actual display and editing of anything.
In order to get things to work better, you should put those settings in your user preferences. That's Sublime Text > Preferences > Settings in the menu (i.e. press ⌘+,) and add them to the settings pane on the right.
That said, note that tab_width is not a setting that Sublime understands by default, although the other three you mentioned are valid. Additionally those settings will cause Sublime to expand all tabs into 8 spaces, removing the tab characters entirely.
Assuming you don't want your files to be indented with tabs any longer, that's what you want. If you prefer tabs, you should set translate_tabs_to_spaces to false instead, so that tab characters are retained.

Error loading colour scheme in Sublime Text 3

This error appears every time I save file or open a file.
Error loading colour scheme Packages\User\MonokaiGrayDL.tmTheme: Unable to open Packages\User\MonikaiGray.tmTheme
I searched about it but those solutions are for sublime text 2...please help
Menu > Sublime Text > Preferences > Settings - User> remove the line with `"color_scheme"`.
After saving the line was regenerated for me with a reference to a theme that actually exists.
You need to put the theme file inside Packages\Color Scheme - Default.sublime-package.
Open Color Scheme - Default.sublime-package with 7 zip (archive tool-you may use your favorite tool), and drag Monokai Gray.tmTheme into it. Then go to Sublime, and click Preferences -> Color Scheme and find Monokai Gray. When you choose the color scheme, it automatically updates the setting with this:
"color_scheme": "Packages/Color Scheme - Default/MonoKai Gray.tmTheme",
Note: I am using Sublime 3. I am not able to share my screen shot due to lack of reputation.
Sometimes, a couple of opened files ignores color schemes settings modifications, I had the same bug then ran this in the ST3 console :
[ v.settings().erase("color_scheme") for views in [ w.views() for w in sublime.windows() ] for v in views ]
This python code is pretty self explanatory.
With this, no need to close/re-open incriminated files for the bugs to go away.
Source
This happened to me after installing Compare Side-By-Side. The error message specified that SBSCompareTheme.theme could not be found. I don't remember the exact sequence of events, but I remember that at some point, I uninstalled the plugin, and the error message kept appearing.
It turns out that the theme file was referenced in the Local/Session.sublime_session file (~/Application Support/Sublime Text 3/Local/Session.sublime_session under OSX).
I edited that file by hand to remove any reference to the theme file, and the problem went away!
I am using Sublime Text 3.
I remove ColorHighlighter and it works.
I had the same problem:
My issue was that some packages creates a syntax-specific *.sublime-settings file (Markdown.sublime-settings in my case).
The file is located in Library/Application Support/Sublime Text 3/Packages/User.
This happens to me every now and then when my theme in use is being updated via Package Control. Try switching to a different theme, optionally remove and re-install Monokai Gray, then switch back to it.
I was having a similar issue with certain files/syntaxes after deleting a package (MarkdownEditing).
My issue was that some packages creates a syntax-specific *.sublime-settings file (Markdown.sublime-settings in my case). The file is location in Library/Application Support/Sublime Text 3/Packages/User.
This settings-file overwrites your color-scheme settings elsewhere. Removing it solved the issue.
That's easy!
Click Preferences ->Setting-User
you'll find your "color_scheme" attribute is your error message.
change it with a exist ".tmTheme" file.
Restart Sublime.
Sublime 3 here, worked for me after a restart.
I was getting similar error for the package PlainTasks. By renaming the folder PlainTasks-master to PlainTasks and restarting Sublime resolved the issue.
Copy the source code of the .tmTheme file from Github.
Open your non-working .tmTheme file with Sublime text.
Paste contents, save and restart Sublime text.
GO to Preferences->Browse Packages->User->open HTML.sublime-settings
then remove the line with "color_scheme" and save it.
if it doesn't work, just open PHP.sublime-settings instead of HTML.sublime-settings and do the same thing.
delete the user and you can fined it in C:\Users\webduang\AppData\Roaming\Sublime Text 3\Packages
GO to Preference->package control->package control user setting and paste this code..
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"draw_minimap_border": true,
"draw_white_space": "selection",
"font_face": "Source Code Pro Medium",
"font_size": 13,
"ignored_packages":
[
"Markdown",
"Vintage"
],
"indent_guide_options":
[
"draw_normal",
"draw_active"
],
"line_padding_bottom": 3,
"line_padding_top": 3,
"material_theme_accent_orange": true,
"overlay_scroll_bars": 3,
"theme": "Default.sublime-theme",
"trim_trailing_white_space_on_save": true,
"word_wrap": false
}

Sublime Text: File remains in tab even after deleted

When I delete a file that I don't need anymore, but then I have to close the tab manually. It is irritating.
Every time, I have to delete the file and then close the tab by confirming the discard changes.
Is there a way to delete the file in one shot.
Please Note: This happens in my MacBook laptop.
If you use the Side​Bar​Enhancements plugin, there is an option for that:
{
"close_affected_buffers_when_deleting_even_if_dirty": true
}
Make sure to add this to the correct settings file:
Preferences >> Package Settings >> Side Bar
I am not 100% clear on the details of your question. Apologies if this answer does not match what you are trying to ask.
Assuming you do not already have the file open this behaviour is a side effect of the choice to preview the file on click.
If this is the use case you are asking about then there is an answer.
If you look in Preferences -> Settings - Default and search for preview you should find this:
// Preview file contents when clicking on a file in the side bar. Double
// clicking or editing the preview will open the file and assign it a tab.
"preview_on_click": true,
This means clicking on the file to delete it causes it to be opened for preview and after deleting the file you also need to close the preview tab.
If you wish to change this behaviour open this file Preferences -> Settings - User and add this line:
"preview_on_click": false,
Then you should not open a preview and therefore will not need to close it after deleting the file.
If you already have the file you are deleting open for editing this will not cause the behaviour you are looking for.
There is an issue, so in order to don't make a link-only answer, I just paste here the main info :
Sublime Forum Question : Close tab after delete file?
Sublime Forum : https://www.sublimetext.com/forum/viewtopic.php?f=2&t=11686
Sublime Forum Answer :
You can do this with a plugin. I didn't really test this much, so you
may want to test on non critical stuff first. It does just close the
view, so worst case is that you lose some existing work. That being
said, I'm pretty sure it works fine.
import sublime_plugin
import os
class MyEvents(sublime_plugin.EventListener):
def on_activated(self, view):
if view.file_name():
if not os.path.exists(view.file_name()):
view.set_scratch(True)
view.window().run_command("close")
There's a plugin for this:
Plugin's Github Page
Seems like it should be a toggleable option.
This was annoying me so much, I created a plugin for it
https://gist.github.com/michaelkonecny/bb5a0d1cf43698c0ebe8673f92324ea3
Just download the close_deleted_files.py file and save it to
%AppData%\Roaming\Sublime Text 3\Packages\User (or similar path on Mac).
This is how the plugin works:
whenever a view is focused, it goes through the filenames of all the tabs in that window and closes those, whose files do not exist.
Extending #jwpfox answer
Below works for me:
Go to -> Top Menu -> Sublime -> Preferences -> Settings
Here Primary Preferences.sublime-settings file is not editable
when you click on settings, so two pages will open, now add the flag on the second page like below .. it will override the primary setting.
Alternatively, you can add the flag in below location file as well directly :
Packages/User/Preferences.sublime-settings
Add flag as
"preview_on_click": false,
The entire file looks like the below:
{
"ignored_packages":
[
"Vintage",
],
"preview_on_click": false,
}

how to enable soft tabs textmate2

i've seen some other answers to this but my textmate is behaving funny. i can't enable the soft tabs, which is getting annoying now that I'm working with haml. any ideas?
attached screenshot, the softtabs option is greyed out. what am I missing?
thanks,
JD
If you want Soft Tabs enabled everywhere add the following to the .tm_properties file in your home dir. If you don't have it just create one.
If you want to enable it for a specific project only simply create a .tm_properties file in the project dir.
softTabs = true
tabSize = 4
If you want to enable Soft Tab only for certain file types you can add a section to the file like this:
[ *.coffee ]
softTabs = true
tabSize = 2
I would recommend you to check out how these files work. Here is an example by hmans.
Also check out Textmate 2 Tips for more info.
Update
As Michael Sheets writes in his answer, it is now possible to save the change through the GUI.
As of r9290 you can now change the tab settings from the menu at the bottom of the edit window and they will be saved for the current file type and parent file type if applicable.
These are saved into Global.tmProperties which you can read more about in the release notes for r9290 (Help → Release Notes).

Where does notepad++ store style configurator settings?

I downloaded and modified a style file and placed it in the Notepad++ themes folder. I was able to select it and have it update the style as expected. I then went to Settings -> Style Configurator and changed the font of COMMENT of language VHDL to MS Gothic, hit save, and closed and exited Notepad++. I am able to relaunch Notepad++ and still see the change (I'm running Notepad++ in admin mode on Win7).
The only file that I can see a new timestamp on is my XML theme file, but I don't see MS Gothic anywhere in the file. Where is this information being stored? It is overriding the settings from my theme file. I also checked %APPDATA%\Notepad++\stylers.xml but I don't see it there either.
I realize I can change it back through the GUI, but I'd like to know how to get back to my original theme without selecting every style in the language manually (as I've made multiple changes). If I could edit (or delete) a file, I would prefer it.
Look in your %APPDATA%\Notepad++ folder, specifically for the stylers.xml file.
Uninstall Notepad++
Reinstall it again, but this time check the first box, the one that says "Don't use %APPDATA%..... "
Enjoy.
The reason is that Notepad++ install all the files at administrator profile, if you are using another user then you are screw, it will not work properly, you have to run it always as an administrator so it can work properly. To avoid this, just do as i said.
If files are going to APPDATA, then you can create a folder called "themes" and then inside that place your new xml themes. Then close and reopen notepad++ and you should see your new style in the "Select theme:" drop down. Whatever you named the file should be what appears in the dropdown
If you are on Windows 10 the path to add the new theme is :
C:\Users\NAME-OF-COMPUTER\AppData\Roaming\Notepad++\themes
stylers.xml is located one director/ folder above the themes :
Just as a complement to the other answers, if you made the changes on another theme than the default theme (stylers.xml) then your changes are saved to
%APPDATA%\Notepad++\themes\TheThemeYouModified.xml.
For example, if you modified the choco theme, then look for the %APPDATA%\Notepad++\themes\choco.xml.
You will also find a choco.xml in the C:\Program Files (x86)\Notepad++\themes but this one is not where your changes are saved.
I tried Rbastardo answer, but even when I check "Don't use %APPDATA%....." when installing Notepad++, the changes are still saved in %APPDATA%.
In case this helps someone in the future, if you installed Notepad++ via Scoop then look for your themes directory here:
D:\Users\yourusername\scoop\persist\notepadplusplus\themes

Resources