We have covered enormous tips and how-to on Sublime Text. It’s so great that we can’t wait to share more neat features with you. If you are into development or just interested in specifically configuring Sublime Text the way you want it to be. This guide will be helpful for you, particularly if you want Sublime Text to do some automated work for you, such as removing all the trailing white spaces.
Features like automatically removing trailing white spaces at the end of the line exist in most IDEs, but not so obvious in Sublime Text. Since it is not an IDE, some of the neat things such as removing trailing white spaces are hidden from the menus. This is a quick guide showing you how to configure your Sublime Text to automatically remove any trailing white spaces up on saving a file.
First, go to Preferences → Settings – User
This will open up the Preferences.sublime-settings file in which you are free to add any flag you are about to use. In this case, add the following key value pair in the JSON formatted file
Ensure the setting file is still in a valid JSON format, save and close the file. To test to see if it works, you can start adding spaces at the end of a line, save the file. You will notice that as soon as you save the file those white spaces are automatically removed. If you don’t see the spaces being removed, you can turn on the setting to see where there is space in your text file. To do this, add the following line of code into the settings file.
“all” is just one of the three options you can pass for this key, additionally you can replace it as “selection” or “none“, meaning that it will draw white space whenever you have selected something, or will not draw white space at all (which was the default setting).
Notice if you have turned on the “draw_white_space” to “all”, each space will be represented as a dot.
If you have it set to “selection”, whenever you highlight something it draws the dots on only the highlighted part.
In a way, the
draw_white_space can also be used to show and hide any white spaces. Use it wisely, and let the machine do as much automated work as possible for you.
For more hidden settings and optional configuration values, check out the Sublime Text unofficial documentation, a very well written unofficial documentation.
Co-founder of Next of Windows and a cool geek 🙂
Latest posts by Jonathan Hu (see all)
- Download Smashing Magazine Desktop Wallpaper Calendar December 2016 Windows 7/8/10 Theme - November 30, 2016
- How To Display CSV Files with Unicode UTF-8 Encoding in Excel - November 30, 2016
- How To Move Chart To New Window in Excel - November 28, 2016
Last updated: 10/22/2014