comparison runtime/doc/usr_41.txt @ 2325:f177a6431514 vim73

Better implementation of creating the Color Scheme menu. (Juergen Kraemer)
author Bram Moolenaar <bram@vim.org>
date Sat, 17 Jul 2010 15:20:30 +0200
parents 6f63294a1781
children 12b829477c60
comparison
equal deleted inserted replaced
2324:0a258a67051d 2325:f177a6431514
1709 It's possible that a user doesn't always want to load this plugin. Or the 1709 It's possible that a user doesn't always want to load this plugin. Or the
1710 system administrator has dropped it in the system-wide plugin directory, but a 1710 system administrator has dropped it in the system-wide plugin directory, but a
1711 user has his own plugin he wants to use. Then the user must have a chance to 1711 user has his own plugin he wants to use. Then the user must have a chance to
1712 disable loading this specific plugin. This will make it possible: > 1712 disable loading this specific plugin. This will make it possible: >
1713 1713
1714 6 if exists("loaded_typecorr") 1714 6 if exists("g:loaded_typecorr")
1715 7 finish 1715 7 finish
1716 8 endif 1716 8 endif
1717 9 let loaded_typecorr = 1 1717 9 let g:loaded_typecorr = 1
1718 1718
1719 This also avoids that when the script is loaded twice it would cause error 1719 This also avoids that when the script is loaded twice it would cause error
1720 messages for redefining functions and cause trouble for autocommands that are 1720 messages for redefining functions and cause trouble for autocommands that are
1721 added twice. 1721 added twice.
1722
1723 The name is recommended to start with "loaded_" and then the file name of the
1724 plugin, literally. The "g:" is prepended just to avoid mistakes when using
1725 the variable in a function (without "g:" it would be a variable local to the
1726 function).
1727
1728 Using "finish" stops Vim from reading the rest of the file, it's much quicker
1729 than using if-endif around the whole file.
1722 1730
1723 1731
1724 MAPPING 1732 MAPPING
1725 1733
1726 Now let's make the plugin more interesting: We will add a mapping that adds a 1734 Now let's make the plugin more interesting: We will add a mapping that adds a
1894 1 " Vim global plugin for correcting typing mistakes 1902 1 " Vim global plugin for correcting typing mistakes
1895 2 " Last Change: 2000 Oct 15 1903 2 " Last Change: 2000 Oct 15
1896 3 " Maintainer: Bram Moolenaar <Bram@vim.org> 1904 3 " Maintainer: Bram Moolenaar <Bram@vim.org>
1897 4 " License: This file is placed in the public domain. 1905 4 " License: This file is placed in the public domain.
1898 5 1906 5
1899 6 if exists("loaded_typecorr") 1907 6 if exists("g:loaded_typecorr")
1900 7 finish 1908 7 finish
1901 8 endif 1909 8 endif
1902 9 let loaded_typecorr = 1 1910 9 let g:loaded_typecorr = 1
1903 10 1911 10
1904 11 let s:save_cpo = &cpo 1912 11 let s:save_cpo = &cpo
1905 12 set cpo&vim 1913 12 set cpo&vim
1906 13 1914 13
1907 14 iabbrev teh the 1915 14 iabbrev teh the