home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.2.073 < prev    next >
Encoding:
Internet Message Format  |  2003-09-08  |  7.8 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.2.073
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.2.073
  11. Problem:    When adding detection of a specific filetype for a plugin you need
  12.         to edit "filetype.vim".
  13. Solution:   Source files from the "ftdetect" directory, so that a filetype
  14.         detection plugin only needs to be dropped in a directory.
  15. Files:        runtime/doc/filetype.txt, runtime/doc/usr_05.txt,
  16.         runtime/doc/usr_41.txt, runtime/filetype.vim
  17.  
  18.  
  19. *** ../vim-6.2.072/runtime/doc/filetype.txt    Sun Jun  1 12:20:32 2003
  20. --- runtime/doc/filetype.txt    Thu Aug 14 11:22:30 2003
  21. ***************
  22. *** 1,4 ****
  23. ! *filetype.txt*  For Vim version 6.2.  Last change: 2003 Apr 25
  24.   
  25.   
  26.             VIM REFERENCE MANUAL    by Bram Moolenaar
  27. --- 1,4 ----
  28. ! *filetype.txt*  For Vim version 6.2.  Last change: 2003 Aug 14
  29.   
  30.   
  31.             VIM REFERENCE MANUAL    by Bram Moolenaar
  32. ***************
  33. *** 147,157 ****
  34.   This means that the contents of compressed files are not inspected.
  35.   
  36.                               *new-filetype*
  37. ! If a file type that you want to use is not detected yet, there are two ways to
  38. ! add it.  In any way, it's better not modify the $VIMRUNTIME/filetype.vim file.
  39. ! It will be overwritten when installing a new version of Vim.
  40.   
  41. ! A. If your file type can be detected by the file name.
  42.      1. Create your user runtime directory.  You would normally use the first
  43.         item of the 'runtimepath' option.  Example for Unix: >
  44.       :!mkdir ~/.vim
  45. --- 147,187 ----
  46.   This means that the contents of compressed files are not inspected.
  47.   
  48.                               *new-filetype*
  49. ! If a file type that you want to use is not detected yet, there are three ways
  50. ! to add it.  In any way, it's better not modify the $VIMRUNTIME/filetype.vim
  51. ! file.  It will be overwritten when installing a new version of Vim.
  52. ! A. If you want to overrule all default file type checks.
  53. !    This works by writing one file for each filetype.  The disadvantage is that
  54. !    means there can be many files.  The advantage is that you can simply drop
  55. !    this file in the right directory to make it work.
  56.   
  57. !    1. Create your user runtime directory.  You would normally use the first
  58. !       item of the 'runtimepath' option.  Then create the directory "ftdetect"
  59. !       inside it.  Example for Unix: >
  60. !     :!mkdir ~/.vim
  61. !     :!mkdir ~/.vim/ftdetect
  62. ! <
  63. !    2. Create a file that contains an autocommand to detect the file type.
  64. !       Example: >
  65. !     au BufRead,BufNewFile *.mine        set filetype=mine
  66. ! <     Note that there is no "augroup" command, this has already been done
  67. !       when sourcing your file.  You could also use the pattern "*" and then
  68. !       check the contents of the file to recognize it.
  69. !       Write this file as "mine.vim" in the "filetype" directory in your user
  70. !       runtime directory.  For example, for Unix: >
  71. !     :w ~/.vim/ftdetect/mine.vim
  72. ! <  3. To use the new filetype detection you must restart Vim.
  73. !    The files in the "filetype" directory are used after all the default
  74. !    checks, thus they can overrule a previously detected file type.  You can
  75. !    also use that in your command.  For example, to use the file type
  76. !    "mypascal" when "pascal" has been detected: >
  77. !     au BufRead,BufNewFile *        if ft == 'pascal' | set ft=mypascal
  78. !                                        | endif
  79. ! B. If your file type can be detected by the file name.
  80.      1. Create your user runtime directory.  You would normally use the first
  81.         item of the 'runtimepath' option.  Example for Unix: >
  82.       :!mkdir ~/.vim
  83. ***************
  84. *** 177,183 ****
  85.      ":setfiletype" command will make sure that no other autocommands will set
  86.      'filetype' after this.
  87.                               *new-filetype-scripts*
  88. ! B. If your filetype can only be detected by inspecting the contents of the
  89.      file.
  90.   
  91.      1. Create your user runtime directory.  You would normally use the first
  92. --- 207,213 ----
  93.      ":setfiletype" command will make sure that no other autocommands will set
  94.      'filetype' after this.
  95.                               *new-filetype-scripts*
  96. ! C. If your filetype can only be detected by inspecting the contents of the
  97.      file.
  98.   
  99.      1. Create your user runtime directory.  You would normally use the first
  100. *** ../vim-6.2.072/runtime/doc/usr_05.txt    Sun Jun  1 12:20:36 2003
  101. --- runtime/doc/usr_05.txt    Wed Aug 13 22:15:03 2003
  102. ***************
  103. *** 1,4 ****
  104. ! *usr_05.txt*    For Vim version 6.2.  Last change: 2003 Mar 15
  105.   
  106.                VIM USER MANUAL - by Bram Moolenaar
  107.   
  108. --- 1,4 ----
  109. ! *usr_05.txt*    For Vim version 6.2.  Last change: 2003 Aug 13
  110.   
  111.                VIM USER MANUAL - by Bram Moolenaar
  112.   
  113. ***************
  114. *** 406,411 ****
  115. --- 406,412 ----
  116.   |write-plugin|        How to write a plugin script.
  117.   |plugin-details|    For more information about using plugins or when your
  118.               plugin doesn't work.
  119. + |new-filetype|        How to detect a new file type.
  120.   
  121.   ==============================================================================
  122.   *05.5*    Adding a help file        *add-local-help* *matchit-install*
  123. *** ../vim-6.2.072/runtime/doc/usr_41.txt    Sat Jul  5 19:20:12 2003
  124. --- runtime/doc/usr_41.txt    Thu Aug 14 11:22:51 2003
  125. ***************
  126. *** 1,4 ****
  127. ! *usr_41.txt*    For Vim version 6.2.  Last change: 2003 Jun 03
  128.   
  129.                VIM USER MANUAL - by Bram Moolenaar
  130.   
  131. --- 1,4 ----
  132. ! *usr_41.txt*    For Vim version 6.2.  Last change: 2003 Aug 14
  133.   
  134.                VIM USER MANUAL - by Bram Moolenaar
  135.   
  136. ***************
  137. *** 1432,1437 ****
  138. --- 1434,1457 ----
  139.   
  140.   Using references to other parts of the help in || is recommended.  This makes
  141.   it easy for the user to find associated help.
  142. + FILETYPE DETECTION                    *plugin-filetype*
  143. + If your filetype is not already detected by Vim, you should create a filetype
  144. + detection snippet in a separate file.  It is usually in the form of an
  145. + autocommand that sets the filetype when the file name matches a pattern.
  146. + Example: >
  147. +     au BufNewFile,BufRead *.foo                     set filetype=foofoo
  148. + Write this single-line file as "ftdetect/foofoo.vim" in the first directory
  149. + that appears in 'runtimepath'.  For Unix that would be
  150. + "~/.vim/ftdetect/foofoo.vim".  The convention is to use the name of the
  151. + filetype for the script name.
  152. + You can make more complicated checks if you like, for example to inspect the
  153. + contents of the file to recognize the language.  Also see |new-filetype|.
  154.   
  155.   
  156.   SUMMARY                            *plugin-special*
  157. *** ../vim-6.2.072/runtime/filetype.vim    Fri Jul 25 21:39:40 2003
  158. --- runtime/filetype.vim    Sun Aug 17 22:05:19 2003
  159. ***************
  160. *** 1,7 ****
  161.   " Vim support file to detect file types
  162.   "
  163.   " Maintainer:    Bram Moolenaar <Bram@vim.org>
  164. ! " Last Change:    2003 Jul 23
  165.   
  166.   " Listen very carefully, I will say this only once
  167.   if exists("did_load_filetypes")
  168. --- 1,7 ----
  169.   " Vim support file to detect file types
  170.   "
  171.   " Maintainer:    Bram Moolenaar <Bram@vim.org>
  172. ! " Last Change:    2003 Aug 17
  173.   
  174.   " Listen very carefully, I will say this only once
  175.   if exists("did_load_filetypes")
  176. ***************
  177. *** 1551,1556 ****
  178. --- 1575,1584 ----
  179.       \    || getline(4) =~ '^#' || getline(5) =~ '^#') |
  180.       \   setf conf |
  181.       \ endif
  182. + " Use the plugin-filetype checks last, they may overrule any of the previously
  183. + " detected filetypes.
  184. + runtime! ftdetect/*.vim
  185.   
  186.   augroup END
  187.   
  188. *** ../vim-6.2.072/src/version.c    Tue Sep  2 22:22:59 2003
  189. --- src/version.c    Tue Sep  9 22:14:57 2003
  190. ***************
  191. *** 632,633 ****
  192. --- 632,635 ----
  193.   {   /* Add new patch number below this line */
  194. + /**/
  195. +     73,
  196.   /**/
  197.  
  198. -- 
  199. The war between Emacs and Vi is over.  Vi has won with 3 to 1.
  200.             http://www.ssc.com/lg/issue30/raymond.html
  201.  
  202.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  203. ///          Creator of Vim - Vi IMproved -- http://www.Vim.org          \\\
  204. \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  205.  \\\  Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html  ///
  206.