From a7ba92d5c8ff5b7b409c04512b06608cfa9f2b8e Mon Sep 17 00:00:00 2001 From: Chaoren Lin Date: Fri, 22 Apr 2022 21:23:07 -0400 Subject: [PATCH] Remove all of the example configurations. #62 They were more confusing than helpful. --- README.md | 114 ++++++++++----------------------------------- doc/wordmotion.txt | 96 +++++++++----------------------------- 2 files changed, 47 insertions(+), 163 deletions(-) diff --git a/README.md b/README.md index 0b3a647..8e1543c 100644 --- a/README.md +++ b/README.md @@ -52,113 +52,47 @@ Default `word`/`WORD` mappings: | `xo` | `iw`/`iW` | | `c` | ``/`` | -### `g:wordmotion_nomap` - -Use `g:wordmotion_nomap` to get `` mappings only. \ -E.g., - -```vim -let g:wordmotion_nomap = 1 -nmap w WordMotion_w -nmap b WordMotion_b -nmap gE WordMotion_gE -omap aW WordMotion_aW -cmap WordMotion_ -``` +You do **NOT** need any of the mapping customizations below if the default +mappings already work for you. ### `g:wordmotion_prefix` Use `g:wordmotion_prefix` to apply a common prefix to each of the default word -motion mappings. \ -E.g., - -```vim -let g:wordmotion_prefix = '' -``` - -NOTE: does not apply to the `` and `` mappings. \ -NOTE: no effect if `g:wordmotion_nomap` is enabled. +motion mappings. ### `g:wordmotion_mappings` Use `g:wordmotion_mappings` to individually replace the default word motion -mappings. \ -E.g., +mappings. `g:wordmotion_mappings` is a dictionary where the keys are the default +mappings and the values are the mappings that you want to replace them with. +Unspecified entries will still use the default mappings. Entries set to an empty +string will be disabled. -```vim -let g:wordmotion_mappings = { -\ 'w' : '', -\ 'b' : '', -\ 'e' : '', -\ 'ge' : 'g', -\ 'aw' : 'a', -\ 'iw' : 'i', -\ '' : '' -\ } -``` +### `g:wordmotion_nomap` -Unspecified entries will still use the default mappings. \ -Set the value to an empty string to disable the mapping. \ -NOTE: this overrides `g:wordmotion_prefix`. \ -NOTE: no effect if `g:wordmotion_nomap` is enabled. +Use `g:wordmotion_nomap` to disable all of the default mappings. You can create +your own mappings to the `WordMotion_` internal mappings. Since there are +multiple modes involved for many of the mappings, it's probably more convenient +to use `g:wordmotion_prefix` or `g:wordmotion_mappings`. ### `g:wordmotion_spaces` -Use `g:wordmotion_spaces` to designate extra space character patterns. \ -E.g., - -```vim -let g:wordmotion_spaces = ['\w\@<=-\w\@=', '\.'] -``` - -will produce the following result: - -``` -3. - foo-bar.baz -w->w>w-->w-->w>w -``` +Use `g:wordmotion_spaces` to designate extra space characters. +`g:wordmotion_spaces` is a list where each item is a regular expression for +a character that you want to treat as a space. You have to make sure the regex +matches a single character. You can use lookaheads and lookbehinds for +context-sensitive space characters. -NOTE: make sure the regex matches a single character. You can use lookaheads and -lookbehinds for context-sensitive space characters. \ -NOTE: the default patterns match 1) hyphens (`-`) between between alphabetic -characters and 2) underscores (`_`) between alphanumeric characters. +By default, these are treated as spaces in addition to the actual space +characters: +1. hyphens (`-`) between between alphabetic characters +2. underscores (`_`) between alphanumeric characters ### `g:wordmotion_uppercase_spaces` -Use `g:wordmotion_uppercase_spaces` (default empty) to designate extra space -character patterns for uppercase motions. \ -E.g., - -```vim -let g:wordmotion_uppercase_spaces = ['-'] -``` - -will produce the following result: - -``` -foo_bar-baz.qux -W------>W---->W -``` - -NOTE: if `g:wordmotion_uppercase_spaces` is not set there will not be any -mappings for uppercase motions. - -### `wordmotion#reload()` - -All options can be updated by reloading the plugin. \ -E.g., to disable the `w` mapping: - -```vim -let g:wordmotion_mappings['w'] = '' -call wordmotion#reload() -``` - -then later re-enable it - -```vim -let g:wordmotion_mappings['w'] = '' -call wordmotion#reload() -``` +Use `g:wordmotion_uppercase_spaces` to designate extra space characters for +uppercase motions. These are separate from `g:wordmotion_spaces`. There are +no extra space characters for uppercase motions by default. ## Notable Changes diff --git a/doc/wordmotion.txt b/doc/wordmotion.txt index 8077e88..7d37130 100644 --- a/doc/wordmotion.txt +++ b/doc/wordmotion.txt @@ -101,88 +101,38 @@ Default `word` mappings are `w`, `b`, `e`, `ge`, `aw`, `iw`, and ``. Default `WORD` mappings are `W`, `B`, `E`, `gE`, `aW`, `iW`, and ``. - *g:wordmotion_nomap* -Use `g:wordmotion_nomap` to get `` mappings only. -E.g., -> - let g:wordmotion_nomap = 1 - nmap w WordMotion_w - nmap b WordMotion_b - nmap gE WordMotion_gE - omap aW WordMotion_aW - cmap WordMotion_ -< *g:wordmotion_prefix* Use |g:wordmotion_prefix| to apply a common prefix to each of the default word motion mappings. -E.g., -> - let g:wordmotion_prefix = '' -< -NOTE: does not apply to the `` and `` mappings. -NOTE: no effect if `g:wordmotion_nomap` is enabled. *g:wordmotion_mappings* Use |g:wordmotion_mappings| to individually replace the default word motion -mappings. -E.g., -> - let g:wordmotion_mappings = { - \ 'w' : '', - \ 'b' : '', - \ 'e' : '', - \ 'ge' : 'g', - \ 'aw' : 'a', - \ 'iw' : 'i', - \ '' : '' - \ } -< -Unspecified entries will still use the default mappings. -Set the value to an empty string to disable the mapping. -NOTE: this overrides |g:wordmotion_prefix|. -NOTE: no effect if `g:wordmotion_nomap` is enabled. +mappings. |g:wordmotion_mappings| is a dictionary where the keys are the +default mappings and the values are the mappings that you want to replace them +with. Unspecified entries will still use the default mappings. Entries set to +an empty string will be disabled. + + *g:wordmotion_nomap* +Use |g:wordmotion_nomap| to disable all of the default mappings. You can +create your own mappings to the |WordMotion_| internal mappings. Since +there are multiple modes involved for many of the mappings, it's probably more +convenient to use |g:wordmotion_prefix| or |g:wordmotion_mappings|. *g:wordmotion_spaces* -Use |g:wordmotion_spaces| to designate extra space character patterns. -E.g., -> - let g:wordmotion_spaces = ['\w\@<=-\w\@=', '\.'] -< -will produce the following result: -> - 3. - foo-bar.baz - ^ ^ ^ ^ ^ -< -NOTE: make sure the regex matches a single character. You can use lookaheads -and lookbehinds for context-sensitive space characters. -NOTE: the default patterns match 1) hyphens (`-`) between between alphabetic -characters and 2) underscores (`_`) between alphanumeric characters. +Use |g:wordmotion_spaces| to designate extra space characters. +|g:wordmotion_spaces| is a list where each item is a regular expression for +a character that you want to treat as a space. You have to make sure the regex +matches a single character. You can use lookaheads and lookbehinds for +context-sensitive space characters. + +By default, these are treated as spaces in addition to the actual space +characters: +1. hyphens (`-`) between between alphabetic characters +2. underscores (`_`) between alphanumeric characters *g:wordmotion_uppercase_spaces* -Use `g:wordmotion_uppercase_spaces` (default empty) to designate extra space -character patterns for uppercase motions.\ -E.g., -> - let g:wordmotion_uppercase_spaces = ['-'] -< -will produce the following result: -> - foo_bar-baz.qux - ^ ^ -< -If `g:wordmotion_uppercase_spaces` is not set there will not be any mappings for -uppercase motions. +Use |g:wordmotion_uppercase_spaces| to designate extra space characters for +uppercase motions. These are separate from |g:wordmotion_spaces|. There are +no extra space characters for uppercase motions by default. - *wordmotion-reload* -All options can be updated by reloading the plugin. -E.g., to disable the `w` mapping: -> - let g:wordmotion_mappings['w'] = '' - call wordmotion#reload() -< -then later re-enable it -> - let g:wordmotion_mappings['w'] = '' - call wordmotion#reload() -< vim:tw=78:ts=8:noet:ft=help:norl: