*usr_43.txt*	 Vim version 6.2.   : 2002 Jul 14

		  VIM -  

			    


   ̣ ,     C 
  ,         
.        
.    ,    .

|43.1|	   
|43.2|	   

  : |usr_44.txt|     
 : |usr_42.txt|	  
      : |usr_toc.txt|

==============================================================================
*43.1*	   		  *filetype-plugin* *_-*

         
: |___|. ,   , 
,   ,      
. ,     C    
  'softtabstop'  4   ,  
ң .      :

		        *your-runtime-dir* *____*
1.       .  Unix  
   "~/.vim".      "ftplugin": >

	mkdir ~/.vim
	mkdir ~/.vim/ftplugin
<
       Unix,     'runtimepath', 
   ,  Vim   "ftplugin": >

	set runtimepath

<   ,         
     (  ).      
   ,         'runtimepath' 
    |vimrc|.

2.   "~/.vim/ftplugin/c.vim"   : >

	setlocal softtabstop=4
	noremap <buffer> <LocalLeader>c o/**************<CR><CR>/<Esc>

    C.  ,   'softtabstop'
  ,  4. ,    , ţ
   0.   ,   
 ":setlocal",     'softtabstop' 
  .       ,
         ,  
  ,  ,    
 ":set".

,   "\c"     
.  ":map <buffer>"  ,   
    .      :
":map!", ":vmap"  ..  |<LocalLeader>|    
  "maplocalleader".

       : >

	$VIMRUNTIME/ftplugin/

        :
|__|.

==============================================================================
*43.2*	   

   -   ,   
Vim,    ,   Vim    . 
      Vim, . :
|____|.

  "filetype.vim",      
 (    |40.3|.) : >

	augroup filetypedetect
	au BufNewFile,BufRead *.xyz	setf xyz
	augroup END

    ,    ".xyz"  
 "xyz".  ":augroup"     
"filetypedetect".        
,   ":filetype off".  "setf" 
  'filetype'   ,   ݣ 
.   ,  'filetype'  
.

        
,   . . |-|. ,
     "/usr/share/scripts/"    
"ruby",      ,    
 : >
	
	augroup filetypedetect
	au BufNewFile,BufRead *.xyz			setf xyz
	au BufNewFile,BufRead /usr/share/scripts/*	setf ruby
	augroup END

,    ,   /usr/share/scripts/README.txt   
ruby.   ,   "*"   ,
     .    ,
  filetype.vim   ,     
  'runtimepath'. ,  Unix   
"~/.vim/after/filetype.vim".
            ,  
~/.vim/filetype.vim: >

	augroup filetypedetect
	au BufNewFile,BufRead *.txt			setf text
	augroup END

  ruby     ,  
~/.vim/after/filetype.vim: >

	augroup filetypedetect
	au BufNewFile,BufRead /usr/share/scripts/*	setf ruby
	augroup END

   . Vim   "filetype.vim"   
 'runtimepath'.    ~/.vim/filetype.vim.  
  *.txt    Σ.  Vim  
filetype.vim   $VIMRUNTIME. , Vim  
~/.vim/after/filetype.vim      
 ruby  /usr/share/scripts.
      /usr/share/scripts/README.txt 
   .    *.txt
,    "setf text"    
.       ruby  
 "setf ruby". ,       
 ,    .
      /usr/share/scripts/foobar    
.      ruby,  
"setf ruby"    'filetype'  ruby.


   

       ,   
     ! ,   
  ,  :

	#!/bin/xyz ~

      ϣ   Vim 
"scripts.vim" ( ,    filetype.vim).    
 : >

	if did_filetype()
	  finish
	endif
	if getline(1) =~ '^#!.*[/\\]xyz\>'
	  setf xyz
	endif

     did_filetype(),   
  .        
,   "setf" ӣ    .
    scripts.vim     
filetype.vim.  ,   :

	1.  filetype.vim  $VIMRUNTIME  'runtimepath'
	2.   $VIMRUNTIME/filetype.vim
	3.   scripts.vim  'runtimepath'
	4.   $VIMRUNTIME/filetype.vim
	5.  filetype.vim  $VIMRUNTIME  'runtimepath'

   ,   ,  
       ,  
 .

==============================================================================

 : |usr_44.txt|     
 : . |___|  

vim:tw=78:ts=8:ft=help:norl:
