• Home
  • Popular Downloads
  • Contact Us
  • Submit

Softpile

Free Downloads

Main Navigation
  • Home
  • Windows
  • Mac OS X
  • Business
  • Desktop
  • Development
  • Education
  • Games
  • Internet
  • Multimedia
  • Utilities
Home » Linux » tSkeleton

tSkeleton

April 23, 2008
tSkeleton is a Vim plugin that provides file templates and code skeletons (snippets).
Version: 4.3
License: GPL
Operating System: Linux
Homepage: www.vim.org
Developed by: Thomas Link
tSkeleton is a Vim plugin that provides file templates and code skeletons (snippets). These templates may contain special tags that are replaced with some computed value (e.g., variables, user input ...), vimscript code, or place holders/jump positions (when used in conjunction with imap.vim or |TSkeletonMapGoToNextTag()|.

File templates:

In order to add support for a new filetype, save a skeleton file to ~/.vim/skeletons/file.suffix and add something like this to your .vimrc file:

autocmd BufNewFile *.suffix TSkeletonSetup template.suffix
autocmd BufNewFile /here/*.suffix TSkeletonSetup othertemplate.suffix

Alternatively, you can store templates as:

~/vimfiles/skeletons/templates/GROUP/FILETYPE PATTERN


Code skeletons:

Smaller skeleton bits are stored in SKELETONS/bits/FILETYPE/ or SKELETONS/bits/general/. I.e., code skeletons can be filetype specific or generally available.

The filenames of the bits may be grouped in submenus as in:

../tex/&Define.new&command
../tex/&Define.new&environment

This will create skeletons for newcommand and newenvironment but will
group the skeletons under the TSkel.Define. menu with the respective accelerators.


Default key maps:

< Leader >## ... Expand name under cursor
< Leader >#t ... Insert code skeleton via command line
< c-> ... In insert mode, expand the bit before the cursor (on a German keyboard this happens to be < c-# >< c-# >)

General remarks:

A list of special tags:

< +FILE NAME ROOT+ > :: the file name root
< +FILE NAME+ > :: the file name
< +FILE SUFFIX+ > :: the file suffix
< +FILE DIRNAME+ > :: the file's directory
< +NOTE+ > :: a note
< +DATE+ > :: the current date (the format is controlled via
g:tskelDateFormat)
< +AUTHOR+ > :: the author's name (g:tskelUserName)
< +EMAIL+ > :: the author's e-mail (g:tskelUserEmail)
< +WEBSITE+ > :: the author's homepage (g:tskelUserWWW)
< +LICENSE+ > :: the name of the license this file is released under (g:tskelLicense)

tSkeleton also supports the following pseudo-tags:

< +CURSOR+ > :: where to place the cursor after insertion
< +&NAME+ > :: a vim option
< +g:NAME+ > :: a global variable
< +b:NAME+ > :: a buffer local variable
< +?QUERY?+ > :: query the user
< +?VAR|QUERY?+ > :: query the user and propose some choices from the variable ${VAR}
< +bit:BIT >, < +bit:BIT|"DEFAULT" >, < +bit:BIT|COMMANDS > :: insert a bit; if the bit isn't defined for the current filetype, use DEFAULT; if DEFAULT matches ".*"insert it as a string; otherwise interpret it as a command sequence to be fed to normal
< +tskel:TSKELETON > ... :: same as the above
< +include(TSKELETON)+ > :: Another synonym for the above.
< +call:FUNCTION(ARGS)+ > :: Insert the result value of some function
< +execute(EX COMMAND)+ > :: Run a vim command.

Flow control:

< +if(CONDITION)+ >
< +elseif(CONDITION)+ >
< +else+ >
< +endif+ >

Loops:

< +for(VAR in LIST)+ >
< +endfor+ >, < +endfor(VAR)+ >

Variables:

< +let(VAR=VALUE)+ >

Interaction:

< +input(VAR, QUERY, [DEFAULT], [COMPLETION])+ >

Other:

< +nl+ >
< +joinline+ >
< +nop+ >

A wiki like table could then be constructed using a skeleton like this:

< +input('s:my_rows?!', 'Rows: ')+ >
< +input('s:my_cols?!', 'Cols: ')+ >
< +for(i in range(s:my_rows))+ >
|< +for(j in range(s:my_cols))+ > < +CURSOR+ > |< +endfor(j)+ >< +nop+ >
< +endfor(i)+ >

Unknown tags are kept in the expanded skeleton. These tags can be used
as cursor jump marks.

Requirements:

· Vim
· tlib
· Vimball

INSTALLATION:

Edit the vba file and type:

:so %

See :help vimball for details. If you use vim 7.0, you probably need to update vimball first.

IMPORTANT: When updating from an older version, please remove the cache files in ~/vimfiles/cache/tskel_*/** (or select "Reset" from the menu)
and (if existent) the directories ~/vimfiles/skeletons/menu, ~/vimfiles/skeletons/bbits.

The files are stored in ~/vimfiles/skeletons or ~/.vim/skeletons (see
g:tskelDir). The directory structure should look like this:

skeletons/
NAME.SUFFIX (templates for new files)
templates/
GROUP/ (templates for new files)
FILETYPE PATTERN.SUFFIX
map/
FILETYPE (map files for conditional expansion)
bits/
FILETYPE.txt (single line templates)
general/
GENERAL CODE SKELETONS ...
FILETYPE/
FILETYPE SPECIFIC CODE SKELETONS: ONE SKELETON PER FILE ...

What's New in This Release:

· bbcode group
· tskelKeyword_{&ft} and tskelGroup_{&ft} variables can be buffer-local
· Case-sensitivity can be configured via [bg]:tskelCaseSensitive and [bg]:tskelCaseSensitive_{&filetype}
code code skeleton code snippet skeleton snippet vim plugin
Free Download 35K
0
  • Share on:

tSkeleton User Reviews

Sponsored

Categories

  • Linux

Related Downloads

gtk_rotx
gtk_rotx is a small GTK-application to encrypt and decrypt texts using the ...
vile
vile is a text editor which is extremely compatible with vi.
The Lyric Editor
The Lyric Editor aims to be a full featured editor for the on-line ...
tGpg
tGpg is a Vim plugin for encrypting files with gpg.
Helene
Helene is a web-based text editor with syntax highlighting.
Copyright © 1999-2017 Softpile Free Downloads
  • Contact Us
  • Submit
  • Privacy Policy
  • Disclaimer
  • Terms of Use