Mercurial > vim
comparison runtime/doc/repeat.txt @ 8182:95d59081580f v7.4.1384
commit https://github.com/vim/vim/commit/f6fee0e2d4341c0c2f5339c1268e5877fafd07cf
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Feb 21 23:02:49 2016 +0100
patch 7.4.1384
Problem: It is not easy to use a set of plugins and their dependencies.
Solution: Add packages, ":loadopt", 'packpath'.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 21 Feb 2016 23:15:05 +0100 |
parents | abd64cf67bcf |
children | f16bfe02cef1 |
comparison
equal
deleted
inserted
replaced
8181:f478d4537f82 | 8182:95d59081580f |
---|---|
1 *repeat.txt* For Vim version 7.4. Last change: 2016 Feb 12 | 1 *repeat.txt* For Vim version 7.4. Last change: 2016 Feb 21 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
10 | 10 |
11 1. Single repeats |single-repeat| | 11 1. Single repeats |single-repeat| |
12 2. Multiple repeats |multi-repeat| | 12 2. Multiple repeats |multi-repeat| |
13 3. Complex repeats |complex-repeat| | 13 3. Complex repeats |complex-repeat| |
14 4. Using Vim scripts |using-scripts| | 14 4. Using Vim scripts |using-scripts| |
15 5. Debugging scripts |debug-scripts| | 15 5. Using Vim packages |packages| |
16 6. Profiling |profiling| | 16 6. Debugging scripts |debug-scripts| |
17 7. Profiling |profiling| | |
17 | 18 |
18 ============================================================================== | 19 ============================================================================== |
19 1. Single repeats *single-repeat* | 20 1. Single repeats *single-repeat* |
20 | 21 |
21 *.* | 22 *.* |
210 when no file could be found. | 211 when no file could be found. |
211 When 'verbose' is two or higher, there is a message | 212 When 'verbose' is two or higher, there is a message |
212 about each searched file. | 213 about each searched file. |
213 {not in Vi} | 214 {not in Vi} |
214 | 215 |
216 *:loadp* *:loadplugin* | |
217 :loadp[lugin] {name} Search for an optional plugin directory and source the | |
218 plugin files found. It is similar to: > | |
219 :runtime pack/*/opt/{name}/plugin/*.vim | |
220 < However, `:loadplugin` uses 'packpath' instead of | |
221 'runtimepath'. And the directory found is added to | |
222 'runtimepath'. | |
223 | |
224 Note that {name} is the directory name, not the name | |
225 of the .vim file. If the "{name}/plugin" directory | |
226 contains more than one file they are all sourced. | |
227 | |
228 Also see |load-plugin|. | |
229 | |
230 {not available without the |+packages| feature} | |
231 | |
215 :scripte[ncoding] [encoding] *:scripte* *:scriptencoding* *E167* | 232 :scripte[ncoding] [encoding] *:scripte* *:scriptencoding* *E167* |
216 Specify the character encoding used in the script. | 233 Specify the character encoding used in the script. |
217 The following lines will be converted from [encoding] | 234 The following lines will be converted from [encoding] |
218 to the value of the 'encoding' option, if they are | 235 to the value of the 'encoding' option, if they are |
219 different. Examples: > | 236 different. Examples: > |
386 For example for this Vi mapping: > | 403 For example for this Vi mapping: > |
387 :map xx asdf\ | 404 :map xx asdf\ |
388 < Therefore the unusual leading backslash is used. | 405 < Therefore the unusual leading backslash is used. |
389 | 406 |
390 ============================================================================== | 407 ============================================================================== |
391 5. Debugging scripts *debug-scripts* | 408 5. Using Vim packages *packages* |
409 | |
410 A Vim package is a directory that contains one or more plugins. The | |
411 advantages over normal plugins: | |
412 - A package can be downloaded as an archive and unpacked in its own directory. | |
413 That makes it easy to updated and/or remove. | |
414 - A package can be a git, mercurial, etc. respository. That makes it really | |
415 easy to update. | |
416 - A package can contain multiple plugins that depend on each other. | |
417 - A package can contain plugins that are automatically loaded on startup and | |
418 ones that are only loaded when needed with `:loadplugin`. | |
419 | |
420 Let's assume your Vim files are in the "~/.vim" directory and you want to add a | |
421 package from a zip archive "/tmp/mypack.zip": | |
422 % mkdir -p ~/.vim/pack/my | |
423 % cd ~/.vim/pack/my | |
424 % unzip /tmp/mypack.zip | |
425 | |
426 The directory name "my" is arbitrary, you can pick anything you like. | |
427 | |
428 You would now have these files under ~/.vim: | |
429 pack/my/README.txt | |
430 pack/my/ever/always/plugin/always.vim | |
431 pack/my/ever/always/syntax/always.vim | |
432 pack/my/opt/mydebug/plugin/debugger.vim | |
433 | |
434 When Vim starts up it scans all directories in 'packpath' for plugins under the | |
435 "ever" directory and loads them. When found that directory is added to | |
436 'runtimepath'. | |
437 | |
438 In the example Vim will find "my/ever/always/plugin/always.vim" and adds | |
439 "~/.vim/pack/my/ever/always" to 'runtimepath'. | |
440 | |
441 If the "always" plugin kicks in and sets the 'filetype' to "always", Vim will | |
442 find the syntax/always.vim file, because its directory is in 'runtimepath'. | |
443 | |
444 *load-plugin* | |
445 To load an optional plugin from a pack use the `:loadplugin` command: > | |
446 :loadplugin mydebug | |
447 This could be done inside always.vim, if some conditions are met. | |
448 Or you could add this command to your |.vimrc|. | |
449 | |
450 It is perfectly normal for a package to only have files in the "opt" | |
451 directory. You then need to load each plugin when you want to use it. | |
452 | |
453 Loading packages will not happen if loading plugins is disabled, see | |
454 |load-plugins|. | |
455 | |
456 ============================================================================== | |
457 6. Debugging scripts *debug-scripts* | |
392 | 458 |
393 Besides the obvious messages that you can add to your scripts to find out what | 459 Besides the obvious messages that you can add to your scripts to find out what |
394 they are doing, Vim offers a debug mode. This allows you to step through a | 460 they are doing, Vim offers a debug mode. This allows you to step through a |
395 sourced file or user function and set breakpoints. | 461 sourced file or user function and set breakpoints. |
396 | 462 |
611 :0debugg[reedy] | 677 :0debugg[reedy] |
612 Undo ":debuggreedy": get debug mode commands directly from the | 678 Undo ":debuggreedy": get debug mode commands directly from the |
613 user, don't use typeahead for debug commands. | 679 user, don't use typeahead for debug commands. |
614 | 680 |
615 ============================================================================== | 681 ============================================================================== |
616 6. Profiling *profile* *profiling* | 682 7. Profiling *profile* *profiling* |
617 | 683 |
618 Profiling means that Vim measures the time that is spent on executing | 684 Profiling means that Vim measures the time that is spent on executing |
619 functions and/or scripts. The |+profile| feature is required for this. | 685 functions and/or scripts. The |+profile| feature is required for this. |
620 It is only included when Vim was compiled with "huge" features. | 686 It is only included when Vim was compiled with "huge" features. |
621 {Vi does not have profiling} | 687 {Vi does not have profiling} |