sponsor Vim development Vim logo Vim Book Ad

skeleton : Skeleton for newly created buffers

 script karma  Rating 6/3, Downloaded by 1723  Comments, bugs, improvements  Vim wiki

created by
Kana Natsuno
script type
*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

  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.

- Vim 7.1 or later

Latest version:

Document in HTML format:
install details

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
vim-skeleton-0.0.2.zip 0.0.2 2009-03-16 7.0 Kana Natsuno - Refine the document.
- |:SkeletonLoad|:
  - Support completion.
  - Allow to override existing content of a buffer with "!".
vim-skeleton-0.0.1.zip 0.0.1 2008-07-12 7.0 Kana Natsuno Fix minor bugs to suppress extra messages which cause hit-enter prompt.
vim-skeleton-0.0.0.zip 0.0.0 2008-07-11 7.0 Kana Natsuno Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.