Skip to content

Commit a512694

Browse files
committed
Update README to reflect recent option additions.
1 parent 49266b3 commit a512694

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Configuration
1414
- `b:phpfold_docblocks = 1` - Fold DocBlocks.
1515
- `b:phpfold_doc_with_funcs = 1` - Fold DocBlocks. Overrides `b:phpfold_docblocks`.
1616
- `b:phpfold_text = 1` - Enable the custom `foldtext` option.
17+
- `b:phpfold_text_right_lines = 1` - Display the line count on the right instead of the left.
18+
- `b:phpfold_text_percent = 0` - Display the percentage of lines the fold represents.
1719

1820
Installation
1921
------------
@@ -32,6 +34,53 @@ Installation
3234
1. Add `Plug 'swekaj/php-foldexpr.vim'` to .vimrc
3335
2. Run `:PlugInstall`
3436

37+
Option Effects
38+
--------------
39+
There are two options for customizing how the fold text displays: `b:phpfold_text_right_lines` and `b:phpfold_text_percent`.
40+
41+
When `b:phpfold_text_right_lines` is true, the number of lines folded along with the dashes that indicate the fold level are aligned on the right side of the screen.
42+
*`b:phpfold_text_right_lines = 0`:*
43+
```
44+
class ClassName
45+
{
46+
+-- 4 lines: public foo() {...}-------------------------------------------
47+
+-- 6 lines: public bar() {...}-------------------------------------------
48+
+-- 12 lines: public baz() {...}-------------------------------------------
49+
}
50+
```
51+
52+
*`b:phpfold_text_right_lines = 1`:*
53+
```
54+
class ClassName
55+
{
56+
public foo() {...}---------------------------------------- 4 lines +--
57+
public bar() {...}---------------------------------------- 6 lines +--
58+
public baz() {...}---------------------------------------- 12 lines +--
59+
}
60+
```
61+
62+
When `b:phpfold_text_percent` is true, the percentage of the total lines the fold represents is displayed alongside the line count:
63+
*`b:phpfold_text_right_lines = 0`:*
64+
```
65+
class ClassName
66+
{
67+
+-- 2 lines [ 8%]: public foo() {...}-------------------------------------
68+
+-- 8 lines [32%]: public bar() {...}-------------------------------------
69+
+-- 12 lines [48%]: public baz() {...}-------------------------------------
70+
}
71+
```
72+
73+
*`b:phpfold_text_right_lines = 1`:*
74+
```
75+
class ClassName
76+
{
77+
public foo() {...}---------------------------------- 2 lines [ 8%] +--
78+
public bar() {...}---------------------------------- 8 lines [32%] +--
79+
public baz() {...}---------------------------------- 12 lines [48%] +--
80+
}
81+
```
82+
83+
3584
Folding Examples
3685
----------------
3786

0 commit comments

Comments
 (0)