Update docs

This commit is contained in:
Andy K. Massimino
2018-08-18 17:14:07 -04:00
parent 9fe24a9d9f
commit 55ae3f2860
2 changed files with 101 additions and 19 deletions

View File

@@ -378,6 +378,13 @@ let g:matchup_text_obj_enabled = 0
```
defaults: 1
To enable the delete surrounding (`ds%`) and change surrounding (`cs%`)
maps,
```vim
let g:matchup_surround_enabled = 1
```
default: 0
To enable the experimental [transmute](#d1-parallel-transmutation)
module,
```vim
@@ -420,22 +427,36 @@ The variable `g:loaded_matchparen` has no effect on match-up.
#### Customizing the highlighting colors
match-up uses the `MatchParen` highlighting group, which can be configured.
For example,
match-up uses the `MatchParen` highlighting group by default, which can be
configured. For example,
```vim
:hi MatchParen ctermbg=blue guibg=lightblue cterm=italic gui=italic
:hi MatchParen ctermbg=blue guibg=lightblue cterm=italic gui=italic
```
You may want to put this inside a `ColorScheme` `autocmd` so it is
preserved after colorscheme changes:
```vim
augroup matchup_matchparen_highlight
autocmd!
autocmd ColorScheme * hi MatchParen guifg=red
augroup END
augroup matchup_matchparen_highlight
autocmd!
autocmd ColorScheme * hi MatchParen guifg=red
augroup END
```
The matchparen module can also be disabled on a per-buffer basis (there is
You can also highlight words differently than parentheses using the
`MatchWord` highlighting group. You might do this if you find the
`MatchParen` style distracting for large blocks.
```vim
:hi MatchWord ctermfg=red guifg=blue cterm=underline gui=underline
```
There are also `MatchParenCur` and `MatchWordCur` which allow you to
configure the highlight separately for the match under the cursor.
```vim
:hi MatchParenCur cterm=underline gui=underline
:hi MatchWordCur cterm=underline gui=underline
```
The matchparen module can be disabled on a per-buffer basis (there is
no command for this). By default, when disabling highlighting for a
particular buffer, the standard plugin matchparen will still be used
for that buffer.
@@ -533,6 +554,22 @@ nmap <silent> <F7> <plug>(matchup-hi-surround)
```
There is no default map for this feature.
You can also highlight surrounding delimiters always as the cursor moves.
```vim
let g:matchup_matchparen_deferred = 1
let g:matchup_matchparen_hi_surround_always = 1
```
default: 0 (off)
This can be set on a per-buffer basis:
```vim
autocmd FileType tex let b:matchup_matchparen_hi_surround_always = 1
```
Note: this feature _requires_
[deferred highlighting](#deferred-highlighting) to be supported and
enabled.
### Module motion
In vim, `{count}%` goes to the `{count}` percentage in the file.
@@ -715,7 +752,7 @@ heavily influenced by vimtex. :beers:
### Reporting problems
This is a brand new plugin and there are likely to be many bugs.
This is a new plugin and there are likely to be some bugs.
Thorough issue reports are encouraged. Please read the [issue
template](ISSUE_TEMPLATE.md) first. Be as precise and detailed as
possible when submitting issues.
@@ -734,7 +771,5 @@ contributing.
- support for fenced code possible?
- add file type `quirks` module
- investigate whether `&selection`/`&virtualedit` options are important
- can match-up be integrated with
[vim-surround](https://github.com/tpope/vim-surround)?
- support python (like python_match.vim)

View File

@@ -97,7 +97,7 @@ For customization, see |matchup-custom-mappings|.
*matchup-N%*
{count}% If {count} is less than 6, go forwards {count} times.
Otherwise, go to {count} percentage in the file (|N%|).
See |g:matchup_motion_override_Npercent|
See |g:matchup_motion_override_Npercent|.
*g%*
g% Go backwards to [count]th previous matching word. If
@@ -147,6 +147,20 @@ i% select the inside of an |any-block|.
When {count} is greater than 1, select the inside of
the {count}th surrounding open-to-close block.
*ds%*
{count}ds% delete {count}th surrounding matching words. This
only works for open and close words.
Requires |g:matchup_surround_enabled| = 1.
*cs%*
{count}cs% change {count}th surrounding matching words. This
only works for open and close words. If vim-surround
is installed, you can type replacements according to
that plugin's rules. Otherwise, match-up will give
you the opportunity to type open and close
replacements.
Requires |g:matchup_surround_enabled| = 1.
------------------------------------------------------------------------------
Customizing mappings~
*matchup-custom-mappings*
@@ -170,6 +184,8 @@ the corresponding default left-hand side will not be mapped.
z% |<plug>(matchup-z%)| nx motion
a% |<plug>(matchup-%)| x text_obj
i% |<plug>(matchup-%)| x text_obj
ds% |<plug>(matchup-ds%)| n surround
cs% |<plug>(matchup-cs%)| n surround
(none) |<plug>(matchup-hi-surround)| n matchparen
-------------------------------------------------------------------------~
Operator pending maps~
@@ -482,18 +498,30 @@ Module matchparen~
Customizing the highlighting colors~
match-up uses the |MatchParen| highlighting group, which can be configured.
For example, >
match-up uses the |MatchParen| highlighting group by default, which can be
configured. For example, >
:hi MatchParen ctermbg=blue guibg=lightblue cterm=italic gui=italic
<
You may want to put this inside a |ColorScheme| |autocmd| so it is
preserved after colorscheme changes: >
You may want to put this inside a |ColorScheme| |autocmd| so it is preserved
after colorscheme changes: >
augroup matchup_matchparen_highlight
autocmd!
autocmd ColorScheme * hi MatchParen guifg=red
augroup END
<
You can also highlight words differently than parentheses using the
`MatchWord` highlighting group. You might do this if you find the
`MatchParen` style distracting for large blocks. >
:hi MatchWord ctermfg=red guifg=blue cterm=underline gui=underline
<
There are also `MatchParenCur` and `MatchWordCur` which allow you to configure
the highlight separately for the match under the cursor. >
:hi MatchParenCur cterm=underline gui=underline
:hi MatchWordCur cterm=underline gui=underline
<
*b:matchup_matchparen_enabled*
@@ -612,6 +640,14 @@ will only work in nvim-0.2.1 and after.
Default: ''
*g:matchup_matchparen_hi_surround_always*
Always highlight the surrounding words, if possible. This is like
|<plug>(matchup-hi-surround)| but is updated each time the cursor moves.
This requires deferred matching (|g:matchup_matchparen_deferred| = 1).
Default: 0
Module motion~
*g:matchup_motion_override_Npercent*
@@ -668,6 +704,14 @@ Module text_obj~
<
Default: `['d', 'y']`
Module surround~
*g:matchup_surround_enabled*
Enables the surround module which provides maps |ds%| and |cs%|.
Default: 0
------------------------------------------------------------------------------
File type options~
*matchup-file-types*
@@ -854,14 +898,17 @@ for more information.
Other plugins~
match-up does not currently provide support for auto-completion or operating
on surrounding delimiters. The following plugins may be useful:
match-up does not currently provide support for auto-completion. The
following plugins may be useful for this:
- |vim-endwise| https://github.com/tpope/vim-endwise
- |auto-pairs| https://github.com/jiangmiao/auto-pairs
- |delimitMate| https://github.com/Raimondi/delimitMate
- |splitjoin.vim| https://github.com/AndrewRadev/splitjoin.vim
There is basic support for deleting and changing surroundings, but you may
prefer to use one of the following:
- |vim-surround| https://github.com/tpope/vim-surround
- |vim-sandwich| https://github.com/machakann/vim-sandwich
@@ -889,7 +936,7 @@ Development is tracked at https://github.com/andymass/vim-matchup.
Reporting problems~
This is a brand new plugin and there are likely to be some bugs. Thorough
This is a new plugin and there are likely to be some bugs. Thorough
issue reports are encouraged. Please read the issue template first
(ISSUE_TEMPLATE.md). Be as precise and detailed as possible when submitting
issues.