Skip to content

Commit

Permalink
Merge pull request #29 from Markus00000/1.0.0-dev
Browse files Browse the repository at this point in the history
Updated documentation.
  • Loading branch information
aserebryakov committed May 29, 2015
2 parents 1888c95 + 902b020 commit dc19bd8
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 47 deletions.
31 changes: 16 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ characters.
Highlights include:

* Trailing spaces
* Tabs or spaces depending on `|expandtab|`
* Lines longer than `|textwidth|`
* Tabs or spaces depending on `'expandtab'`
* Lines longer than `'textwidth'`
* Control characters

**filestyle** also lets you fix these issues (experimental).
Expand Down Expand Up @@ -55,26 +55,26 @@ Usage

##### Commands

* `FileStyleEnable` - enable plugin globally
* `FileStyleDisable` - disable plugin globally
* `FileStyleActivate` - enable plugin for current buffer
* `FileStyleDeactivate` - disable plugin for current buffer
* `FileStyleCheck` - check current buffer
* `FileStyleFix` - fix style errors
* `:FileStyleEnable` - enable plugin globally
* `:FileStyleDisable` - disable plugin globally
* `:FileStyleActivate` - enable plugin for current buffer
* `:FileStyleDeactivate` - disable plugin for current buffer
* `:FileStyleCheck` - check current buffer
* `:FileStyleFix` - fix style errors

##### Highlighting rules

1. If `|expandtab|` is set, highlight tabs (RED), if not, highlight spaces at
1. If `'expandtab'` is set, highlight tabs (RED), if not, highlight spaces at
the beginning of a line (YELLOW).
2. Highlight trailing spaces (CYAN)
3. Highlight line parts that exceed `|textwidth|` (INVERT)
3. Highlight line parts that exceed `'textwidth'` (INVERT)
4. Highlight control characters (BLUE)

##### FileStyleFix rules

1. Remove control characters
2. Remove trailing spaces
3. If `|expandtab|` is set, replace tabs with spaces, if not, replace spaces
3. If `'expandtab'` is set, replace tabs with spaces, if not, replace spaces
at the beginning of a line with tabs

##### Ignore file types
Expand All @@ -92,10 +92,11 @@ to your `.vimrc`:

let g:filestyle_ignore_patterns = ['^\(> \?\)\+$']

##### Notes
##### Known issues

* `textwidth` change can not be handled automatically. `FileStyleCheck` must
be executed to update highlighting
**filestyle** cannot detect `'textwidth'` changes. If you change `'textwidth'`,
execute `:FileStyleCheck` to ensure the new width is used for highlighting long
lines.

Contribution
------------
Expand Down Expand Up @@ -136,7 +137,7 @@ Changelog
#### 0.6.0

* Added option to ignore certain file types
* Changed `FileStyleDeactivate` to turn off highlighting in all windows of the
* Changed `:FileStyleDeactivate` to turn off highlighting in all windows of the
current buffer
* Added highlighting of control characters

Expand Down
65 changes: 33 additions & 32 deletions doc/filestyle.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ CONTENTS *FileStyleContents*
==============================================================================
1. Introduction *FileStyleIntroduction*

*filestyle* highlights unwanted whitespace and characters.
filestyle highlights unwanted whitespace and characters.

Highlights include:

* Trailing spaces
* Tabs or spaces depending on |expandtab|
* Lines longer than |textwidth|
* Tabs or spaces depending on 'expandtab'
* Lines longer than 'textwidth'
* Control characters

filestyle also lets you fix these issues (experimental).
Expand All @@ -34,17 +34,17 @@ filestyle also lets you fix these issues (experimental).
---------------------

Pathogen:

>
$ cd ~/.vim/bundle
$ git clone https://github.com/aserebryakov/filestyle.git

<
NeoBundle:

>
NeoBundle 'aserebryakov/filestyle'

<
Without plugin manager:

Clone or download this repository and copy its contents to your `~/.vim/`
Clone or download this repository and copy its contents to your ~/.vim/
directory.

2.2 Check your colorscheme (Vim only)
Expand All @@ -53,9 +53,9 @@ Without plugin manager:
When using Vim (not gVim), make sure your colorscheme explicitly defines
|ctermbg| in a |Normal| highlight group as it is required for the ignore
patterns feature. For example:

>
hi Normal ctermbg=15

<
==============================================================================
3. Usage *FileStyleUsage*

Expand All @@ -66,52 +66,53 @@ Commands
*:FileStyleEnable* *:FileStyleDisable*
*:FileStyleActivate* *:FileStyleDeactivate*
*:FileStyleCheck* *:FileStyleFix*
* `FileStyleEnable` - enable plugin globally
* `FileStyleDisable` - disable plugin globally
* `FileStyleActivate` - enable plugin for current buffer
* `FileStyleDeactivate` - disable plugin for current buffer
* `FileStyleCheck` - check current buffer
* `FileStyleFix` - fix style errors
* :FileStyleEnable - enable plugin globally
* :FileStyleDisable - disable plugin globally
* :FileStyleActivate - enable plugin for current buffer
* :FileStyleDeactivate - disable plugin for current buffer
* :FileStyleCheck - check current buffer
* :FileStyleFix - fix style errors

Highlighting rules
------------------

1. If |expandtab| is set, highlight tabs (RED), if not, highlight spaces at
1. If 'expandtab' is set, highlight tabs (RED), if not, highlight spaces at
the beginning of a line (YELLOW).
2. Highlight trailing spaces (CYAN)
3. Highlight line parts that exceed |textwidth| (INVERT)
3. Highlight line parts that exceed 'textwidth' (INVERT)
4. Highlight control characters (BLUE)

FileStyleFix rules
------------------

1. Remove control characters
2. Remove trailing spaces
3. If |expandtab| is set, replace tabs with spaces, if not, replace spaces
3. If 'expandtab' is set, replace tabs with spaces, if not, replace spaces
at the beginning of a line with tabs

Ignore file types *g:filestyle_ignore*
-----------------

By default, **filestyle** checks all file types. To ignore a file type, for
example `text`, add the following line to your `.vimrc`:

By default, filestyle checks all file types. To ignore a file type, for
example "text", add the following line to your vimrc:
>
let g:filestyle_ignore = ['text']

<
Ignore patterns *g:filestyle_ignore_patterns*
---------------

filestyle allows you to specify patterns that should be ignored. To ignore a
pattern, for example quoted lines starting with `>`, add the following line to
your `.vimrc`:

pattern, for example quoted lines starting with ">", add the following line to
your vimrc:
>
let g:filestyle_ignore_patterns = ['^\(> \?\)\+$']
<
Known issues *FileStyleKnownIssues*
------------

Notes
-----

* |textwidth| change can not be handled automatically. |FileStyleCheck| must
be executed to update highlighting
filestyle cannot detect 'textwidth' changes. If you change 'textwidth',
execute |:FileStyleCheck| to ensure the new width is used for highlighting
long lines.

==============================================================================
4. Contribution *FileStyleContribution*
Expand Down Expand Up @@ -164,7 +165,7 @@ limitations under the License.
0.6.0

* Added option to ignore certain file types
* Changed `FileStyleDeactivate` to turn off highlighting in all windows of the
* Changed |FileStyleDeactivate| to turn off highlighting in all windows of the
current buffer
* Added highlighting of control characters

Expand Down
1 change: 1 addition & 0 deletions doc/tags
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ FileStyleContribution filestyle.txt /*FileStyleContribution*
FileStyleCredits filestyle.txt /*FileStyleCredits*
FileStyleInstallation filestyle.txt /*FileStyleInstallation*
FileStyleIntroduction filestyle.txt /*FileStyleIntroduction*
FileStyleKnownIssues filestyle.txt /*FileStyleKnownIssues*
FileStyleLicense filestyle.txt /*FileStyleLicense*
FileStyleUsage filestyle.txt /*FileStyleUsage*
filestyle filestyle.txt /*filestyle*
Expand Down

0 comments on commit dc19bd8

Please sign in to comment.