Skip to content

Commit aedfcbe

Browse files
committed
patch 7.4.1649
Problem: The matchit plugin needs to be copied to be used. Solution: Put the matchit plugin in an optional package.
1 parent bee6c0c commit aedfcbe

File tree

10 files changed

+149
-36
lines changed

10 files changed

+149
-36
lines changed

Filelist

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,8 +494,6 @@ RT_ALL = \
494494
runtime/macros/less.vim \
495495
runtime/macros/life/click.me \
496496
runtime/macros/life/life.vim \
497-
runtime/macros/matchit.vim \
498-
runtime/macros/matchit.txt \
499497
runtime/macros/maze/README.txt \
500498
runtime/macros/maze/[mM]akefile \
501499
runtime/macros/maze/main.aap \
@@ -525,6 +523,9 @@ RT_ALL = \
525523
runtime/tutor/tutor \
526524
runtime/tutor/tutor.vim \
527525
runtime/vimrc_example.vim \
526+
runtime/pack/dist/opt/matchit/plugin/matchit.vim \
527+
runtime/pack/dist/opt/matchit/doc/matchit.txt \
528+
runtime/pack/dist/opt/matchit/doc/tags \
528529

529530
# runtime files for all distributions without CR-NL translation
530531
RT_ALL_BIN = \

runtime/doc/usr_05.txt

Lines changed: 58 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*usr_05.txt* For Vim version 7.4. Last change: 2012 Nov 20
1+
*usr_05.txt* For Vim version 7.4. Last change: 2016 Mar 25
22

33
VIM USER MANUAL - by Bram Moolenaar
44

@@ -12,10 +12,11 @@ Vim's capabilities. Or define your own macros.
1212
|05.1| The vimrc file
1313
|05.2| The example vimrc file explained
1414
|05.3| Simple mappings
15-
|05.4| Adding a plugin
16-
|05.5| Adding a help file
17-
|05.6| The option window
18-
|05.7| Often used options
15+
|05.4| Adding a package
16+
|05.5| Adding a plugin
17+
|05.6| Adding a help file
18+
|05.7| The option window
19+
|05.8| Often used options
1920

2021
Next chapter: |usr_06.txt| Using syntax highlighting
2122
Previous chapter: |usr_04.txt| Making small changes
@@ -263,7 +264,46 @@ The ":map" command (with no arguments) lists your current mappings. At
263264
least the ones for Normal mode. More about mappings in section |40.1|.
264265

265266
==============================================================================
266-
*05.4* Adding a plugin *add-plugin* *plugin*
267+
*05.4* Adding a package *add-package* *matchit-install*
268+
269+
A package is a set of files that you can add to Vim. There are two kinds of
270+
packages: optional and automatically loaded on startup.
271+
272+
The Vim distribution comes with a few packages that you can optionally use.
273+
For example, the matchit plugin. This plugin makes the "%" command jump to
274+
matching HTML tags, if/else/endif in Vim scripts, etc. Very useful, although
275+
it's not backwards compatible (that's why it is not enabled by default).
276+
277+
To start using the matchit plugin, add one line to your vimrc file: >
278+
packadd matchit
279+
280+
That's all! You can also type the command to try it out. Now you can find
281+
help about this plugin: >
282+
:help matchit
283+
284+
This works, because when `:packadd` loaded the plugin it also added the
285+
package directory in 'runtimepath', so that the help file can be found.
286+
287+
You can find packages on the Internet in various places. It usually comes as
288+
an archive or as a repository. For an archive you can follow these steps:
289+
1. create the package directory: >
290+
mkdir -p ~/.vim/pack/fancy
291+
< "fancy" can be any name of your liking. Use one that describes the
292+
package.
293+
2. unpack the archive in that directory. This assumes the top
294+
directory in the archive is "start": >
295+
cd ~/.vim/pack/fancy
296+
unzip /tmp/fancy.zip
297+
< If the archive layout is different make sure that you end up with a
298+
path like this:
299+
~/.vim/pack/fancy/start/fancytext/plugin/fancy.vim ~
300+
Here "fancytext" is the name of the package, it can be anything
301+
else.
302+
303+
More information about packages can be found here: |packages|.
304+
305+
==============================================================================
306+
*05.5* Adding a plugin *add-plugin* *plugin*
267307

268308
Vim's functionality can be extended by adding plugins. A plugin is nothing
269309
more than a Vim script file that is loaded automatically when Vim starts. You
@@ -415,23 +455,19 @@ Further reading:
415455
|new-filetype| How to detect a new file type.
416456

417457
==============================================================================
418-
*05.5* Adding a help file *add-local-help* *matchit-install*
458+
*05.6* Adding a help file *add-local-help*
419459

420460
If you are lucky, the plugin you installed also comes with a help file. We
421461
will explain how to install the help file, so that you can easily find help
422462
for your new plugin.
423-
Let us use the "matchit.vim" plugin as an example (it is included with
424-
Vim). This plugin makes the "%" command jump to matching HTML tags,
425-
if/else/endif in Vim scripts, etc. Very useful, although it's not backwards
426-
compatible (that's why it is not enabled by default).
427-
This plugin comes with documentation: "matchit.txt". Let's first copy the
428-
plugin to the right directory. This time we will do it from inside Vim, so
429-
that we can use $VIMRUNTIME. (You may skip some of the "mkdir" commands if
430-
you already have the directory.) >
463+
Let us use the "doit.vim" plugin as an example. This plugin comes with
464+
documentation: "doit.txt". Let's first copy the plugin to the right
465+
directory. This time we will do it from inside Vim. (You may skip some of
466+
the "mkdir" commands if you already have the directory.) >
431467
432468
:!mkdir ~/.vim
433469
:!mkdir ~/.vim/plugin
434-
:!cp $VIMRUNTIME/macros/matchit.vim ~/.vim/plugin
470+
:!cp /tmp/doit.vim ~/.vim/plugin
435471
436472
The "cp" command is for Unix, on MS-DOS you can use "copy".
437473

@@ -441,7 +477,7 @@ Now create a "doc" directory in one of the directories in 'runtimepath'. >
441477
442478
Copy the help file to the "doc" directory. >
443479
444-
:!cp $VIMRUNTIME/macros/matchit.txt ~/.vim/doc
480+
:!cp /tmp/doit.txt ~/.vim/doc
445481
446482
Now comes the trick, which allows you to jump to the subjects in the new help
447483
file: Generate the local tags file with the |:helptags| command. >
@@ -450,10 +486,10 @@ file: Generate the local tags file with the |:helptags| command. >
450486
451487
Now you can use the >
452488
453-
:help g%
489+
:help doit
454490
455-
command to find help for "g%" in the help file you just added. You can see an
456-
entry for the local help file when you do: >
491+
command to find help for "doit" in the help file you just added. You can see
492+
an entry for the local help file when you do: >
457493
458494
:help local-additions
459495
@@ -464,7 +500,7 @@ them through the tag.
464500
For writing a local help file, see |write-local-help|.
465501

466502
==============================================================================
467-
*05.6* The option window
503+
*05.7* The option window
468504

469505
If you are looking for an option that does what you want, you can search in
470506
the help files here: |options|. Another way is by using this command: >
@@ -503,7 +539,7 @@ border. This is what the 'scrolloff' option does, it specifies an offset
503539
from the window border where scrolling starts.
504540

505541
==============================================================================
506-
*05.7* Often used options
542+
*05.8* Often used options
507543

508544
There are an awful lot of options. Most of them you will hardly ever use.
509545
Some of the more useful ones will be mentioned here. Don't forget you can

runtime/doc/usr_toc.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*usr_toc.txt* For Vim version 7.4. Last change: 2010 Jul 20
1+
*usr_toc.txt* For Vim version 7.4. Last change: 2016 Mar 25
22

33
VIM USER MANUAL - by Bram Moolenaar
44

@@ -104,10 +104,11 @@ Read this from start to end to learn the essential commands.
104104
|05.1| The vimrc file
105105
|05.2| The example vimrc file explained
106106
|05.3| Simple mappings
107-
|05.4| Adding a plugin
108-
|05.5| Adding a help file
109-
|05.6| The option window
110-
|05.7| Often used options
107+
|05.4| Adding a package
108+
|05.5| Adding a plugin
109+
|05.6| Adding a help file
110+
|05.7| The option window
111+
|05.8| Often used options
111112

112113
|usr_06.txt| Using syntax highlighting
113114
|06.1| Switching it on

runtime/macros/README.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ dvorak for when you use a Dvorak keyboard
1515

1616
justify.vim user function for justifying text
1717

18-
matchit.vim + matchit.txt make % match if-fi, HTML tags, and much more
19-
2018
less.sh + less.vim make Vim work like less (or more)
2119

2220
shellmenu.vim menus for editing shell scripts in the GUI version
@@ -26,5 +24,9 @@ swapmous.vim swap left and right mouse buttons
2624
editexisting.vim when editing a file that is already edited with
2725
another Vim instance
2826

29-
This one is only for Unix. It can be found in the extra archive:
27+
This one is only for Unix.
3028
file_select.vim macros that make a handy file selector
29+
30+
The matchit plugin has been moved to an optional package. To load it put this
31+
line in your vimrc file:
32+
:packadd matchit
File renamed without changes.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
:MatchDebug matchit.txt /*:MatchDebug*
2+
MatchError matchit.txt /*MatchError*
3+
[% matchit.txt /*[%*
4+
]% matchit.txt /*]%*
5+
b:match_col matchit.txt /*b:match_col*
6+
b:match_debug matchit.txt /*b:match_debug*
7+
b:match_ignorecase matchit.txt /*b:match_ignorecase*
8+
b:match_ini matchit.txt /*b:match_ini*
9+
b:match_iniBR matchit.txt /*b:match_iniBR*
10+
b:match_match matchit.txt /*b:match_match*
11+
b:match_pat matchit.txt /*b:match_pat*
12+
b:match_skip matchit.txt /*b:match_skip*
13+
b:match_table matchit.txt /*b:match_table*
14+
b:match_tail matchit.txt /*b:match_tail*
15+
b:match_wholeBR matchit.txt /*b:match_wholeBR*
16+
b:match_word matchit.txt /*b:match_word*
17+
b:match_words matchit.txt /*b:match_words*
18+
g% matchit.txt /*g%*
19+
matchit matchit.txt /*matchit*
20+
matchit-% matchit.txt /*matchit-%*
21+
matchit-\1 matchit.txt /*matchit-\\1*
22+
matchit-activate matchit.txt /*matchit-activate*
23+
matchit-backref matchit.txt /*matchit-backref*
24+
matchit-bugs matchit.txt /*matchit-bugs*
25+
matchit-choose matchit.txt /*matchit-choose*
26+
matchit-configure matchit.txt /*matchit-configure*
27+
matchit-debug matchit.txt /*matchit-debug*
28+
matchit-details matchit.txt /*matchit-details*
29+
matchit-highlight matchit.txt /*matchit-highlight*
30+
matchit-hl matchit.txt /*matchit-hl*
31+
matchit-intro matchit.txt /*matchit-intro*
32+
matchit-languages matchit.txt /*matchit-languages*
33+
matchit-modes matchit.txt /*matchit-modes*
34+
matchit-newlang matchit.txt /*matchit-newlang*
35+
matchit-o_% matchit.txt /*matchit-o_%*
36+
matchit-parse matchit.txt /*matchit-parse*
37+
matchit-s:notend matchit.txt /*matchit-s:notend*
38+
matchit-s:sol matchit.txt /*matchit-s:sol*
39+
matchit-spaces matchit.txt /*matchit-spaces*
40+
matchit-troubleshoot matchit.txt /*matchit-troubleshoot*
41+
matchit-v_% matchit.txt /*matchit-v_%*
42+
matchit.txt matchit.txt /*matchit.txt*
43+
matchit.vim matchit.txt /*matchit.vim*
44+
o_[% matchit.txt /*o_[%*
45+
o_]% matchit.txt /*o_]%*
46+
o_g% matchit.txt /*o_g%*
47+
v_[% matchit.txt /*v_[%*
48+
v_]% matchit.txt /*v_]%*
49+
v_a% matchit.txt /*v_a%*
50+
v_g% matchit.txt /*v_g%*

runtime/macros/matchit.vim renamed to runtime/pack/dist/opt/matchit/plugin/matchit.vim

File renamed without changes.

runtime/vimrc_example.vim

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
" An example for a vimrc file.
22
"
33
" Maintainer: Bram Moolenaar <[email protected]>
4-
" Last change: 2015 Mar 24
4+
" Last change: 2016 Mar 25
55
"
66
" To use it, copy it to
77
" for Unix and OS/2: ~/.vimrc
@@ -100,3 +100,10 @@ if has('langmap') && exists('+langnoremap')
100100
" compatible).
101101
set langnoremap
102102
endif
103+
104+
105+
" Add optional packages.
106+
"
107+
" The matchit plugin makes the % command work better, but it is not backwards
108+
" compatible.
109+
packadd matchit

src/Makefile

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
# make installlinks only installs the Vim binary links
131131
# make installmanlinks only installs the Vim manpage links
132132
# make installmacros only installs the Vim macros
133+
# make installpack only installs the packages
133134
# make installtutorbin only installs the Vim tutor program
134135
# make installtutor only installs the Vim tutor files
135136
# make installspell only installs the spell files
@@ -1008,6 +1009,7 @@ LANGSUBDIR = /lang
10081009
COMPSUBDIR = /compiler
10091010
KMAPSUBDIR = /keymap
10101011
MACROSUBDIR = /macros
1012+
PACKSUBDIR = /pack
10111013
TOOLSSUBDIR = /tools
10121014
TUTORSUBDIR = /tutor
10131015
SPELLSUBDIR = /spell
@@ -1029,6 +1031,7 @@ PODIR = po
10291031
### COMPSUBLOC location for compiler files
10301032
### KMAPSUBLOC location for keymap files
10311033
### MACROSUBLOC location for macro files
1034+
### PACKSUBLOC location for packages
10321035
### TOOLSSUBLOC location for tools files
10331036
### TUTORSUBLOC location for tutor files
10341037
### SPELLSUBLOC location for spell files
@@ -1050,6 +1053,7 @@ LANGSUBLOC = $(VIMRTLOC)$(LANGSUBDIR)
10501053
COMPSUBLOC = $(VIMRTLOC)$(COMPSUBDIR)
10511054
KMAPSUBLOC = $(VIMRTLOC)$(KMAPSUBDIR)
10521055
MACROSUBLOC = $(VIMRTLOC)$(MACROSUBDIR)
1056+
PACKSUBLOC = $(VIMRTLOC)$(PACKSUBDIR)
10531057
TOOLSSUBLOC = $(VIMRTLOC)$(TOOLSSUBDIR)
10541058
TUTORSUBLOC = $(VIMRTLOC)$(TUTORSUBDIR)
10551059
SPELLSUBLOC = $(VIMRTLOC)$(SPELLSUBDIR)
@@ -1155,6 +1159,9 @@ FTPLUGSOURCE = ../runtime/ftplugin
11551159
# Where to copy the macro files from
11561160
MACROSOURCE = ../runtime/macros
11571161

1162+
# Where to copy the package files from
1163+
PACKSOURCE = ../runtime/pack
1164+
11581165
# Where to copy the tools files from
11591166
TOOLSSOURCE = ../runtime/tools
11601167

@@ -1430,6 +1437,7 @@ DEST_LANG = $(DESTDIR)$(LANGSUBLOC)
14301437
DEST_COMP = $(DESTDIR)$(COMPSUBLOC)
14311438
DEST_KMAP = $(DESTDIR)$(KMAPSUBLOC)
14321439
DEST_MACRO = $(DESTDIR)$(MACROSUBLOC)
1440+
DEST_PACK = $(DESTDIR)$(PACKSUBLOC)
14331441
DEST_TOOLS = $(DESTDIR)$(TOOLSSUBLOC)
14341442
DEST_TUTOR = $(DESTDIR)$(TUTORSUBLOC)
14351443
DEST_SPELL = $(DESTDIR)$(SPELLSUBLOC)
@@ -2107,7 +2115,7 @@ INSTALLMANARGS = $(VIMLOC) $(SCRIPTLOC) $(VIMRCLOC) $(HELPSOURCE) $(MANMOD) \
21072115
$(VIMNAME) $(VIMDIFFNAME) $(EVIMNAME)
21082116

21092117
# Install most of the runtime files
2110-
installruntime: installrtbase installmacros installtutor installspell
2118+
installruntime: installrtbase installmacros installpack installtutor installspell
21112119

21122120
# install the help files; first adjust the contents for the final location
21132121
installrtbase: $(HELPSOURCE)/vim.1 $(DEST_VIM) $(DEST_RT) \
@@ -2206,6 +2214,11 @@ installmacros: $(DEST_VIM) $(DEST_RT) $(DEST_MACRO)
22062214
rm -rf $$cvs; \
22072215
fi
22082216

2217+
installpack: $(DEST_VIM) $(DEST_RT) $(DEST_PACK)
2218+
$(INSTALL_DATA_R) $(PACKSOURCE)/* $(DEST_PACK)
2219+
chmod $(DIRMOD) `find $(DEST_PACK) -type d -print`
2220+
chmod $(FILEMOD) `find $(DEST_PACK) -type f -print`
2221+
22092222
# install the tutor files
22102223
installtutorbin: $(DEST_VIM)
22112224
$(INSTALL_DATA) vimtutor $(DEST_BIN)/$(VIMNAME)tutor
@@ -2355,8 +2368,8 @@ $(HELPSOURCE)/vim.1 $(MACROSOURCE) $(TOOLSSOURCE):
23552368
$(DESTDIR)$(exec_prefix) $(DEST_BIN) \
23562369
$(DEST_VIM) $(DEST_RT) $(DEST_HELP) \
23572370
$(DEST_PRINT) $(DEST_COL) $(DEST_SYN) $(DEST_IND) $(DEST_FTP) \
2358-
$(DEST_LANG) $(DEST_KMAP) $(DEST_COMP) \
2359-
$(DEST_MACRO) $(DEST_TOOLS) $(DEST_TUTOR) $(DEST_SPELL) \
2371+
$(DEST_LANG) $(DEST_KMAP) $(DEST_COMP) $(DEST_MACRO) \
2372+
$(DEST_PACK) $(DEST_TOOLS) $(DEST_TUTOR) $(DEST_SPELL) \
23602373
$(DEST_AUTO) $(DEST_AUTO)/xml $(DEST_PLUG):
23612374
-$(SHELL) ./mkinstalldirs $@
23622375
-chmod $(DIRMOD) $@
@@ -2501,6 +2514,7 @@ uninstall_runtime:
25012514
-rm -f $(DEST_SYN)/*.vim $(DEST_SYN)/README.txt
25022515
-rm -f $(DEST_IND)/*.vim $(DEST_IND)/README.txt
25032516
-rm -rf $(DEST_MACRO)
2517+
-rm -rf $(DEST_PACK)
25042518
-rm -rf $(DEST_TUTOR)
25052519
-rm -rf $(DEST_SPELL)
25062520
-rm -rf $(DEST_TOOLS)

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,8 @@ static char *(features[]) =
748748

749749
static int included_patches[] =
750750
{ /* Add new patch number below this line */
751+
/**/
752+
1649,
751753
/**/
752754
1648,
753755
/**/

0 commit comments

Comments
 (0)