From 0c89e2ef6be2bb58449e5135b584bd53279a83b6 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Wed, 28 Jan 2015 14:09:04 +0900 Subject: [PATCH] Updating documentation --- README.md | 61 +++++++++++++++++++++++++++++++++++-------------- doc/argwrap.txt | 49 +++++++++++++++++++++++++++------------ 2 files changed, 79 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 6ff92d2..3dcd0a7 100644 --- a/README.md +++ b/README.md @@ -24,28 +24,55 @@ information. `nnoremap w :call argwrap#toggle()` - The `toggle` function receives an optional style argument, which may be either `"default"` or `"bx"`. Not providing - an explicit value is equivalent to specifying the `"default"` setting. The style determines the wrapping behavior - as seen below: +3. You can customize the wrapping/unwrapping behavior of this extension by setting values for any of the following + optional global variables in your `.vimrc` file: - *Default-style* argument wrapping: + * `g:argwrap_wrap_style` - ``` - Foo( - wibble, - wobble, - wubble - ) - ``` + Specifies the style in which arguments should be wrapped. - *Bx-style* argument wrapping: + `'default'` argument wrapping: - ``` - Foo(wibble - , wobble - , wubble + ``` + Foo( + wibble, + wobble, + wubble ) - ``` + ``` + + `'bx'` argument wrapping: + + ``` + Foo(wibble + , wobble + , wubble + ) + ``` + + * `g:argwrap_padded_braces` + + Specifies which brace types should be padded on the inside with spaces: + + `''`: do not add padding for any braces (empty string): + + ``` + [1, 2, 3] + {1, 2, 3} + ``` + + `'['`: padding for square braces only (curly braces are not padded): + + ``` + [ 1, 2, 3 ] + {1, 2, 3} + ``` + + Padding can be specified for multiple brace types as follows: + + ``` + let g:argwrap_padded_braces = '[{' + ``` ## Usage ## diff --git a/doc/argwrap.txt b/doc/argwrap.txt index 1d1b6bb..40a5af8 100644 --- a/doc/argwrap.txt +++ b/doc/argwrap.txt @@ -35,26 +35,47 @@ INSTALLATION *argwrap-installation* nnoremap w :call argwrap#toggle() - The toggle function receives an optional style argument, which may be either - "default" or "bx". Not providing an explicit value is equivalent to - specifying the "default" setting. The style determines the wrapping behavior - as seen below: +3. You can customize the wrapping/unwrapping behavior of this extension by + setting values for any of the following optional global variables in your + .vimrc file: - Default-style argument wrapping: + * g:argwrap_wrap_style - Foo( - wibble, - wobble, - wubble - ) + Specifies the style in which arguments should be wrapped. - Bx-style argument wrapping: + 'default' argument wrapping: - Foo(wibble - , wobble - , wubble + Foo( + wibble, + wobble, + wubble ) + 'bx' argument wrapping: + + Foo(wibble + , wobble + , wubble + ) + + * g:argwrap_padded_braces + + Specifies which brace types should be padded on the inside with spaces: + + '': do not add padding for any braces (empty string): + + [1, 2, 3] + {1, 2, 3} + + '[': padding for square braces only (curly braces are not padded): + + [ 1, 2, 3 ] + {1, 2, 3} + + Padding can be specified for multiple brace types as follows: + + let g:argwrap_padded_braces = '[{' + ================================================================================ USAGE *argwrap-usage*