HighlightWhitespaces/README.md

70 lines
2.0 KiB
Markdown
Raw Normal View History

2011-10-17 21:15:03 +00:00
## Synopsis
2013-05-03 11:57:42 +00:00
This is a plugin for [Sublime Text 2](http://www.sublimetext.com/2) and [3](http://www.sublimetext.com/3).
2011-10-17 21:15:03 +00:00
2012-10-04 21:29:19 +00:00
**Highlight whitespaces in documents**
2011-10-17 21:15:03 +00:00
2012-10-04 21:29:19 +00:00
This plugin will highlight each tab or more-than-one space in the document.
2011-10-17 21:15:03 +00:00
## Installation
Go to your `Packages` subdirectory under ST2's data directory:
2011-10-17 21:16:43 +00:00
* Windows: `%APPDATA%\Sublime Text 2`
* OS X: `~/Library/Application Support/Sublime Text 2/Packages`
* Linux: `~/.config/sublime-text-2/Packages`
2011-10-17 21:16:43 +00:00
* Portable Installation: `Sublime Text 2/Data`
2011-10-17 21:15:03 +00:00
Then clone this repository:
2012-10-04 21:29:19 +00:00
```git clone git://github.com/disq/HighlightWhitespaces.git```
2011-10-17 21:15:03 +00:00
That's it!
2013-05-03 11:57:42 +00:00
Note for ST3 users: For Sublime Text 3, replace "2" with "3" in path names. (`%APPDATA%\Sublime Text 3` and so on)
2011-10-17 21:15:03 +00:00
## Options
Several options are available to customize the plugin look 'n feel. The
config keys goes into config files accessible throught the "Preferences"
menu.
2012-10-04 21:29:19 +00:00
### Toggle highlight shortcut
2011-10-17 21:15:03 +00:00
2012-10-04 21:29:19 +00:00
The default toggle highlight shortcut is ```ctrl+alt+w``` (```cmd+alt+w``` for OS X)
2011-10-17 21:15:03 +00:00
### Disable highlighting when Sublime Text starts up
Change `highlight_whitespaces_enabled` from the default of `true` to `false`.
2011-10-17 21:15:03 +00:00
### Change the highlighting color
One may also change the highlighting color, providing a scope name such
as "invalid", "comment"... in "File Settings - User":
2012-10-04 21:29:19 +00:00
```
{
"highlight_whitespaces_space_highlight_scope_name": "invalid",
"highlight_whitespaces_tab_highlight_scope_name": "invalid"
}
2011-10-17 21:15:03 +00:00
```
Actually, "invalid" is the default value. If you'd like to use a custom color,
it should be defined as a color scope in your theme file. Feel free to ask me
how to do it.
### Disabling highlighting for large files
Highlighting may be disabled for large files. The default threshold is around
2011-10-17 21:35:28 +00:00
1M chars. This is configurable (in "File Settings - User"); unit is number of chars:
2011-10-17 21:15:03 +00:00
```
2012-10-04 21:29:19 +00:00
{ "highlight_whitespaces_file_max_size": 1000}
```
2012-10-04 21:36:42 +00:00
### Credits
This is a modified version of the TrailingSpaces plugin by Jean-Denis Vauguet and Oktay Acikalin
2012-10-04 21:37:19 +00:00
2012-10-04 21:36:42 +00:00
TrailingSpaces is at https://github.com/SublimeText/TrailingSpaces/