annotate runtime/pack/dist/opt/matchit/plugin/matchit.vim @ 19574:d4deb2e50667

Update runtime files Commit: https://github.com/vim/vim/commit/eab6dff19f387469a200011bc6cf3508f5e43a4a Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 1 19:06:45 2020 +0100 Update runtime files
author Bram Moolenaar <Bram@vim.org>
date Sun, 01 Mar 2020 19:15:04 +0100
parents 6d11fc4aa683
children f0d7cb510ce3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8720
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " matchit.vim: (global plugin) Extended "%" matching
15729
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
2 " Maintainer: Christian Brabandt
19574
d4deb2e50667 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
3 " Version: 1.17
18456
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 15729
diff changeset
4 " Last Change: 2019 Oct 24
15729
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
5 " Repository: https://github.com/chrisbra/matchit
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
6 " Previous URL:http://www.vim.org/script.php?script_id=39
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
7 " Previous Maintainer: Benji Fisher PhD <benji@member.AMS.org>
8720
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 " Documentation:
18456
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 15729
diff changeset
10 " The documentation is in a separate file: ../doc/matchit.txt
8720
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 " Credits:
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 " Vim editor by Bram Moolenaar (Thanks, Bram!)
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 " Original script and design by Raul Segura Acevedo
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 " Support for comments by Douglas Potts
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 " Support for back references and other improvements by Benji Fisher
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 " Support for many languages by Johannes Zellner
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 " Suggestions for improvement, bug reports, and support for additional
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 " languages by Jordi-Albert Batalla, Neil Bird, Servatius Brandt, Mark
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 " Collett, Stephen Wall, Dany St-Amant, Yuheng Xie, and Johannes Zellner.
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 " Debugging:
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 " If you'd like to try the built-in debugging commands...
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 " :MatchDebug to activate debugging for the current buffer
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 " This saves the values of several key script variables as buffer-local
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 " variables. See the MatchDebug() function, below, for details.
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 " TODO: I should think about multi-line patterns for b:match_words.
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 " This would require an option: how many lines to scan (default 1).
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 " This would be useful for Python, maybe also for *ML.
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 " TODO: Maybe I should add a menu so that people will actually use some of
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 " the features that I have implemented.
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 " TODO: Eliminate the MultiMatch function. Add yet another argument to
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 " Match_wrapper() instead.
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 " TODO: Allow :let b:match_words = '\(\(foo\)\(bar\)\):\3\2:end\1'
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 " TODO: Make backrefs safer by using '\V' (very no-magic).
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 " TODO: Add a level of indirection, so that custom % scripts can use my
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 " work but extend it.
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39
15334
9d3d7b0f4861 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14254
diff changeset
40 " Allow user to prevent loading and prevent duplicate loading.
15729
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
41 if exists("g:loaded_matchit") || &cp
8720
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42 finish
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43 endif
15729
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
44 let g:loaded_matchit = 1
8720
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
46 let s:save_cpo = &cpo
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
47 set cpo&vim
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
48
15729
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
49 nnoremap <silent> <Plug>(MatchitNormalForward) :<C-U>call matchit#Match_wrapper('',1,'n')<CR>
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
50 nnoremap <silent> <Plug>(MatchitNormalBackward) :<C-U>call matchit#Match_wrapper('',0,'n')<CR>
18456
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 15729
diff changeset
51 xnoremap <silent> <Plug>(MatchitVisualForward) :<C-U>call matchit#Match_wrapper('',1,'v')<CR>m'gv``
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 15729
diff changeset
52 xnoremap <silent> <Plug>(MatchitVisualBackward) :<C-U>call matchit#Match_wrapper('',0,'v')<CR>m'gv``
15729
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
53 onoremap <silent> <Plug>(MatchitOperationForward) :<C-U>call matchit#Match_wrapper('',1,'o')<CR>
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
54 onoremap <silent> <Plug>(MatchitOperationBackward) :<C-U>call matchit#Match_wrapper('',0,'o')<CR>
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
55
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
56 nmap <silent> % <Plug>(MatchitNormalForward)
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
57 nmap <silent> g% <Plug>(MatchitNormalBackward)
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
58 xmap <silent> % <Plug>(MatchitVisualForward)
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
59 xmap <silent> g% <Plug>(MatchitVisualBackward)
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
60 omap <silent> % <Plug>(MatchitOperationForward)
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
61 omap <silent> g% <Plug>(MatchitOperationBackward)
8720
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
62
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
63 " Analogues of [{ and ]} using matching patterns:
15729
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
64 nnoremap <silent> <Plug>(MatchitNormalMultiBackward) :<C-U>call matchit#MultiMatch("bW", "n")<CR>
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
65 nnoremap <silent> <Plug>(MatchitNormalMultiForward) :<C-U>call matchit#MultiMatch("W", "n")<CR>
18456
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 15729
diff changeset
66 xnoremap <silent> <Plug>(MatchitVisualMultiBackward) :<C-U>call matchit#MultiMatch("bW", "n")<CR>m'gv``
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 15729
diff changeset
67 xnoremap <silent> <Plug>(MatchitVisualMultiForward) :<C-U>call matchit#MultiMatch("W", "n")<CR>m'gv``
15729
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
68 onoremap <silent> <Plug>(MatchitOperationMultiBackward) :<C-U>call matchit#MultiMatch("bW", "o")<CR>
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
69 onoremap <silent> <Plug>(MatchitOperationMultiForward) :<C-U>call matchit#MultiMatch("W", "o")<CR>
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
70
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
71 nmap <silent> [% <Plug>(MatchitNormalMultiBackward)
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
72 nmap <silent> ]% <Plug>(MatchitNormalMultiForward)
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
73 xmap <silent> [% <Plug>(MatchitVisualMultiBackward)
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
74 xmap <silent> ]% <Plug>(MatchitVisualMultiForward)
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
75 omap <silent> [% <Plug>(MatchitOperationMultiBackward)
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
76 omap <silent> ]% <Plug>(MatchitOperationMultiForward)
8720
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
77
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
78 " text object:
18456
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 15729
diff changeset
79 xmap <silent> <Plug>(MatchitVisualTextObject) <Plug>(MatchitVisualMultiBackward)o<Plug>(MatchitVisualMultiForward)
15729
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
80 xmap a% <Plug>(MatchitVisualTextObject)
8720
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
81
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
82 " Call this function to turn on debugging information. Every time the main
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
83 " script is run, buffer variables will be saved. These can be used directly
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
84 " or viewed using the menu items below.
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
85 if !exists(":MatchDebug")
15729
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
86 command! -nargs=0 MatchDebug call matchit#Match_debug()
8720
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
87 endif
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
88
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
89 let &cpo = s:save_cpo
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
90 unlet s:save_cpo
9380c37723f8 commit https://github.com/vim/vim/commit/aedfcbe1e6c7df6edcd6756d7601bfdec7dd2087
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
91
15729
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 15334
diff changeset
92 " vim:sts=2:sw=2:et: