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