*usr_41.txt*	 Vim version 6.2.   : 2003 Aug 14

		  VIM -  

			     Vim


  Vim     vimrc,  
     .     
  .    ,   
Vim   .

|41.1|	
|41.2|	
|41.3|	
|41.4|	
|41.5|	 
|41.6|	 
|41.7|	 
|41.8|	  
|41.9|	 
|41.10|	 
|41.11|	   
|41.12|	   

  : |usr_42.txt|    
 : |usr_40.txt|	  
      : |usr_toc.txt|

==============================================================================
*41.1*			    *vim-script-intro* *_vim-*

   Vim     vimrc. Vim   
      .    , 
,    . ,    
  ,   , ݣ  
Ex    .
    Vim         
,      ̣  . 
       -  . 
          Vim.

Σ   : >

	:let i = 1
	:while i < 5
	:  echo "ޣ " i
	:  let i = i + 1
	:endwhile
<
	:
	    ":"  .    
	      ,    
	    .   ,    
	 ,   ,   ģ   Ex,  
	  .

 ":let"   .    :
>
	:let {} = {}

      "i",   -- 
, 1. 
    ":while"  .    : >

	:while {}
	:  {}
	:endwhile

,    ":endwhile"    ,
   .       
 "i < 5".      ,    i
 5.
    ":echo"      .   
     "ޣ "   
i.  i  ,    :

	ޣ  1 ~

  ݣ   ":let i =".    
 "i + 1".    i  1  
   i.
   ,   :

	ޣ  1 ~
	ޣ  2 ~
	ޣ  3 ~
	ޣ  4 ~

	:
	    ,     
	  CTRL-C (CTRL-Break  MS-Windows).


  

   ,   .
    "0x"  "0X". , "0x1f"  
31.     . "017"  15.  :
   0   ,     
!
    ":echo"    . : >

	:echo 0x7f 036
<	127 30 ~

   ,    .    
   .  ,   
  .    : >

	:echo 0x7f -036
<	97 ~

   .    , 
     . ,  
        
,       : >

	:echo 0x7f - 036

==============================================================================
*41.2*	

      ASCII,    ޣ.
     .    ͣ: >

	counter
	_aap3
	very_long_variable_name_with_underscores
	FuncLength
	LENGTH

 "foo+bar"  "6var" .
      .    
 ,  : >

	:let

     .  ,  
 "count"     ,    
    .       , 
    أ . ,   
 ,      , ԣ
 "s:". , ,      
: >

	:let s:count = 1
	:while s:count < 5
	:  source other.vim
	:  let s:count = s:count + 1
	:endwhile

 "s:count"   ,     ,
  -    "other.vim"  
    .   "other.vim"  
 "s:count",       ,  
   .      .
: |_|.

     , . |_|.
   :

	b:name		     
	w:name		     
	g:name		  (    )
	v:name		, ̣ Vim


 

        ":let".  
,   ":unlet". : >

	:unlet s:count

       "s:count"  
 .    ,    ,  
       ,    
,      !: >

	:unlet! s:count

       
 .     
  . : >

	:if !exists("s:call_count")
	:  let s:call_count = 0
	:endif
	:let s:call_count = s:call_count + 1
	:echo "" s:call_count ""

 "exists()" ,       .
     ,   
.   --  ,    !  
  : >

	:if !exists(s:call_count)

        
s:call_count.    ,   .
     !    .  
 ,    .   ,  
 .        "". 
,   "if !exists()"    "  exists()".
   Vim   ӣ,    0. 0  .


   

          .
,     . Vim    
:   .   ,   
  ,     ":let".
       ,   
 .     . -, 
   : >

	:let name = ""
	:echo name
<	 ~

       ,  ţ 
      : >
	
	:let name = "\"\""
	:echo name
<	"" ~

      ,  
    : >

	:let name = '""'
	:echo name
<	"" ~

         . 
,        .
           
        
  .
           
.    :

	\t		<Tab>
	\n		<NL>,  
	\r		<CR>, <Enter>
	\e		<Esc>
	\b		<BS>,     
	\"		"
	\\		\,   
	\<Esc>		<Esc>
	\<C-W>		CTRL-W

   ,     "\<>" 
     "".
         .  |-|.

==============================================================================
*41.3*	

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

	$		 
	&		
	@r		

  : >

	:echo "  'tabstop':" &ts
	:echo "  :" $HOME
	:if @a > 5

 &        ,
        
 . : >

	:let save_ic = &ic
	:set noic
	://,$delete
	:let &ic = save_ic

  ,     ""  
 ,    'ignorecase'.    
,        
.




   ,     
!       :

	a + b		
	a - b		
	a * b		
	a / b		
	a % b		

   . : >

	:echo 10 + 5 * 2
<	20 ~

     .   . :
>
	:echo (10 + 5) * 2
<	30 ~

     ".". : >

	:echo "" . ""
<	 ~

  ":echo"    ,  
   .     ģ   
, ,    .

  C   :

	a ? b : c

 "a"  ,     "b",   
  "c" : >

	:let i = 4
	:echo i > 5 ? "i " : "i "
<	i  ~

         
, ..:

	(a) ? (b) : (c)

==============================================================================
*41.4*	

 ":if"   ,   
  ":endif",    ,  
.  :

	:if {}
	   {}
	:endif

{}      ,   {}
  (-). , ,   
.     ,  Vim  ģ 
":endif".
       ":else".   :

	:if {}
	   {}
	:else
	   {}
	:endif

{}  :else      ,  
   :if.
    ,   ݣ  ":elseif":

	:if {}
	   {}
	:elseif {}
	   {}
	:endif

    ,      ":else"  
":if",         ":endif".
       vimrc --    'term' 
      : >

	:if &term == "xterm"
	:  "    xterm
	:elseif &term == "vt100"
	:  "     vt100 
	:else
	:  "     
	:endif


 

     .    
:

	a == b		
	a != b		 
	a >  b		 
	a >= b		  
	a <  b		 
	a <= b		  

  ,    1,    0.
: >

	:if v:version >= 600
	:  echo " "
	:else
	:  echo "    ,  !"
	:endif

    ̣ Vim ,  
  Vim.   6.0   v:version  600, 
 6.1 -- 601.     ,   
  Vim. |v:version|

      ,    . 
     .  
  ,        . 
       ,      .
  ,     , ţ   0.
: >

	:if 0 == ""
	:  echo ""
	:endif

   "",  ""      
   0.

     :

	a =~ b		 
	a !~ b		  

 , "a",   .  , "b",  
,   ,     . : >

	:if str =~ " "
	:  echo " str  "
	:elseif str !~ '\.$'
	:  echo "str  "
	:endif

         .
   ,        
     ,     
   .

     'ignorecase'.    
,  "#"  ޣ    "?"  
.  , "==?"     ޣ , 
"!~#"      ,  
  .     . 
|-==|.


  

 ":while"  .  ":while"  ":endwhile"  
 ݣ  :

	:continue		     while;
				 
	:break			  ":endwhile"   

: >

	:while counter < 40
	:  call do_something()
	:  if skip_flag
	:    continue
	:  endif
	:  if finished_flag
	:    break
	:  endif
	:  sleep 50m
	:endwhile

 ":sleep"  Vim .  "50m"   50
,  ":sleep 4"    4 .

==============================================================================
*41.5*	 

       Vim .  ":execute"
        : 
   .
   ,      , ޣ  : >

	:execute "tag " . tag_name
	
  "."    "tag "   
"tag_name".  "tag_name"   "get_cmd",   
: >

	:tag get_cmd

 ":execute"      ,
  .  ":normal"    .
,      ,   ,
   . : >

	:normal gg=G

            
   "=".
    ":normal"     ,  ţ
   ":execute"":execute". : >

	:execute "normal " . normal_commands

  "normal_commands"     .
   ,   ":normal" --   . 
Vim ģ      .  ,  
   ,       .
: >

	:execute "normal I  \<Esc>"

     "  "   . 
    "\<Esc>"    
.        <Esc>
    .

==============================================================================
*41.6*	 

Vim         
.       .  
  : ||.

     ":call".   
 , ̣ . : >

	:call search(": ", "W")

    search(),   ": "  "W". 
  search()      ,  
   .  "W" ,     
    .

    . : >

	:let line = getline(".")
	:let repl = substitute(line, '\a', "*", "g")
	:call setline(".", repl)

  getline()     .  
    .     ".", ..
 .
    substitute()      ":substitute". 
  ,    .  
   ,  --   ,   --
. 
    setline()  ,    
,  ,   .     
      substitute(). 
,      ,   : >

	:substitute/\a/*/g

    ,     
substitute()   .


  				      *function-list* *_*

  .    ,   
.     : ||. 
CTRL-]       .

  :
	char2nr()		  ASCII 
	nr2char()		    ASCII 
	escape()		      '\'
	strtrans()		    
	tolower()		     
	toupper()		     
	match()			     
	matchend()		     
	matchstr()		   
	stridx()		     
	strridx()		    
	                           
	strlen()		 
	substitute()		    
	submatch()		   ":substitute"
	strpart()		  
	expand()		     
	type()			 

     :
	byte2line()		     
	line2byte()		   ̣ 
	col()			     
	virtcol()		      
	line()			     
	wincol()		    
	winline()		    
	getline()		   
	setline()		   
	append()		 {}    {}
	indent()		  ̣ 
	cindent()		     C
	lispindent()		     Lisp
	nextnonblank()		   
	prevnonblank()		   
	search()		  
	searchpair()		   

     :
	browse()		    
	glob()			    ͣ 
	globpath()		    
	resolve()		 ,    
	fnamemodify()		  
	executable()		   
	filereadable()		    
	isdirectory()		  
	getcwd()		    
	getfsize()		  
	getftime()		    
	localtime()		  
	strftime()		   
	tempname()		   
	delete()		 
	rename()		 
	system()		    
	hostname()		 

,    -:
	argc()			   
	argidx()		    
	argv()			   
	bufexists()		  
	buflisted()		    
				     
	bufloaded()		    
				    
	bufname()		  
	bufnr()			  
	winnr()			   
	bufwinnr()		      
				   
	winbufnr()		    ̣ 
	getbufvar()		    ̣
				   
	setbufvar()		   ̣ 
	getwinvar()		    ̣
				   
	setwinvar()		   ̣ 

:
	foldclosed()		    
				   ̣ 
	foldlevel()		    ̣ 
	foldtext()		,    

 :
	hlexists()		   
	hlID()			 ID  
	synID()			 ID   ̣ 
	synIDattr()		 ̣   ID 
	synIDtrans()		  ID 

:
	histadd()		   
	histdel()		   
	histget()		   
	histnr()		     

:
	confirm()		  
	getchar()		   
	getcharmod()		   ģ
				    
	input()			   
	inputsecret()		    
				      
	inputdialog()		     

 Vim:
	serverlist()		  ͣ 
	remote_send()		    Vim
	remote_expr()		    Vim 
	server2client()		   Vim 
	remote_peek()		    Vim 
	remote_read()		   Vim
	foreground()		  Vim   
	remote_foreground()	   Vim   

:
	mode()			   
	visualmode()		   
	hasmapto()		    
	mapcheck()		    
	maparg()		  
	exists()		  ,  
				    ..
	has()			    Vim
	cscope_connection()	    cscope
	did_filetype()		   FileType
	eventhandler()		   
	getwinposx()		 X  Vim   
	getwinposy()		 Y  Vim   
	winheight()		  ̣ 
	winwidth()		  ̣ 
	libcall()		    
	libcallnr()		  ,   

==============================================================================
*41.7*	 

Vim     .    
  : >

	:function {}({1}, {2}, ...)
	:  {_}
	:endfunction
<
	:
	 , ̣ ,   
	 .

    ,    
 .    : >

	:function Min(num1, num2)

  Vim,       "Min",  
 : "num1"  "num2".
     ,    : >
   
	:  if a:num1 < a:num2

 "a:" ,     .  
 "smaller"   : >

	:  if a:num1 < a:num2
	:    let smaller = a:num1
	:  else
	:    let smaller = a:num2
	:  endif

 "smaller"  .  ,  
 ,  ,     ,
  "g:", "a:"  "s:".

	:
	           ţ
	  "g:".  , "g:count"  
	    "count",  "count"  
	,      .

     ":return"   
   .      : >

	:  return smaller
	:endfunction

    : >

	:function Min(num1, num2)
	:  if a:num1 < a:num2
	:    let smaller = a:num1
	:  else
	:    let smaller = a:num2
	:  endif
	:  return smaller
	:endfunction

 , ̣ ,     
 .   .  Min   
: >

	:echo Min(5, 8)

     Vim    ţ .
     ,   ̣
  ,      .  
     .

     ":endfunction"  
 ":return"  ,   0.

      !  
":function": >

	:function!  Min(num1, num2, num3)


 

 ":call"     .   
 . -,      "range",  
   .
           "a:firstline"
 "a:lastline".        , 
   . : >

	:function Count_words() range
	:  let n = a:firstline
	:  let count = 0
	:  while n <= a:lastline
	:    let count = count + Wordcount(getline(n))
	:    let n = n + 1
	:  endwhile
	:  echo " " . count . " "
	:endfunction

   , , : >

	:10,30call Count_words()

          .
   -,      "range".   
        ,  
    . : >

	:function  Number()
	:  echo " " . line(".") . " : " . getline(".")
	:endfunction

    : >

	:10,15call Number()

    6 .


  

Vim       .
,    ,    
 (start)      20  : >

	:function Show(start, ...)

 "a:1"    , "a:2" ,  
.   "a:0"    .
   : >

	:function Show(start, ...)
	:  echohl Title
	:  echo "Show is " . a:start
	:  echohl None
	:  let index = 1
	:  while index <= a:0
	:    execute 'echon "  Arg " . index . " is " . a:' . index
	:    let index = index + 1
	:  endwhile
	:  echo ""
	:endfunction

     ":echohl"    
  ":echo". ":echohl None"   
.  ":echon"      ":echo",   
.


 

 ":function"   ͣ    ̣
 : >

	:function
<	 Show(start, ...) ~
	 GetVimIndent() ~
	 SetSyn(name) ~

 ,   ,  ţ    
  ":function": >

	:function SetSyn
<	    SetSyn(name) ~
	1	   if &syntax == '' ~
	2	     let &syntax = a:name ~
	3	   endif ~
	   endfunction ~




          
 . .      |_|.
         'verbose'  12  , 
   .  15     
 .


 

   Show(): >

	:delfunction Show

     ,    
.

==============================================================================
*41.8*	  

  ģ : >

	:try
	:   read ~/templates/pascal.tmpl
	:catch /E484:/
	:   echo " , -  Pascal  ."
	:endtry

 ":read"    ,    . 
,     , ģ  
      .

   ":try"  ":endtry"    
.    .     
   .       . 
 ,   ,     "E484:". 
      ,      --
,       .

   ":read" ģ  -  ,  
"E484:"    .  ,  
   ,       .

      : >

	:try
	:   read ~/templates/pascal.tmpl
	:catch
	:   echo " , -  Pascal  ."
	:endtry

      . ,     
     ,  "E21: 
,     'modifiable'".

      ":finally": >

	:let tmp = tempname()
	:try
	:   exe ".,$write " . tmp
	:   exe "!filter " . tmp
	:   .,$delete
	:   exe "$read " . tmp
	:finally
	:   call delete(tmp)
	:endtry

          
    "filter",      
.      ":try"  ":finally",  
        
   CTRL-C,  "call delete(tmp)" 
.   ,     ̣.

        
: |_-|.

==============================================================================
*41.9*	 

         Vim.
       ,    
   .

      .  Unix   <NL>,
 MS-DOS, Windows, OS/2  ..    <CR><LF>.  
  ,    <CR>. . |:source_crnl|.




      .

    (  )  . 
  (,  'set'  'cpoptions'   )
       .   
  ,    ,    
;  . . 

  ":set",   "=" (), : >

	:set cpoptions    =aABceFst

   "=" . ,   "="  
 !

         
   "\",     : >

	:set tags=\ \ 

  ,    >

	:set tags=  

ģ   ,    : >

	:set tags=
	:set 
	:set 




 " ( )   . ӣ,  
     ,    , , 
 ,    ,    
 .       .

    . : >

	:abbrev dev development		" 
	:map <F3> o#include		"  include
	:execute cmd			" 
	:!ls *.c			"   C 

 'dev'    'development     " '.
  <F3>       'o# ....',
 '"  include'.   "execute"  .   "!"
   ӣ,    ţ,  ģ  
,  "  .
       ":map", ":abbreviate", ":execute" 
"!",     .   ":map", ":abbreviate"  ":execute"
   : >

	:abbrev dev development|" 
	:map <F3> o#include|"  include
	:execute cmd			|" 

   '|'     ,   
  .

 ,   '|'       
.      ,   
 '|'   .  ,     
   : >

	:map <F4> o#include  

   ,   'list'   
 vimrc.


 

     ݣ  أ : >

	:map ,ab o#include
	:unmap ,ab 

 unmap      ,   
   ",ab ",   .    
,     ":unmap ,ab "  .

     'unmap'    : >

	:unmap ,ab     " 

    ,  Vim   
  ',ab     ',   .   
  : >

	:unmap ,ab|    " 


 

          .
         ,
..          
.
   , ģ ,   ,  ţ  
  ,     : >

	map ,p ma"aYHmbgg"aP`bzt`a

    : >
	
	ma"aYHmbgg"aP`bzt`a
<	ma			  a   
	  "aY			     a
	     Hmb		      
				    b   
		gg		    
		  "aP		    
				   
		     `b		      
		       zt	       
			 `a	   Σ 
				   


 

         , 
 :
-       .   
  . , "OW_"   ,   
  .
-      .  
  ,   ,    .  
   ,      .
: >

	"  XXX

	if exists("XXX_loaded")
	  delfun XXX_one
	  delfun XXX_two
	endif

	function XXX_one(a)
		...   ...
	endfun

	function XXX_two(b)
		...   ...
	endfun

	let XXX_loaded = 1

==============================================================================
*41.10*	 	         *write-plugin* *__*

    Vim  ,     
.    .  Vim 
      plugin    . 
. |_|.

,    :

	  :	    
      :	   ̣  

       .  
         .
       , .
|___|.




       .    
   ,  ,   ,  -
   - ,     .
      Windows,  8 
    .

      ,  
 .  ף  "typecorr.vim".

     ,   
.    ӣ   ,    
ģ   .


 

Σ   , . ,     
 : >

 14	iabbrev teh the
 15	iabbrev otehr other
 16	iabbrev wnat want
 17	iabbrev synchronisation
 18		\ synchronization
 19	let s:count = 4

,      .

        . 
    !




            
 .       , 
          .
,    : >

  1	"   Vim   
  2	"  :	2000 Oct 15
  3	" :		Bram Moolenaar <Bram@vim.org>

    :      , 
      ,   , 
    ,     Vim
|license|.         .
: >

  4	" :		    .
<   
    
 ,                   *use-cpo-save*

  18     |_|.
,     Vi  ( ޣ 
'compatible')      .    
 'compatible',       
 .   ,    'cpoptions'  ţ
      ţ  .  
        . 
  : >

 11	let s:save_cpo = &cpo
 12	set cpo&vim
 ..
 41	let &cpo = s:save_cpo

       'cpoptions'  
s:save_cpo.        .

        
 |s:var|.       
 .  ,     , 
  .


  

,       . 
         , 
 -       . 
        . 
   : >

  6	if exists("loaded_typecorr")
  7	  finish
  8	endif
  9	let loaded_typecorr = 1

         
     .




     :  , 
     ,   .   
        , 
         .
       , 
 <Leader>: >

 22	  map <unique> <Leader>a  <Plug>TypecorrAdd

 "<Plug>TypecorrAdd"    ,  
  .

     "mapleader" 
 ,      .
,   ģ: >

	let mapleader = "_"

     "_a".     
  ,   , ..   
 "\a".

 ,   <unique>,    
      .
|:map-<unique>|

       
?       : >

 21	if !hasmapto('<Plug>TypecorrAdd')
 22	  map <unique> <Leader>a  <Plug>TypecorrAdd
 23	endif

 ,  ,     
"<Plug>TypecorrAdd"     "<Leader>a"    ,
   .         
vimrc: >

	map ,c  <Plug>TypecorrAdd

      "_a"  "\a"  ",c".




   ,        
.        . ,
           .
,     Add(),    
    .   ,   
         "s:".

,  ,    :  >

 30	function s:Add(from, correct)
 31	  let to = input("type the correction for " . a:from . ": ")
 32	  exe ":iabbrev " . a:from . " " . to
 ..
 36	endfunction

        s:Add().  
    s:Add(),      
,   .  ,    
 Add() (  "s:"),     .

    <SID>. <SID>  ,  
      .     
 <SID> : >

 24	noremap <unique> <script> <Plug>TypecorrAdd  <SID>Add
 ..
 28	noremap <SID>Add  :call <SID>Add(expand("<cword>"), 1)<CR>

,    "\a",    : >

	\a  ->  <Plug>TypecorrAdd  ->  <SID>Add  ->  :call <SID>Add()

 ,        <SID>Add,  
   ,    .

 ,    <SID>Add()  s:Add(). 
  ,    ,   . <SID>
   ,  Vim    
   Add().

 ӣ     ,   , 
     .     ,
  <SID>Add()  ,  s:Add()    (
 ,  ,  ).

          : >

 26	noremenu <script> .\       <SID>Add

        
"".       .  
    . , ".CVS"
   ,    CVS
".CVS.", ".CVS."  ..

 ,    28  ":noremap"  
   . , -   
  ":call".   24    :noremap",   
      "<SID>Add".    
    "<script>".    
,       .
|:map-<script>|       26 
":noremenu". |:menu-<script>|


<SID>  <Plug>				 *using-<Plug>* *-<Plug>*

 <SID>,   <Plug>   ,   
    ,     
.      <SID>  <Plug>:

<Plug>	   .     , 
	     
	. <Plug>   ,  
	   . 
	   ,     
	  ,   : 
	<Plug> _ _.      
	"Typecorr",    "Add".   
	"<Plug>TypecorrAdd".  ,    , 
	      . 

<SID>	   ,  ID.  Vim <SID>
	     "<SNR>123_",  "123"  
	 .  ,  "<SID>Add()"    
	  "<SNR>11_Add()"   "<SNR>22_Add()"   .
	   ,      ̣
	   ":function".  <SID>  
	   ,      
	     .


  

     : >

 38	if !exists(":Correct")
 39	  command -nargs=1  Correct  :call s:Add(<q-args>, 0)
 40	endif

        ,  ݣ 
    .       
 .      ":command!"  
 ,    ,    
 ,   .  |:command|


  

     "s:",    . 
     .    
   .      
      .   
    Vim.      
      .  |s:|

       ,  
 , ̣  .     
 ,     : >

 19	let s:count = 4
 ..
 30	function s:Add(from, correct)
 ..
 34	  let s:count = s:count + 1
 35	  echo s:count . "   "
 36	endfunction

    s:count  4. ,   
s:Add()    s:count  .   , 
  s:Add() --      
 ,      .




    : >

  1	"   Vim   
  2	"  :	2000 Oct 15
  3	" :		Bram Moolenaar <Bram@vim.org>
  4	" :		    .
  5
  6	if exists("loaded_typecorr")
  7	  finish
  8	endif
  9	let loaded_typecorr = 1
 10
 11	let s:save_cpo = &cpo
 12	set cpo&vim
 13
 14	iabbrev teh the
 15	iabbrev otehr other
 16	iabbrev wnat want
 17	iabbrev synchronisation
 18		\ synchronization
 19	let s:count = 4
 20
 21	if !hasmapto('<Plug>TypecorrAdd')
 22	  map <unique> <Leader>a  <Plug>TypecorrAdd
 23	endif
 24	noremap <unique> <script> <Plug>TypecorrAdd  <SID>Add
 25
 26	noremenu <script> .\       <SID>Add
 27
 28	noremap <SID>Add  :call <SID>Add(expand("<cword>"), 1)<CR>
 29
 30	function s:Add(from, correct)
 31	  let to = input("type the correction for " . a:from . ": ")
 32	  exe ":iabbrev " . a:from . " " . to
 33	  if a:correct | exe "normal viws\<C-R>\" \b\e" | endif
 34	  let s:count = s:count + 1
 35	  echo s:count . " corrections now"
 36	endfunction
 37
 38	if !exists(":Correct")
 39	  command -nargs=1  Correct  :call s:Add(<q-args>, 0)
 40	endif
 41
 42	let &cpo = s:save_cpo

  33   .      ,
  .     
 |:normal|.  ,    ,   
, ̣   ":noremap",    
    .

     "unix"    
'fileformat'.       . ,
Σ    'fileformat'  "dos",    
Unix. .  |:source_crnl|.   ,  ӣ , 
  : >

	:set fileformat=unix
<


					 *write-local-help* *_*
        ,   
,      .  
,    ,   |__|.

     ,  "typecorr.txt": >

  1	*typecorr.txt*	   
  2
  3	      ,   
  4        .
  5
  6	     .  
  7        .
  8
  9	:
 10	<Leader>a      <Plug>TypecorrAdd
 11		   ,   .
 12
 13	:
 14	:Correct {}
 15		   {}.
 16
 17							*typecorr-*
 18	    .

  -- ,     ̣ .
      " :"  help.txt (.
|local-additions|).  "*"      
.

         **. ,
 ,     ̣  . 
     ,    :
"typecorr-".

   |_|    
   .     
  .

  	          *plugin-filetype* *-_*

    ,   ݣ   Vim,   
       .  
 ,       
  .
: >

	au BufNewFile,BufRead *.foo                     set filetype=foofoo

 ,          ,
   'runtimepath'.  Unix      
"~/.vim/ftdetect/foofoo.vim".   ,    
     .

          
  ,      
 ,    . .  |__|.


		                *plugin-special* *-_*

  ,    :

s:name			,     

<SID>			 ,    
			,     .

hasmapto()		,     
			,   .

<Leader>		  "mapleader"   
			   .

:map <unique>		 ,    .

:noremap <script>	      
			 ,   

exists(":Cmd")		   .

==============================================================================
					        *___*
*41.11*	   	    *write-filetype-plugin* *ftplugin*

       ,   ,  
        .
     .  |___|.

     , |41.10|. ӣ,   
 ,       .  
     .  ,  
,  ,         
.


 

         , 
      . , 
     : >

	"     ,      
	" 
	if exists("b:did_ftplugin")
	  finish
	endif
	let b:did_ftplugin = 1

            
 ,       ":edit" 
.

      ,   
   - : >

	let b:did_ftplugin = 1

, , ,         
 $VIMRUNTIME  'runtimepath'!

         , 
   ,       
 : >

	setlocal textwidth=70

     "after",     
  ,       
"vim.vim" |after-|.  Unix   "~/.vim/after/ftplugin/vim.vim".
 ,     
"b:did_ftplugin",        ģ.




    ,       
,       >

	:setlocal

         
(    ).   |:setlocal| 
   ,       ,
     ,      
 .

  ,     
  ,     "+="  "-=" 
   .   ,   
      .    
   ,   ,   
  . : >
	
	:setlocal formatoptions& formatoptions+=ro




    ,       
,   
>
	:map <buffer>

    Σ    .
      : >

	if !hasmapto('<Plug>JavaImport')
	  map <buffer> <unique> <LocalLeader>i <Plug>JavaImport
	endif
	noremap <buffer> <unique> <Plug>JavaImport oimport ""<Left><Esc>

|hasmapto()|       
<Plug>JavaImport.    ,    
.      |<LocalLeader>|,  
  ,       
  .       
.
 <unique>         , 
  ,      .
|:noremap|       ,
̣ .    ":noremap <script>" 
,    ,   <SID>  
.

      , ̣
  ,     . ģ
 ,         : >

	"  ,    .
	if !exists("no_plugin_maps") && !exists("no_mail_maps")
	  "     "> "
	  if !hasmapto('<Plug>MailQuote')
	    vmap <buffer> <LocalLeader>q <Plug>MailQuote
	    nmap <buffer> <LocalLeader>q <Plug>MailQuote
	  endif
	  vnoremap <buffer> <Plug>MailQuote :s/^/> /<CR>
	  nnoremap <buffer> <Plug>MailQuote :.,$s/^/> /<CR>
	endif

   :
no_plugin_maps		      
no_mail_maps		   ̣   


 

     ̣  ,  
      ,   "-buffer"
  |:command|. : >

	:command -buffer  Make  make %:r.s




          .
  |s:|     
.     -    
 ,     |b:|.




      .   
   ,       , 
   : >

	:if !exists("*s:Func")
	:  function s:Func(arg)
	:    ...
	:  endfunction
	:endif
<



     ":setfiletype xyz",  
     Σ.    
  b:undo_ftplugin   ,   
,      . : >

	let b:undo_ftplugin = "setlocal fo< com< tw< commentstring<"
		\ . "| unlet b:match_ignorecase b:match_words b:match_skip"

  ":setlocal"   "<"    
  ţ  .      
  .

  ,    'cpoptions'    "C", 
  ,      |use-cpo-save|.


 

    ֣    , 
. |__-|.      ң :

	.../ftplugin/stuff.vim
	.../ftplugin/stuff_foo.vim
	.../ftplugin/stuff/bar.vim

 "stuff"    ,  "foo"  "bar"   .



             *ftplugin-special* *__-_*

  ,      :

<LocalLeader>		  "maplocalleader",  
			   ,  
			     .

:map <buffer>		     .

:noremap <script>	   ,  
			   <SID>.

:setlocal		     .

:command -buffer	     
			.

exists("*s:Func")	   .

.  |-_|     ,
    .

==============================================================================
		                           *___*
*41.12*	   	       *write-compiler-plugin*

        ̣
.       
|:compiler|.        
'errorformat'  'makeprg'.

     .  ,  
     : >

        :next $VIMRUNTIME/compiler/*.vim

       |:next|.

       , 
       , 
  . ,    ,
  >

	:if exists("current_compiler")
	:  finish
	:endif
	:let current_compiler = "mine"

           
    ( Unix , , ~/.vim/compiler), 
        "current_compiler", 
  ,      .

        ,
         
 Vim.     "current_compiler" 
 ,      . 

         ,
   ,       Σ  
 "current_compiler".      
,      ,   'runtimepath' 
 .  Unix    ~/.vim/after/compiler.

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

 : |usr_42.txt|    
 : . |___|  

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