Index: /issm/trunk/externalpackages/vim/addons/vim/doc/skeleton.txt
===================================================================
--- /issm/trunk/externalpackages/vim/addons/vim/doc/skeleton.txt	(revision 7611)
+++ /issm/trunk/externalpackages/vim/addons/vim/doc/skeleton.txt	(revision 7611)
@@ -0,0 +1,153 @@
+*skeleton.txt*	Skeleton for newly created buffers
+
+Version 0.0.2
+Script ID: 2291
+Copyright (C) 2008 kana <http://whileimautomaton.net/>
+License: MIT license  {{{
+    Permission is hereby granted, free of charge, to any person obtaining
+    a copy of this software and associated documentation files (the
+    "Software"), to deal in the Software without restriction, including
+    without limitation the rights to use, copy, modify, merge, publish,
+    distribute, sublicense, and/or sell copies of the Software, and to
+    permit persons to whom the Software is furnished to do so, subject to
+    the following conditions:
+
+    The above copyright notice and this permission notice shall be included
+    in all copies or substantial portions of the Software.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+    OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+}}}
+
+CONTENTS					*skeleton-contents*
+
+Introduction		|skeleton-introduction|
+Interface		|skeleton-interface|
+  Commands		  |skeleton-commands|
+  Events		  |skeleton-events|
+Bugs			|skeleton-bugs|
+Changelog		|skeleton-changelog|
+
+
+
+
+==============================================================================
+INTRODUCTION					*skeleton-introduction*
+
+*skeleton* is a Vim plugin to set up a skeleton for a newly created buffer.
+Once you put skeleton files into specific directories, appropriate ones will
+be automatically expanded for newly created buffers.
+
+- Skeleton files must be put in a directory named "xtr/skeleton/" which is
+  under any directory listed in 'runtimepath'.
+
+  For example: ~/.vim/xtr/skeleton/
+
+- The name of a skeleton file should be "{filetype}" or "{filetype}-{suffix}",
+  where {filetype} is the 'filetype' for a newly created buffer and {suffix}
+  is an arbitrary string.
+
+  The former "{filetype}" is used as the default skeleton file for that
+  'filetype'.  The latter "{filetype}-{suffix}" is used to override the
+  default one for some cases which are speicifed by user.
+
+  For example: ~/.vim/xtr/skeleton/vim ~/.vim/xtr/skeleton/vim-plugin
+
+- Whenever user starts to edit a file that doesn't exists:
+
+  1) Skeleton publish a |User:plugin-skeleton-detect| event.  This event can
+     be used to |:SkeletonLoad| a special skeleton file other than the default
+     one.
+  
+  2) If |:SkeletonLoad| is not done for the previous step, Skeleton executes
+     the following command:
+>
+	execute 'SkeletonLoad' &l:filetype
+<
+     This means a skeleton file named "{filetype}" in a directory
+     "xtr/skeleton/" which is under any directory listed in 'runtimepath' is
+     loaded as a skeleton file.
+
+     If there is no such skeleton file, nothing will be happened.
+
+
+Requirements:
+- Vim 7.1 or later
+
+Latest version:
+http://github.com/kana/config/commits/vim-skeleton
+
+
+
+
+==============================================================================
+INTERFACE					*skeleton-interface*
+
+------------------------------------------------------------------------------
+COMMANDS					*skeleton-commands*
+
+						*:SkeletonLoad*
+:SkeletonLoad[!] {name}
+	Load the skeleton file with {name} for the current buffer.
+
+	- If the current buffer is not a normal buffer,
+	  nothing will be happened.
+	- If "!" is not given and the current buffer is not empty,
+	  nothing will be happened.
+	- If "!" is given, existing content of the current buffer will be
+	  deleted before loading the specified skeleton.
+
+
+------------------------------------------------------------------------------
+EVENTS						*skeleton-events*
+
+User plugin-skeleton-detect			*User:plugin-skeleton-detect*
+	Event to override the default skeleton file.  User can set up
+	|:autocmd| for this event to |:SkeletonLoad| a special skeleton file
+	other than the default one.
+
+	Example: >
+		autocmd User plugin-skeleton-detect
+		\   if expand('%') =~# '\<plugin/.*\.vim$'
+		\ |   SkeletonLoad vim-plugin
+		\ | endif
+<
+
+
+
+==============================================================================
+BUGS						*skeleton-bugs*
+
+- There are many bugs around the world.
+
+
+
+
+==============================================================================
+CHANGELOG					*skeleton-changelog*
+
+0.0.2	2009-03-17T01:16:29+09:00
+	- Refine the document.
+	- |:SkeletonLoad|:
+	  - Support completion.
+	  - Allow to override existing content of a buffer with "!".
+
+0.0.1	2008-07-13T00:20:09+09:00
+	- Fix to suppress extra message if there is no autocmd for
+	  |User:plugin-skeleton-detect|.
+	- Fix not to do the default |:SkeletonLoad| if 'filetype' of the
+	  current buffer is unknown.
+
+0.0.0	2008-07-11T12:23:55+09:00
+	- Initial version.
+
+
+
+
+==============================================================================
+vim:tw=78:ts=8:ft=help:norl:fen:fdl=0:fdm=marker:
Index: /issm/trunk/externalpackages/vim/addons/vim/plugin/skeleton.vim
===================================================================
--- /issm/trunk/externalpackages/vim/addons/vim/plugin/skeleton.vim	(revision 7611)
+++ /issm/trunk/externalpackages/vim/addons/vim/plugin/skeleton.vim	(revision 7611)
@@ -0,0 +1,97 @@
+" skeleton - Skeleton for newly created files
+" Version: 0.0.2
+" Copyright (C) 2008 kana <http://whileimautomaton.net/>
+" License: MIT license  {{{
+"     Permission is hereby granted, free of charge, to any person obtaining
+"     a copy of this software and associated documentation files (the
+"     "Software"), to deal in the Software without restriction, including
+"     without limitation the rights to use, copy, modify, merge, publish,
+"     distribute, sublicense, and/or sell copies of the Software, and to
+"     permit persons to whom the Software is furnished to do so, subject to
+"     the following conditions:
+"
+"     The above copyright notice and this permission notice shall be included
+"     in all copies or substantial portions of the Software.
+"
+"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+" }}}
+
+if exists('g:loaded_skeleton')
+  finish
+endif
+
+let s:SKELETON_DIR = 'xtr/skeleton/'
+
+
+
+
+command! -bang -bar -complete=customlist,s:cmd_SkeletonLoad_complete -nargs=1
+\ SkeletonLoad
+\ call s:cmd_SkeletonLoad(<q-args>, expand('<abuf>') == '', <bang>0)
+
+function! s:cmd_SkeletonLoad(name, interactive_use_p, banged_p)
+  if &l:buftype != ''
+    if a:interactive_use_p
+      echo 'This buffer is not a normal one.  Skeleton leaves it as is.'
+    endif
+    return
+  endif
+  if (!a:banged_p) && (line('$') != 1 || len(getline(1)) != 0)
+    if a:interactive_use_p
+      echo 'This buffer is not empty.  Skeleton leaves it as is.'
+    endif
+    return
+  endif
+
+  let candidates = split(globpath(&runtimepath, s:SKELETON_DIR.a:name), "\n")
+  if len(candidates) < 1
+    if a:interactive_use_p
+      echo 'Skeleton file is not found:' string(a:name)
+    endif
+    return
+  endif
+
+  " Load skeleton file.
+  if a:banged_p
+    % delete _
+  endif
+  silent keepalt 1 read `=candidates[0]`
+  0 delete _
+
+  return
+endfunction
+
+function! s:cmd_SkeletonLoad_complete(arglead, cmdline, cursorpos)
+  return map(split(globpath(&runtimepath, s:SKELETON_DIR.a:arglead.'*'), "\n"),
+  \          'fnamemodify(v:val, ":t")')
+endfunction
+
+
+
+
+augroup plugin-skeleton
+  autocmd!
+  autocmd BufNewFile *  call s:on_BufNewFile()
+augroup END
+
+function! s:on_BufNewFile()
+  silent doautocmd User plugin-skeleton-detect
+
+  if &l:filetype != ''
+    execute 'SkeletonLoad' &l:filetype
+  endif
+endfunction
+
+
+
+
+let g:loaded_skeleton = 1
+
+" __END__
+" vim: foldmethod=marker
Index: /issm/trunk/externalpackages/vim/addons/vim/skeletons/letter.tex
===================================================================
--- /issm/trunk/externalpackages/vim/addons/vim/skeletons/letter.tex	(revision 7611)
+++ /issm/trunk/externalpackages/vim/addons/vim/skeletons/letter.tex	(revision 7611)
@@ -0,0 +1,15 @@
+\documentclass{letter}
+
+\signature{\'Eric Larour}
+\address{Jet Propulsion Laboratory\\4800 Oak Grove Drive\\CA 91109 Pasadena}
+\begin{document}
+
+\begin{letter}{RECIPIENT\\ADRESS}
+\opening{Dear RECIPIENT,}
+
+BLABLABLA BLABLABLA BLABLABLA BLABLABLA BLABLABLA
+
+\closing{regards,}
+\end{letter}
+
+\end{document}
Index: /issm/trunk/externalpackages/vim/addons/vimrc
===================================================================
--- /issm/trunk/externalpackages/vim/addons/vimrc	(revision 7610)
+++ /issm/trunk/externalpackages/vim/addons/vimrc	(revision 7611)
@@ -1,3 +1,2 @@
-
 " General setup{{{1
 " ----------------------------------------------------------------------
@@ -128,4 +127,7 @@
 	 \ if foldlevel('.') > 0 |
     \   exe ":foldopen" |
+	 \ endif |
+	 \ if foldlevel('.') > 0 |
+	 \   exe ":foldopen" |
 	 \ endif
 
@@ -211,2 +213,5 @@
 au BufRead,BufNewFile *.tex ab (()) \left( \right)
 "}}}
+" Skeletons {{{1
+au BufNewFile letter.tex   0r ~/.vim/skeletons/letter.tex
+"}}}
