In Sublime Text 2 I have installed the trailing spaces plugin, however the highlighting is always set to disabled.
if I toggle the highlight regions, by doing the following:
edit -> trailing spaces -> highlight regions
I always get the following:
highlighting of trailing spaces is disabled!
I have restarted sublime since the package install, but the toggle doesn't seem to work, does anyone know how to fix this issue?
Work around fix - not the solution to the problem
As for others it seems, i couldn't seem to get this trailing spaces to highlight no matter what i did, so what i did was remove the trailing spaces automatically on save. Not ideal but used to it now, works nicely.
Go to SublimeText 2 > Preferences > User Settings (or just hit the Mac Standard cmd + ,). This should open your User Settings as a JSON file. Add the following to your file
"trim_trailing_white_space_on_save": true
That's it. You're good to go.
I had this problem in Sublime Text 3.
I fixed it by deleting my trailing_spaces.sublime-settings file in the Sublime Text user package settings folder (which for me was %APPDATA%\Sublime Text 3\Packages\User) and reinstalling the plugin.
Some more discussion about this issue can be found on the plugin GitHub page here.
It's a known bug - see their Issues page on GitHub.
I was able to get it working by starting Sublime with a non-blank string value for the setting trailing_spaces_highlight_color
Open Preferences > Package Settings > Trailing Spaces > Settings - User
Replace:
"trailing_spaces_highlight_color": ""
With:
"trailing_spaces_highlight_color": "invalid"
Restart Sublime.
Edit > Trailing Spaces > Highlight Regions should work as expected now.
If you restart Sublime, "trailing_spaces_highlight_color" must not be a blank string, otherwise it will stop working again. Repeat the steps above to fix.
As long as Sublime is started with a non-blank string value for trailing_spaces_highlight_color, the toggle highlight regions works.
It looks like the plugin is caching the value in the setting file when Sublime loads. If you make changes to the settings file and toggle highlighting, the original value is restored. Which is why you need to restart Sublime for setting changes to take effect.
Related
I am opening a Sublime Text 2 project with the following command using gksudo in order to be able to edit some system files:
gksudo /usr/bin/subl /home/orschiro/.sublime/system-administration.sublime-project
However, what Sublime does is it opens the project in a window but additionally shows another empty window:
I already tried adding the following to the project and user settings but it does not resolve the problem:
"open_files_in_new_window": false,
"hot_exit": false
Does anyone have an idea how I can stop Sublime from opening that additional empty window?
You can try "create_window_at_startup": false, but that might only apply to OSX. Another option is to try "close_windows_when_empty": true.
Is your /usr/bin/subl a link to /path/to/Sublime Text 2/sublime_text, or do you have a -w specified as well? The -w option is not needed, so that's another thing to look at.
Good luck!
In your settings file, try:
"create_window_at_startup": false
I know this is an older issue and only for ST2 but none of these fixes worked for me on ST3. I was able to fix it by removing sublime text 2 and re creating my symlink with sublime text 3 (even though that is what it was linked to already). It seems it may have been confused by the multiple applications.
I have ST2 installed on Win7 and for some reason the global 'Find in Files' (ctrl+shift+f) stopped working (it worked before). Now all i get is :
Searching 0 files for "capbSectionac"
0 matches across 0 files
The regular search in the currently opened file is working correctly.
I tried re-installing it but to no avail :(
Anyone encountered it? Any solution?
Note that it says "Searching 0 files".
In the second field "Where:", make sure you don't have a folder selected. You should see the placeholder text "Open files and folders" which means that it will search in the whole project. If you don't see this placeholder, even if the "Where" field is empty try clicking on the "..." button and then click on "Clear".
source: http://www.sublimetext.com/forum/viewtopic.php?f=3&t=12611
I had the same problem. At some time I noticed that the Where: field (below Find:) didn't show any placeholder text ("Open files and folders"), as it is supposed to when it's empty. It turns out that the Where: field wasn't empty and therefore the search was like happening nowhere. As I cleared this field, the search worked again.
Press ctrl F . then in left side of search bar, enable Wrap. with inverted reload sign
I am new to Sublime Text 3, so when I first tried to use Find In Files (shift+command+y) it yielded nothing but 0 search results.
I brought up Find (command + f) and I noticed alot of spaces before my search term.
I cleared out those extra spaces and left my search term. Brough back up Find In Files and the search worked properly.
I keep having this problem in Unbuntu. The solution I found was just to delete the folder
/home/<user>/.config/sublime-text-2/Packages/User/Package Control.cache
I think this happens because I have file synchronization on save but can't be sure.
In Sublime Text 2, if I press escape the page goes into COMMAND mode, which seems to take text input as commands, rather than actually typing the text.
Another oddity is the VISUAL mode, and I have no idea what it does besides it seems to highlight text.
I think they came installed with the theme that I got, 'soda', maybe. Anyway, I searched and found out you can turn off COMMAND mode by pressing 'i'.
Regardless, both of these modes are extremely annoying, how do I get rid of them?
By default, sublime should ignore the vintage mode package. Right down the bottom of your default settings file change
"ignored_packages": []
to
"ignored_packages": ["Vintage"]
See: http://www.sublimetext.com/docs/2/vintage.html
Note: In this case you should be able to edit the sublime default but normally you would edit your user preference file.
I knew the answer, but I'd been looking for it for a few days, so I figured I'd post it.
You have to disable the 'Vintage' package.
Go into Preferences > Package Control > Package Control: Disable Packages > Choose 'Vintage'
This happened to me. In the default preferences it was set to:
"ignored_packages": ["Vintage"]
but in my user preferences it was set to:
"ignored_packages": []
Make sure that the value is not being overridden.
I have the following in my user/Preferences.sublime-settings
{
"tab_size": 2,
}
And most of the time it works. But once in a while I open a ruby file, and it jumped back to 4 spaces. I'm wondering if there is some bug or slight difference in opening a file that could change this?
Having trouble tracking this down. Thanks for the help.
You'll want to add:
"detect_indentation": false
This is on by default and ST is trying to be smart detecting the indentation of your current file, overloading the user or syntax specific default.
Here are various Sublime Text 2 tab settings explained:
http://opensourcehacker.com/2012/05/11/sublime-text-2-tips-for-python-and-web-developers/#Configure_sane_tab_and_whitespace_policy_and_other_settings
Note that the tab setting may be per file type
There is also autodetect from file enabled by default and your source code file may contain bad tabbing
I can't seem to get the Sublime Text 2 SublimeLinter package to stop showing the "Mixed tabs and spaces" warning.
I've set "smarttabs" : true in the settings, but it's still not taking.
Has anyone else solved this problem yet?
Here's my user settings for the SublimeLinter package: https://gist.github.com/3737558
Thanks.
I solve the problem like this.
First do not use mix tabs and spaces in the files. Use spaces only. Sublime can finely handle the indentation without a hard tab character.
Setup Sublime Text 2 to use spaces only:
// Tab and whitespace handling.
// Indent using spaces, 4 spaces ber indent by default, clean up extra whitespaces on save
"tab_size": 4,
"translate_tabs_to_spaces": true,
"trim_automatic_white_space": true,
"trim_trailing_white_space_on_save": true,
// Do not try to detect the tab size from the opened file
"detect_indentation" : false,
If you encounter any old files with mixed tabs and spaces you can convert them to spaces only from View > Indentation > Convert tabs to spaces menu.
Why tab character is bad in your source code
http://opensourcehacker.com/2012/05/13/never-use-hard-tabs/
i have the same problem, maybe i found the reason
the smarttabsoptions can control the warning when space after tab, but can't control the warning tabs after the space, you can try it
if you want to disable the warning you can add a comment at top top of the file
/*jshint -W099*/