To: vim_dev@googlegroups.com Subject: Patch 7.4.1528 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1528 Problem: Using "ever" for packages is confusing. Solution: Use "start", as it's related to startup. Files: src/ex_cmds2.c, runtime/doc/repeat.txt *** ../vim-7.4.1527/src/ex_cmds2.c 2016-03-06 14:44:03.810733631 +0100 --- src/ex_cmds2.c 2016-03-09 22:12:45.058346873 +0100 *************** *** 3118,3125 **** } /* now we have: ! * rtp/pack/name/ever/name ! * p4 p3 p2 p1 * * find the part up to "pack" in 'runtimepath' */ c = *p4; --- 3118,3125 ---- } /* now we have: ! * rtp/pack/name/start/name ! * p4 p3 p2 p1 * * find the part up to "pack" in 'runtimepath' */ c = *p4; *************** *** 3195,3201 **** void source_packages() { ! do_in_path(p_pp, (char_u *)"pack/*/ever/*", DIP_ALL + DIP_DIR, add_pack_plugin, p_pp); } --- 3195,3201 ---- void source_packages() { ! do_in_path(p_pp, (char_u *)"pack/*/start/*", DIP_ALL + DIP_DIR, add_pack_plugin, p_pp); } *** ../vim-7.4.1527/runtime/doc/repeat.txt 2016-03-06 14:44:03.806733673 +0100 --- runtime/doc/repeat.txt 2016-03-09 22:13:46.637691845 +0100 *************** *** 413,469 **** A Vim package is a directory that contains one or more plugins. The advantages over normal plugins: - A package can be downloaded as an archive and unpacked in its own directory. ! That makes it easy to updated and/or remove. - A package can be a git, mercurial, etc. repository. That makes it really easy to update. - A package can contain multiple plugins that depend on each other. - A package can contain plugins that are automatically loaded on startup and ! ones that are only loaded when needed with `:loadplugin`. Let's assume your Vim files are in the "~/.vim" directory and you want to add a ! package from a zip archive "/tmp/mypack.zip": ! % mkdir -p ~/.vim/pack/my ! % cd ~/.vim/pack/my ! % unzip /tmp/mypack.zip ! The directory name "my" is arbitrary, you can pick anything you like. You would now have these files under ~/.vim: ! pack/my/README.txt ! pack/my/ever/always/plugin/always.vim ! pack/my/ever/always/syntax/always.vim ! pack/my/opt/mydebug/plugin/debugger.vim If you don't have a package but a single plugin, you need to create the extra directory level: ! % mkdir -p ~/.vim/pack/my/ever/always ! % cd ~/.vim/pack/my/ever/always ! % unzip /tmp/myplugin.zip ! When Vim starts up it scans all directories in 'packpath' for plugins under the ! "ever" directory and loads them. When found that directory is added to ! 'runtimepath'. ! In the example Vim will find "my/ever/always/plugin/always.vim" and adds ! "~/.vim/pack/my/ever/always" to 'runtimepath'. - If the "always" plugin kicks in and sets the 'filetype' to "always", Vim will - find the syntax/always.vim file, because its directory is in 'runtimepath'. - - Vim will also load ftdetect files, like with |:packadd|. *pack-add* To load an optional plugin from a pack use the `:packadd` command: > ! :packadd mydebug ! This could be done inside always.vim, if some conditions are met. ! Or you could add this command to your |.vimrc|. It is perfectly normal for a package to only have files in the "opt" directory. You then need to load each plugin when you want to use it. - Loading packages will not happen if loading plugins is disabled, see - |load-plugins|. - ============================================================================== 6. Debugging scripts *debug-scripts* --- 420,498 ---- A Vim package is a directory that contains one or more plugins. The advantages over normal plugins: - A package can be downloaded as an archive and unpacked in its own directory. ! Thus the files are not mixed with files of other plugins. That makes it ! easy to update and remove. - A package can be a git, mercurial, etc. repository. That makes it really easy to update. - A package can contain multiple plugins that depend on each other. - A package can contain plugins that are automatically loaded on startup and ! ones that are only loaded when needed with `:packadd`. ! ! ! Using a package and loading automatically ~ Let's assume your Vim files are in the "~/.vim" directory and you want to add a ! package from a zip archive "/tmp/foopack.zip": ! % mkdir -p ~/.vim/pack/foo ! % cd ~/.vim/pack/foo ! % unzip /tmp/foopack.zip ! The directory name "foo" is arbitrary, you can pick anything you like. You would now have these files under ~/.vim: ! pack/foo/README.txt ! pack/foo/start/foobar/plugin/foo.vim ! pack/foo/start/foobar/syntax/some.vim ! pack/foo/opt/foodebug/plugin/debugger.vim ! ! When Vim starts up, after processing your .vimrc, it scans all directories in ! 'packpath' for plugins under the "pack/*/start" directory and loads them. The ! directory is added to 'runtimepath'. ! ! In the example Vim will find "pack/foo/start/foobar/plugin/foo.vim" and adds ! "~/.vim/pack/foo/start/foobar" to 'runtimepath'. ! ! If the "foobar" plugin kicks in and sets the 'filetype' to "some", Vim will ! find the syntax/some.vim file, because its directory is in 'runtimepath'. ! ! Vim will also load ftdetect files, if there are any. ! ! Note that the files under "pack/foo/opt" or not loaded automatically, only the ! ones under "pack/foo/start". See |pack-add| below for how the "opt" directory ! is used. ! ! Loading packages will not happen if loading plugins is disabled, see ! |load-plugins|. ! ! ! Using a single plugin and loading it automatically ~ If you don't have a package but a single plugin, you need to create the extra directory level: ! % mkdir -p ~/.vim/pack/foo/start/foobar ! % cd ~/.vim/pack/foo/start/foobar ! % unzip /tmp/someplugin.zip ! You would now have these files: ! pack/foo/start/foobar/plugin/foo.vim ! pack/foo/start/foobar/syntax/some.vim ! From here it works like above. + Optional plugins ~ *pack-add* To load an optional plugin from a pack use the `:packadd` command: > ! :packadd foodebug ! This searches for "pack/*/opt/foodebug" in 'packpath' and will find ! ~/.vim/pack/foo/opt/foodebug/plugin/debugger.vim and source it. ! ! This could be done inside always.vim, if some conditions are met. Or you ! could add this command to your |.vimrc|. It is perfectly normal for a package to only have files in the "opt" directory. You then need to load each plugin when you want to use it. ============================================================================== 6. Debugging scripts *debug-scripts* *** ../vim-7.4.1527/src/version.c 2016-03-09 21:50:01.932868282 +0100 --- src/version.c 2016-03-09 22:11:38.743052364 +0100 *************** *** 745,746 **** --- 745,748 ---- { /* Add new patch number below this line */ + /**/ + 1528, /**/ -- Q: What is the difference betwee open-source and commercial software? A: If you have a problem with commercial software you can call a phone number and they will tell you it might be solved in a future version. For open-source software there isn't a phone number to call, but you get the solution within a day. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///