Skip to content

Commit 7826fd7

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents c561f1d + 1e7885a commit 7826fd7

File tree

22 files changed

+1066
-976
lines changed

22 files changed

+1066
-976
lines changed

Filelist

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,6 @@ RT_ALL = \
495495
runtime/macros/life/click.me \
496496
runtime/macros/life/life.vim \
497497
runtime/macros/matchit.vim \
498-
runtime/macros/matchit.txt \
499498
runtime/macros/maze/README.txt \
500499
runtime/macros/maze/[mM]akefile \
501500
runtime/macros/maze/main.aap \
@@ -525,6 +524,9 @@ RT_ALL = \
525524
runtime/tutor/tutor \
526525
runtime/tutor/tutor.vim \
527526
runtime/vimrc_example.vim \
527+
runtime/pack/dist/opt/matchit/plugin/matchit.vim \
528+
runtime/pack/dist/opt/matchit/doc/matchit.txt \
529+
runtime/pack/dist/opt/matchit/doc/tags \
528530

529531
# runtime files for all distributions without CR-NL translation
530532
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

0 commit comments

Comments
 (0)