Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated help file templates

  • Loading branch information...
commit ae2891a1e25ae7435ae2130c71d0b2a907051da8 1 parent f63b979
@tomtom authored
View
31 tml/tpl_checksyntax.txt
@@ -11,37 +11,36 @@ the list of syntax errors.
If vimscript #2584 is installed, lines containing syntax errors will be marked
with signs.
-As the plugin doesn't provide syntax checks by its own, the external
-syntax checker has to be installed on your computer.
-
By default, |:CheckSyntax| is mapped to <F5> (if not mapped already),
and automatically executed when saving the buffer. The |:CheckSyntax|
command takes one optional argument: the mode (default: &filetype).
+<C-F5> will run all syntax checkers for a given filetype if multiple
+alternatives are defined and installed on your computer.
+
+As the plugin doesn't provide syntax checks by its own. This is done by
+an external syntax checker that has to be installed on your computer.
-The following modes are pre-defined (syntax checking requires the
-respective syntax checker software to be installed):
+For the following filetypes, syntax checkers are pre-defined:
c, cpp :: Check syntax via splint
html :: Check syntax via tidy
- javascript :: Check syntax via jsl or gjslint
+ javascript :: Check syntax via jslint, jshint, jsl, or gjslint
java :: Check syntax via jlint or javaCheckstyle
lua :: Parse file (luac -p)
php :: Check syntax (php -l)
- phpp :: Parse a file (php -f) (alternative php checker)
- python :: Check file with pyflakes
- pylint :: Use the pylint compiler plugin (alternative python checker)
- ruby :: Check syntax (ruby -c; no auto-checks)
- tex, latex :: Parse file (chktex -q -v0; no auto-checks)
+ python :: Check file with pyflakes or pylint
+ r :: Check syntax & style with lint::lint or svTools::lint
+ ruby :: Check syntax (ruby -c)
+ tex, latex :: Parse file (chktex -q -v0)
xml, docbk :: Check syntax via xmllint
-See |g:checksyntax| for a complete list. See |g:checksyntax| also for
-how to define your own syntax checkers.
+See the autoload/checksyntax/defs/ directory for a complete list of
+supported syntax checkers. See |g:checksyntax| also for how to define
+your own syntax checkers.
This plugin was originally based on Klaus Horsten's php_console
(vimscript #779) and it is the successor of php_check_syntax.vim
-(vimscript #1272). In opposition to php_console, it is not a php
-ftplugin but a general solution for checking the syntax when saving a
-file (using the appropriate interpreter, lint or whatsoever).
+(vimscript #1272).
-----------------------------------------------------------------------
View
31 tml/tpl_pluginstats.txt
@@ -0,0 +1,31 @@
+*pluginstats.txt* Provide statistics how often a source file was loaded
+ Author: Tom Link, micathom at gmail com
+
+Downloading & installing plugins is easy. Not all of them turn out to be
+of actual use and you forget about them. This plugins helps you identify
+plugins you have installed but do not actually use that often to justify
+cluttering your 'runtimepath' and thus slowing down startup time. Simply
+make sure this plugin is loaded on startup. After a few days, use the
+|:Pluginstats| command to check which script files were loaded how
+often. The number of times autoload files were loaded will give you a
+hint, which plugins you actually used.
+
+Features:
+ - The |:Pluginstats| command displays script use in CSV format.
+ - If |g:pluginstats_autoexport| is greater than zero, the statistics
+ are exported automatically every N days.
+
+
+-----------------------------------------------------------------------
+Install~
+
+In order to install the vba, open the vba file in VIM and type: >
+
+ :so %%
+
+See :help vimball for details.
+
+Also available via git: http://github.com/tomtom/pluginstats_vim/
+
+
+%s
View
7 tml/tpl_quickfixsigns.txt
@@ -47,4 +47,11 @@ please make sure, you have the current version of vimball
(vimscript #1502) installed or update your runtime.
+Optional enhancements~
+
+If tinykeymap (vimscript #4199) is installed, a map (see
+|g:tinykeymap#map#quickfixsigns#map|, which defaults to <Leader>ms) can be used
+to jump from sign to sign or between sign groups.
+
+
%s
View
35 tml/tpl_rcom.txt
@@ -3,10 +3,17 @@
The rcom ftplugin uses one of the following methods to evaluate R code:
- - screen (default, also works under Windows with cygwin/mintty & Windows Rterm)
- - screen or tmux via the screen vim plugin
- - RServe (requires +ruby and the rserve-client rubygem)
- - RCom interface (http://rcom.univie.ac.at; Windows only)
+ screen ........ default method; works under Linux & Windows (with
+ cygwin/mintty & Windows Rterm)
+ screen/tmux ... via the screen vim plugin; works under Linux &
+ Windows
+ RServe ........ requires +ruby and the rserve-client rubygem; works
+ under Linux & (less reliably) under Windows
+ RCOM .......... requires http://rcom.univie.ac.at; works under
+ Windows
+
+With the exception of RCOM, most methods should work also under Mac OS
+but that was not tested.
After installation, interaction with R is enabled for all
buffers with filetype r. For other filetypes, you can use the
@@ -15,9 +22,11 @@ functions |rcom#EvaluateInBuffer()|.
Features:
- Evaluate R code
+ - Operator map
- Maps for normal, visual, and insert mode
- Keyword map (|K|)
- - Operator
+ - Inspect & edit/fix object (<LocalLeader>K)
+ - Debug function
The following features are supported only with some methods:
@@ -49,6 +58,21 @@ The ftplugin provides several maps (see also |g:rcom_map|,
normal, insert, and visual mode. There is also an operator (see
|g:rcom_mapop|).
+Default Maps:
+ <c-cr> ... Evaluate the current line
+ <c-s-cr> ... Evaluate the current line & print result
+ +. ... Evaluate the current line (normal mode)
+ +{motion} ... Operator
+ [visual]+ ... Evaluate the visual area
+ +p ... Toggle printing for the above maps
+ +d ... Toggle a function's debug status
+ +s ... Source the current buffer in R
+ +t ... Show the transcript buffer
+ +l ... Open the log window
+ ++ ... Evaluate the |maparg| previously mapped to #
+ K ... Info on the word under cursor
+ <LocalLeader>K ... Inspect/edit/fix the object under cursor
+
Normal usage~
@@ -65,7 +89,6 @@ Normal usage~
type ++ to invoke |+|.)
-
-----------------------------------------------------------------------
Install~
View
40 tml/tpl_tcomment.txt
@@ -15,6 +15,11 @@ override the default choice.
TComment can properly handle an embedded syntax, e.g., ruby/python/perl
regions in vim scripts, HTML or JavaScript in php code etc.
+tcomment favours the use of line-wise comment styles. This implies that usually
+whole line will be commented out. tcomment also knows block-style and inline
+comments that can be used via special maps (see below) or the |:TCommentAs|
+command.
+
Demo:
http://vimsomnia.blogspot.com/2010/11/tcomment-vim-plugin.html
@@ -32,15 +37,28 @@ and |g:tcommentMapLeaderOp2|):
gc{motion} :: Toggle comments (for small comments within one line
the &filetype_inline style will be used, if
defined)
+ gc<Count>c{motion} :: Toggle comment text with count argument
+ (see |tcomment#Comment()|)
gcc :: Toggle comment for the current line
gC{motion} :: Comment region
gCc :: Comment the current line
+In visual mode:
+
+ gc :: Toggle comments
+ gC :: Comment selected text
+
+CAVEAT: If you visually select text within a line, the visual mode map will
+comment out the selected text. If you selected text across several lines, the
+visual mode map will assume though that you wanted to comment out lines --
+since this is how many vim maps work. In order to make tcomment use e.g. inline
+comments anyway, use the <c-_>i map -- see below.
+
By default the cursor stays put. If you want the cursor to the end of
the commented text, set |g:tcommentOpModeExtra| to '>' (but this may not
work properly with exclusive motions).
-Primary key maps:
+Primary key maps for normal and insert mode:
<c-_><c-_> :: :TComment
<c-_><space> :: :TComment <QUERY COMMENT-BEGIN ?COMMENT-END>
@@ -48,11 +66,22 @@ Primary key maps:
<c-_>a :: :TCommentAs <QUERY COMMENT TYPE>
<c-_>n :: :TCommentAs &filetype <QUERY COUNT>
<c-_>s :: :TCommentAs &filetype_<QUERY COMMENT SUBTYPE>
- <c-_>i :: :TCommentInline
+ <c-_>i :: :TCommentInline (in normal and insert mode, this map will
+ create an empty inline comment, which isn't suitable for
+ all filetypes though)
<c-_>r :: :TCommentRight
<c-_>p :: Comment the current inner paragraph
+ <c-_><Count> :: :TComment with count argument (a number from 1 to 9)
+ (see |tcomment#Comment()|)
-A secondary set of key maps is defined for normal mode.
+Primary key maps for visual mode:
+
+ <c-_><c-_> :: :TComment
+ <c-_>i :: :TCommentInline
+ <c-_><Count> :: :TComment with count argument (a number from 1 to 9)
+ (see |tcomment#Comment()|)
+
+A secondary set of key maps is defined for normal and insert mode:
<Leader>__ :: :TComment
<Leader>_p :: Comment the current inner paragraph
@@ -64,6 +93,11 @@ A secondary set of key maps is defined for normal mode.
<Leader>_n :: :TCommentAs &filetype <QUERY COUNT>
<Leader>_s :: :TCommentAs &filetype_<QUERY COMMENT SUBTYPE>
+... and for select mode:
+
+ <Leader>__ :: :TComment
+ <Leader>_i :: :TCommentInline
+
-----------------------------------------------------------------------
Install~
View
209 tml/tpl_templator.txt
@@ -0,0 +1,209 @@
+*templator.txt* Multi-file project templates using skeleton/snippets engines
+ Author: Tom Link, micathom at gmail com
+
+In many programming languages/environments, you usually work with a set of files
+that belong together. E.g. if you create a c file, you usually also want to
+create a h header file. If you create a viewer file, you usually also want to
+create corresponding model and controller files. If you want to create a
+library file, you usually also want to create some test file etc. This is were
+templator comes in.
+
+The templator plugin allows the creation of filesets based on multi-file
+templates. Templates could be written in any code
+template/skeleton/snippets style. At the time of writing, templates can
+be written in:
+
+ - template vim (see |templator-tvim|) ("tvim" extension)
+ - tskeleton (vimscript #1160) ("tskel" extension)
+
+It shouldn't be too difficult to add support for additional template
+engines.
+
+The |:Templator| command can be used to create multi-file projects.
+
+Example 1: Create files for the "test" template-set in the current root
+directory, which usually is the current working directory unless
+|b:templator_root_dir| is set (see |templator-arguments| for details): >
+
+ :Templator test
+
+Example 2: Create files for the "test" template-set in some directory (the
+directory is created if it doesn't already exist): >
+
+ :Templator ~/src/foo/bar/test
+
+Templates are kept in "templator" subdirectories in your 'runtimepath' (e.g.
+~/.vim/templator). A subdirectory's name consists of
+"TEMPLATE_NAME.TEMPLATE_TYPE". TEMPLATE_NAME is the name that is used for the
+|:Templator| command. TEMPLATE_TYPE is the name of the template engine used to
+expand file templates.
+
+Templates consist of a bunch of files and an optional vim script (see
+|templator-scripts|) that is run after creating the files.
+
+
+-----------------------------------------------------------------------
+Tutorial~
+
+Following the second example above, (using tskeleton for file templates) the
+root directory of the template set would be: >
+
+ ~/.vim/templator/test.tskel/
+
+The template set could, e.g., consist of the following files: >
+
+ ~/.vim/templator/test.tskel/README.TXT
+ ~/.vim/templator/test.tskel/docs/index.html
+ ~/.vim/templator/test.tskel/src/main.c
+
+and an optional vim script (see |templator-scripts|) in:
+
+ ~/.vim/templator/test.vim
+
+This vim script is run with ~/src/foo/bar/ set as current working directory.
+
+The above command call >
+
+ :Templator ~/src/foo/bar/test
+
+would the result in the creation of the following files: >
+
+ ~/src/foo/bar/README.TXT
+ ~/src/foo/bar/docs/index.html
+ ~/src/foo/bar/docs/main.c
+
+
+-----------------------------------------------------------------------
+ *templator-scripts*
+Template scripts~
+
+Every template set may be accompanied by a vim script in the parent directory.
+E.g. the script file for the template set "~/.vim/templator/test.tskel/" is
+"~/.vim/templator/test.vim".
+
+The template script for template NAME can set the following
+|dictionary-function|s (self is set to g:templator#hooks[NAME]):
+
+ g:templator#hooks.{NAME}.CheckArgs(args) dict
+ Check whether the provided command-line arguments are complete
+ and fit the requirements of the template set. Return true (i.e.
+ non-zero) if the arguments are valid; otherwise return false
+ (i.e. 0). If the function returns false, an exception is
+ |:throw|n. Since "args" is a mutable dictionary, the function
+ can modify the args argument.
+
+ g:templator#hooks.{NAME}.Before(args) dict
+ Called before processing the template set.
+
+ g:templator#hooks.{NAME}.IncludeFilename(args) dict => boolean
+ Return false if the current file should not be created. Return true
+ otherwise. If the hook isn't defined, the value defaults to true.
+ args['__FILE__'] contains the name of the template file.
+ args['__FILENAME__'] contains the name of the filename that would be
+ created on disk.
+
+ g:templator#hooks.{NAME}.Buffer(args) dict
+ Called on each newly created file.
+
+ g:templator#hooks.{NAME}.After(args) dict
+ Called after processing the template set.
+
+
+-----------------------------------------------------------------------
+ *templator-arguments*
+Arguments for the |:Templator| command~
+
+The first "name" argument to the |:Templator| command defines:
+
+ 1. where to put newly created files
+ 2. based on which template set.
+
+The "name" argument consists of one to three parts: [*][DIR]NAME
+
+ * ...... Optional: Create the files relative to a project root directory
+ (see |b:templator_root_dir|). Templator uses the following methods
+ to find the project's root directory:
+ *b:templator_root_dir*
+ 1. If the variable b:templator_root_dir exists, use its
+ value.
+ 2. If tlib (vimscript #1863) is available, check if the
+ current buffer is under the control of a supported VCS and
+ use that directory.
+
+ DIR .... Optional: A relative or absolute directory name. The directory
+ will be created if it doesn't exist. E.g. "foo/bar/test" will
+ create file from the template set "test" in the directory
+ "foo/bar", which will be created if necessary.
+
+ NAME ... The name of the template set to be used. The NAME of the template
+ set "foo.tskel" is "foo".
+
+Example:
+If b:templator_root_dir is /home/foo/bar and the current buffer is
+/home/foo/bar/src/lib/test.c, then *boo/far will create files from the
+"far" template set in /home/foo/bar/boo.
+
+Additional arguments can be passed as a mix of numbered and named
+arguments. E.g. "foo name=bar boo" will be parsed as:
+
+ 1 = foo
+ name = bar
+ 2 = boo
+
+Those arguments can be used from placeholders (see
+|templator-placeholders|).
+
+
+-----------------------------------------------------------------------
+ *templator-placeholders*
+Placeholders in filenames~
+
+The basename of template files may contain place holders. The values for these
+placeholders can be set when calling the |:Templator| command.
+
+The argument may contain named or numbered arguments. E.g.
+
+ :Templator test foo class=Test bar
+
+Will create files based on the template set called "test" with the following
+argument list:
+
+ 1 ....... foo
+ 2 ....... bar
+ class ... Test
+
+Placeholders in filenames can be defined as follows:
+
+ ${1} .............. 1 can be any numeric value that references the nth
+ (unnamed) value of the argument list
+ ${NAME} ........... Replace with the argument NAME
+ ${NAME=DEFAULT} ... Replace with the argument NAME but use the DEFAULT
+ value if it isn't set
+
+Example: With the above argument list the template filename "docs/${class}.txt"
+will be expanded to the filename "~/src/foo/bar/docs/Test.txt".
+
+
+-----------------------------------------------------------------------
+Install~
+
+In order to install the vba, open the vba file in VIM and type: >
+
+ :so %%
+
+See :help vimball for details.
+
+Also available via git: http://github.com/tomtom/templator_vim/
+
+
+Optional enhancements:
+
+In order to use tskeleton-style template sets, tskeleton (vimscript #1160) must
+be installed: http://www.vim.org/scripts/script.php?script_id=1160
+
+For projects under VCS control, if you want support for filenames relative to
+the project's root, tlib (vimscript #1863) must be installed:
+http://www.vim.org/scripts/script.php?script_id=1863
+
+
+%s
View
92 tml/tpl_tinykeymap.txt
@@ -0,0 +1,92 @@
+*tinykeymap.txt* Tiny, temporary keymaps
+ Author: Tom Link, micathom at gmail com
+
+This plugin is a 90%% clone of Andy Wokula's tinymode (vimscript #2223).
+It takes a different approach that hopefully avoids certain problems
+without creating new ones. tinymode actually creates maps to do its job,
+tinykeymap only creates maps for the entry sequence and uses the
+|getchar()| function to handle further input.
+
+This plugin lets users define "temporary keymaps", a.k.a. tinykeymaps,
+with the |tinykeymap#EnterMap()| function. Users can define a map to
+activate a tinykeymap. Users can then use single key shortcuts to
+trigger commands defined with |tinykeymap#Map()|. Pressing an undefined
+key or <Esc>, deactivates the tinykeymap.
+
+Example usage: Define a tinykeymap to make it easier to ...
+
+ - operate on windows
+ - operate on tabs
+ - operate on text
+
+Example definition for a "tabs" tinykeymap (heavily based on Andy
+Wokula's tabs mode for tinymode): >
+
+ call tinykeymap#EnterMap('tabs', 'gt', {'name': 'Tabs mode'})
+ call tinykeymap#Map('tabs', 'n', 'tabnew')
+ call tinykeymap#Map('tabs', 't', 'norm! gt')
+ call tinykeymap#Map('tabs', 'T', 'norm! gT')
+ call tinykeymap#Map("tabs", "^", "tabfirst")
+ call tinykeymap#Map("tabs", "$", "tablast")
+ call tinykeymap#Map("tabs", "c", "tabclose")
+
+Example use of the above tinykeymap: E.g. pressing gt3n^c2t will:
+
+ gt ... Enter tabs mode
+ 3n ... create 3 new tabs,
+ ^ ... select the first one,
+ c ... close it, and
+ 2t ... move to the second tab on the right.
+
+A tinykeymap is exited (1) by pressing <Esc> or (2) by timeout (see
+|g:tinykeymap#timeout|).
+
+tinykeymap comes with the following pre-defined tinykeymaps (see
+|g:tinykeymap#mapleader| and the related g:tinykeymap#*#map variables for how
+to customize the key binding):
+
+ tabs gt :: Operate on tabs
+ windows <C-W> :: Operate on windows
+ buffers <Leader>mb :: Operate on buffers
+ diff <Leader>md :: Make it easier to work with |diff|s
+ filter <Leader>mf :: Fold lines not matching some pattern (default: word
+ under cursor)
+ lines <Leader>ml :: Operate on lines
+ loc <Leader>mo :: Operate on the |location-list|
+ qfl <Leader>mq :: Operate on the |quickfix| list
+ undo <Leader>mu :: Operate on the |undo| tree
+
+Differences to tinymode:
+
+ - tinykeymaps and maps may have options (optional)
+ - tinykeymaps can be buffer-local
+ - dealing with [count] is easier (if a map contains "<count>", this
+ placeholder is replaced with the current [count], i.e. a
+ previously entered number; otherwise the expression is evaluated
+ [count] times)
+ - avoid a certain misleading error message
+
+submode (vimscript #2467) is another package that provides similar
+functionality.
+
+-----------------------------------------------------------------------
+Install~
+
+In order to install the vba, open the vba file in VIM and type: >
+
+ :so %%
+
+See :help vimball for details.
+
+Optional enhancements:
+
+ tlib (vimscript #1863) ... highlight current line in some maps
+
+By default, tinykeymap will load all tinykeymaps in your 'runtimepath'.
+If this is not what you want, set |g:tinykeymaps_default| in your
+|vimrc| file.
+
+Also available via git: http://github.com/tomtom/tinykeymap_vim/
+
+
+%s
View
12 tml/tpl_tmru.txt
@@ -1,9 +1,10 @@
*tmru.txt* Most Recently Used Files
Author: Tom Link, micathom at gmail com
-This plugin provides a simple most recently used files facility. Users
-can use patterns to filter the file list. Users can open multiple files
-at once.
+This plugin allows users to open recently used files. Users can filter
+the file list by typing a pattern. Users can open multiple files at
+once. The list of recently used files is synchronized across multiple
+instances of (g)vim running simultaneously.
:TRecentlyUsedFiles ... open one or more recently used file(s)
:TRecentlyUsedFilesEdit ... edit the mru list
@@ -13,9 +14,10 @@ tlib#cache is used -- which saves the data in ${vimfiles}/cache/tmru/files
by default.
By default tmru matches the search pattern on the full filename. If
-you want to match on the basename, add the following to
-~/vimfiles/after/plugin/tmru.vim: >
+you want to match on the basename, add the following to your |.vimrc|
+file: >
+ let g:tmru_world = {}
let g:tmru_world.filter_format = 'fnamemodify(%%s, ":t")'
If you want to retain the last filter between calls of :TRecentlyUsedFiles, you
View
648 tml/tpl_tskeleton.txt
@@ -0,0 +1,648 @@
+*tskeleton.txt* tskeleton -- File Templates and Code Skeletons
+
+Author: Tom Link, micathom AT gmail com?subject=vim
+
+
+tskeleton provides file templates and code skeletons ("snippets" or "bits").
+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 (see |tskeleton-jump-positions|).
+
+Basic usage:
+Type `:new filename.ext`. If a skeleton for the respective filetype is
+defined (see |tskeleton-skeletons|), it will be read into the buffer.
+
+Type a partial name of a snippet (at least the first letter) and press
+(in insert mode) <c-space> (see |tskeleton-key-bindings| for alternative
+key maps). If the name identifies a snippet/bit, it will be replaced with
+its expansion text. If there are several snippets beginning with that
+"name", you will be asked to select one from a list of matching
+snippets.
+
+<c-space> can be configured to expand snippets but also (albeit disabled
+by default) abbreviations, functions (VIM script only), tags, word,
+'completefunc' and 'omnifunc' items (see |g:tskelTypes| and
+|g:tskelHyperComplete| for details.)
+
+Press <c-j> to jump to the next place holder (see
+|tskeleton#GoToNextTag()|).
+
+
+Demo -- tskeleton and the stakeholders (vimscript #3326) plugin:
+http://vimsomnia.blogspot.com/2010/11/tskeleton-and-stakeholders-vim-plugins.html
+
+
+Git:
+https://github.com/tomtom/tskeleton_vim
+
+
+For similar plugins see: http://vim.wikia.com/wiki/Snippet_Plugin_Comparison
+
+Limitations of tskeleton:
+ - Place holders cannot be nested.
+ - tskeleton was originally written for vim 6.0. I'd expect it to be
+ less snappy than more modern and simpler plugins, although it
+ tries to provide acceptable performance on slower computers by
+ caching frequently reused data.
+
+Advantages of tskeleton with respect to some other plugins:
+ - tskeleton provides for more complex templates (see
+ |tskeleton-place-holder|) including conditional expansion, loops,
+ inclusion of other templates, user queries etc.
+ - Easy creation of camel case, all upper/lower case letter names etc. (see
+ |tskeleton-modifiers|).
+
+It depends:
+ - A place holder is some text in the buffer, i.e. tskeleton uses less magic
+ when handling jump positions. As long as users don't replace all place
+ holders, the buffer's contents most likely isn't valid code and an
+ interpreter/compiler will most likely refuse to load it even if the
+ code is never executed.
+
+
+-----------------------------------------------------------------------
+ *tskeleton-install*
+Install~
+
+Edit the vba file and type:
+
+ :so %%
+
+See :help vimball for details.
+
+It is recommended to use tskeleton in conjunction with the stakeholders plugin
+(vimscript #3326):
+
+ http://www.vim.org/scripts/script.php?script_id=3326
+ https://github.com/tomtom/stakeholders_vim
+
+If you don't already have some skeletons, you may want to download
+tskeleton-Samples.zip from:
+
+ http://www.vim.org/scripts/script.php?script_id=1160
+
+or from
+
+ https://github.com/tomtom/tskeletons
+
+Copy the files to your local vimfiles directory (see also |add-global-plugin|).
+The directory structure should look like this:
+
+ ~/.vim/skeletons/
+ FILE TEMPLATES ...
+ map/
+ MAP FILES FOR CONDITIONAL EXPANSION
+ bits/
+ &filetype.txt (single line templates)
+ general/
+ GENERAL CODE SKELETONS ...
+ &filetype/
+ FILETYPE SPECIFIC CODE SKELETONS: ONE SKELETON PER FILE ...
+
+
+ *tskeleton-snippets*
+tskeleton also provides partial support for snipMate snippets (see
+https://github.com/honza/snipmate-snippets). The following limitations apply:
+ - tskeleton cannot handle nested tags/place holders
+
+
+ *tskeleton-cache*
+In order to speed up things, tskeleton caches intermediate results.
+Those files are created in |g:tlib_cache|. By default, the old files
+will be removed from the cache every |g:tlib#cache#purge_every_days|
+days. In order to disable purging (e.g. if you purge the cache directory
+by means of a cron script), set |g:tlib#cache#purge_every_days| to -1.
+
+
+-----------------------------------------------------------------------
+ *tskeleton-usage*
+ *tskeleton-skeletons*
+File templates~
+
+The file skeletons are stored in the skeletons subdirectory. Which
+template is used for which new file is controlled by |:autocmd|s. This
+provides greater flexibility than a &filetype based approach as you can
+select templates on the basis of a filename pattern or a specific
+directory.
+
+Currently, the following file types are supported by default:
+
+ - batch.bat
+ - deplate.txt
+ - latex.tex
+ - php.inc.php
+ - php.php
+ - plugin.vim
+ - ruby.rb
+ - shell.sh
+ - text.txt
+
+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: >
+
+ ~/.vim/skeletons/templates/GROUP/FILETYPE PATTERN
+
+where GROUP is an arbitrary name for a collection of auto templates,
+FILETYPE is a know vim filetype, and the pattern is an encoded pattern (# ==
+*, %%XX=Char XXh) for auto-generated autocmds.
+
+Example: Templates file names for some vim-related files: >
+
+ ~/.vim/skeletons/templates/vim/help #%%2fvimfiles%%2fdoc%%2f#.txt
+ ~/.vim/skeletons/templates/vim/vim #%%2fvimfiles#%%2fftplugin%%2f#.vim
+ ~/.vim/skeletons/templates/vim/vim #%%2fvimfiles#%%2fsyntax%%2f#.vim
+
+<
+ *tskeleton-place-holder*
+
+Tags (which look like <+...+>) serve two purposes:
+
+ - marker for jump positions (see |tskeleton#GoToNextTag()|)
+ - dynamic content expansion
+
+You can use tags to define cursor jump positions. tskeleton also
+supports some special tags that are expanded when inserting the
+skeleton.
+
+A list of special tags:
+ *tSkeletion-<+FILE NAME ROOT+>*
+ <+FILE NAME ROOT+>
+ The file name root
+ *tSkeletion-<+FILE NAME+>*
+ <+FILE NAME+>
+ The file name
+ *tSkeletion-<+FILE SUFFIX+>*
+ <+FILE SUFFIX+>
+ The file suffix
+ *tSkeletion-<+FILE DIRNAME+>*
+ <+FILE DIRNAME+>
+ The file's directory
+ *tSkeletion-<+NOTE+>*
+ <+NOTE+>
+ A note
+ *tSkeletion-<+DATE+>*
+ <+DATE+>
+ The current date (the format is controlled via
+ g:tskelDateFormat)
+ *tSkeletion-<+AUTHOR+>*
+ <+AUTHOR+>
+ The author's name (g:tskelUserName)
+ *tSkeletion-<+EMAIL+>*
+ <+EMAIL+>
+ The author's e-mail (g:tskelUserEmail)
+ *tSkeletion-<+COMPANY+>*
+ <+COMPANY+>
+ The author's company (g:tskelUserCompany)
+ *tSkeletion-<+WEBSITE+>*
+ <+WEBSITE+>
+ The author's homepage (g:tskelUserWWW)
+ *tSkeletion-<+LICENSE+>*
+ <+LICENSE+>
+ The name of the license this file is released under
+ (g:tskelLicense)
+
+In order to define your own tag, you have to define a function called
+TSkeleton_TAGNAME() that returns the text to be filled in.
+
+ *tskeleton-tags*
+tskeleton also supports the following pseudo-tags:
+
+ <+CURSOR+> *tSkeletion-<+CURSOR+>*
+ Where to place the cursor after insertion
+
+ <+&NAME+> *tSkeletion-<+&+>*
+ A vim option
+
+ <+g:NAME+> *tSkeletion-<+g:+>*
+ A global variable
+
+ <+b:NAME+> *tSkeletion-<+b:+>*
+ A buffer local variable
+
+ <+?QUERY?+> *tSkeletion-<+?+>*
+ Query[1] the user
+
+ <+?VAR|QUERY?+>
+ Query[1] the user and propose some choices from the variable VAR
+
+ *tSkeletion-<+bit+>*
+ <+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+> *tSkeletion-<+tskel+>*
+ Same as the above
+
+ <+call:FUNCTION(ARGS)+> *tSkeletion-<+call+>*
+ Insert the result value of some function
+
+ <+include(TSKELETON)+> *tSkeletion-<+include+>*
+ Another synonym for the above.
+
+ <+execute(EX COMMAND)+> *tSkeletion-<+execute+>*
+ Run a vim command.
+
+[1] If the query ends with a colon, the second question mark will be
+removed. Up to verson 2.4 VAR is a string, separating the items by an
+"\n". From 3.0 on, VAR is a list.
+
+NOTE: Flow control and loop tags are experimental and it's more than
+just likely that the output doesn't meet your expectations.
+
+Flow control: *tSkeletion-<+if+>*
+ <+if(CONDITION)+>
+ <+elseif(CONDITION)+>
+ <+else+>
+ <+endif+>
+
+Loops: *tSkeletion-<+for+>*
+ <+for(VAR in LIST)+>
+ <+endfor+>, <+endfor(VAR)+>
+ If you nest for loops, you have to add the variable name to the
+ endfor tag. And no, this isn't the most clever way to do this.
+
+Variables: *tSkeletion-<+let+>*
+ <+let(VAR=VALUE)+>
+ The variable will be unset or restored to its original value
+ after processing the current template.
+ VAR may have some modifiers attached:
+ VAR? ... Set only if undefined
+ VAR& ... Don't restore original variable
+
+Interaction: *tSkeletion-<+input+>*
+ <+input(VAR, QUERY, [DEFAULT], [COMPLETION])+>
+ This will insert the user input and set the variable VAR (unless
+ empty), which can be used throughout the template. The variable
+ will be removed after finishing the current template. If the
+ variable was previously defined, the original value will be
+ restored.
+ If VAR ends with '!', no text will be inserted in the buffer. In
+ this case any whitespace (including one newline) after the tag
+ will be removed. See also the notes on |tSkeletion-<+input+>|.
+
+ *tSkeletion-<+select+>*
+ <+select(VAR, LIST, [TYPE='s'], [SEPARATOR=', '])+>
+ Let the user select an item from a list.
+ VAR is a string.
+ TYPE is either 's' (single selection) or 'm' (multiple selection) --
+ see also |tlib#input#List()|.
+ If TYPE is 'm', the results are joined with SEPARATOR.
+ Example: >
+ before(<+select("s:type", [":all", ":each"])+>)
+ before(<+select("s:type", ["A", "B", "C", "D"], "m", "-")+>)
+<
+
+Other: *tSkeletion-<+nl+>*
+ <+nl+>
+ Insert a newline
+
+ <+joinline+> *tSkeletion-<+joinline+>*
+ Join with next line. Delete any whitespace.
+
+ <+nop+> *tSkeletion-<+nop+>*
+ Insert nothing (could be necessary in conjunction with the "for"
+ tag)
+
+A wiki like table could then be constructed using a skeleton like this: >
+
+ <tskel:before>
+ let s:my_rows = input('Rows: ')
+ let s:my_cols = input('Columns: ')
+ </tskel:before>
+ <tskel:after>
+ unlet! s:my_rows s:my_cols
+ </tskel:after>
+ <+CURSOR+><+for(i in range(s:my_rows))+>
+ |<+for(j in range(s:my_cols))+> <+CELL+> |<+endfor(j)+><+nop+>
+ <+endfor(i)+>
+
+or: >
+
+ <+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)+>
+
+NOTE: The <+nop+> is necessary in order to prevent the <+endfor+> tag to
+"eat" the newline. If we include this bit from another bit that already
+sets s:my_rows and/or s:my_cols, the user won't be queried again (because of
+the "?" in the input statement). E.g. >
+
+ <+let(s:my_rows = 3)+>
+ <+let(s:my_cols = 3)+>
+ <+include(table)+>
+
+ *tSkeletion-backslash*
+Any special tag can be preceded with a backslash in order to prevent
+expansion. Examples: >
+
+ <+\if(foo=1)+>
+
+surprisingly expands to >
+
+ <+if(foo=1)+>
+
+It's best to use global variables with "if" and "for" tags as the body
+is most likely evaluated in a different buffer in a hypothetically
+unknown context.
+
+
+ *tskeleton-jump-positions*
+Unknown tags are kept in the expanded skeleton. These tags can be used
+as cursor jump marks. This syntax was originally used by imap (vimscript
+#244 or vimscript #475). If you don't want to install imap, you can also
+use |TSkeletonMapGoToNextTag()|.
+
+Nameless tags (<++>) will disappear when they are selected.
+
+Example:>
+
+ case <+CURSOR+> in
+ <+PATTERN+>)
+ <+BODY+>
+ ;;
+ *)
+ <+DEFAULT+>
+ ;;
+ esac
+ <++>
+
+When you insert this skeleton, the cursor will be placed at
+"<+CURSOR+>". If you press <c-j>, the cursor will jump to "<+PATTERN+>"
+(the tag will remain selected). If you press <c-j> three times, the
+cursor will jump to "<++>" (the tag will be deleted).
+
+Check out the "test_tskeleton" skeleton for examples.
+
+
+ *tskeleton-modifiers*
+Tags can be modified using modifiers, like in: >
+
+ <+TAG NAME:MODIFIER+>
+
+Known modifiers:
+
+ l :: lower case
+ u :: upper case
+ c :: capitalize
+ C :: transform to CamelCase
+ s/FROM/TO/ :: replace text (actually a s//g); this has to be the
+ last modifier; the pattern separator can be selected
+ arbitrarily
+
+Example for a ruby class template: >
+
+ class <+FILE NAME ROOT:cs*\W*_*+>
+ <+CURSOR+>
+ end
+ <++>
+
+-----------------------------------------------------------------------
+ *tskeleton-code-skeletons*
+ *tskeleton-bits*
+Bits/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.%%5Cnew&command
+ ../tex/&Define.%%5Cnew&environment
+
+This will create skeletons for \newcommand and \newenvironment but will
+group the skeletons under the TSkel.Define. menu with the respective
+accelerators.
+
+ *tskeleton-Types* *g:tskelTypes*
+ *tskeleton#Initialize()*
+tskeleton supports several types of code templates:
+
+ - skeleton (standard tskeleton functionality)
+ - abbreviations (VIM abbreviations)
+ - functions (VIM script functions extracted from :function)
+ - mini ("mini" bits, one-liners etc.)
+ - tags (tags-based code templates, requires ctags, I presume)
+
+Not all types are enabled by default. User have to select, which types
+they want to use, by setting the g:tskelTypes at start-up. When changing
+the variable, users might have to call tskeleton#Initialize().
+
+ *tskeleton-Skeleton*
+Smaller skeleton bits are stored in SKELETONS/bits/FILETYPE/ or
+SKELETONS/bits/general/. I.e., code skeletons can be filetype specific
+or generally available.
+
+Skeleton bits can be filled in by typing: >
+
+ :TSkeletonBit NAME
+
+For this command, command line completion is implemented. Calling this
+command will insert the contents of the respective file below the
+current line.
+
+NOTE: Bit names should not contain ampersand (as these are interpreted
+as menu accelerators) and periods (which are used to construct
+submenus). Other special characters can be included by encoding them in
+hex form as %%XX as it is done in URLs. Example: "%%5Csection" becomes
+"\section".
+
+ *tskeleton-key-bindings*
+The default key bindings for inserting code skeletons are:
+
+ <c-space> ... In insert mode, expand name before the cursor
+ <Leader>## ... Expand name under cursor
+ <Leader>#t ... Insert code skeleton via command line
+ <c-\><c-\> ... In insert mode, expand the bit before the cursor (on
+ a German keyboard this happens to be <c-#><c-#>)
+
+ *g:tskelKeyword_{&filetype}*
+A bit name usually is the |word| under the cursor. If this doesn't fit
+your needs, you can define g:tskelKeyword_{&filetype} to define what
+makes up a skeleton name. Example: >
+
+ let g:tskelKeyword_viki = '\(#\|{\)\?[^#{[:blank:]]\{-}'
+
+
+ *tskeleton-embedded-code*
+Code skeletons may contain vim code that is evaluated before or after
+expanding the tags. The before/after blocks are fed to |:exec| and must
+not contain function definitions.
+
+NOTE: The "parser" is quite primitive. These tags have to start as
+single statement in a line at column 1, and they have to appear in the
+following order:
+
+ <tskel:msg> *<tskel:msg>*
+ Display an explanatory message after template expansion
+
+ <tskel:before> *<tskel:before>*
+ Execute code before template expansion in the target buffer
+
+ <tskel:after> *<tskel:after>*
+ Execute code after template expansion in the target buffer
+
+ <tskel:here_before> *<tskel:here_before>*
+ Execute code before template expansion in the template buffer
+
+ <tskel:here_after> *<tskel:here_after>*
+ Execute code after template expansion in the template buffer
+
+ <tskel:abbrev> *<tskel:abbrev>*
+ Make the bit available via |:abbreviate| under the enclosed name.
+
+ <tskel:menu> *<tskel:menu>*
+ Use this menu name instead of the default one.
+
+ <tskel:condition> *<tskel:condition>*
+ An expression that checks whether a bit is eligible in the
+ current context.
+
+BibTeX example: >
+
+ <tskel:msg>
+ Insert a collection entry
+ </tskel:msg>
+ <tskel:before>
+ let b:tskelArticleID = input("ID of bibentry: ")
+ if b:tskelArticleID == "" | let b:tskelArticleID = "<+CURSOR+>" | endif
+ </tskel:before>
+ <tskel:after>
+ unlet b:tskelArticleID
+ </tskel:after>
+ @INCOLLECTION{<+b:tskelArticleID+>,
+ author = {<+CURSOR+>},
+ title = {<+ARTICLE TITLE+>},
+ crossref = {<+CROSSREF+>},
+ pages = {<+PAGES+>},
+ abstract = {[[~/Docs/Abstracts/<+b:tskelArticleID+>.txt]]},
+ }
+ <++>
+
+In the above example, we query the user for an ID and insert this ID as
+entry key and as an abstract's file name.
+
+The before/after blocks are evaluated in the destination buffer. The
+variants here_before/here_after are evaluated in the scratch buffer for
+the current code skeleton.
+
+ *tskeleton-groups*
+ *g:tskelBitGroup_{&filetype}*
+Groups~
+
+Some filetype's bits might be of use for other filetypes too. You can
+make them accessible by defining a g:tskelBitGroup_{&filetype} variable.
+E.g., in php mode all html bits are made accessible by setting this
+variable (the default): >
+
+ let g:tskelBitGroup_php = ['php', 'html']
+
+Bits of type "general" are always available.
+
+ *tskeleton-context*
+ *tskeleton-map*
+Maps -- Context-sensitive expansion~
+
+To some extent, tskeleton is capable of offering the user only a small
+selection of eligible bits for a specific context if a map file
+($VIMFILES/skeletons/map/{&filetype}) is provided. Such a map file is made up
+of regular expressions matching a specific context (before the cursor
+only) and a blank-separated list of eligible bits. The regexp and the
+list are separated by whitespace: >
+
+ REGEXP BIT1 BIT2 ... BITn
+
+Example: >
+
+ <form\\([^>]\\|\\n\\)* name= action= method=
+
+If an eligible bit is undefined, the name is inserted as is. I.e. you
+don't have to define skeletons for all these options and argument names.
+
+
+ *tskeleton-minibits*
+Minibits~
+
+Mini bits are kept in the files:
+
+ - $CWD/.tskelmini
+ - $VIMFILES/skeletons/bits/{&filetype}.txt
+
+These files contain whitespace-separated pairs of bit names and their
+expansions. These files are meant to keep expansions of accronyms and
+abbreviations and the like. Example: >
+
+ IMHO In my humble opinion
+ AFAIK As far as I know
+
+ *tskeleton-menu*
+ *g:tskelMenuPrefix*
+Menu~
+
+If g:tskelMenuPrefix is non-empty, tskeleton will display a menu
+containing all eligible bits for a certain filetype.
+
+The menu can be hierarchical and certain entries may have shortcuts by
+properly naming the bits. Example: >
+
+ &Environment.&Quote
+ &Environment.Q&uotation
+
+This will create the submenu "Environment" that can be selected by
+typing "e" (on Windows) and two entries, the first of which can be
+selected by typing "q" and the second by typing "u".
+
+Be aware that the actual bit names are Quote and Quotation (i.e. the
+submenu and the ampersand are stripped off).
+
+
+-----------------------------------------------------------------------
+ *tskeleton-utilities*
+Utilities~
+
+ *tskeleton#IncreaseRevisionNumber()*
+The function tskeleton#IncreaseRevisionNumber() provides a way to
+automatically update a revision number in the form >
+
+ @Revision: 1.0.393
+
+In order to use this function, add something like this to your |vimrc|
+file: >
+
+ autocmd BufWritePre * call tskeleton#IncreaseRevisionNumber()
+
+ *:TSkeletonCleanUpBibEntry*
+The TSkeletonCleanUpBibEntry command can be used to purge the current bibtex
+entry from expendable fields (i.e., lines matching <+.\{-}+>).
+
+For bibtex files, this command is bound to: <Leader>tc
+
+ *TSkeletonMapGoToNextTag()*
+ *tskeleton#GoToNextTag()*
+If g:tskelMapGoToNextTag is true, the <c-j> map will be enabled. (That
+is the key that was also used by the imaps.vim plugin.) Press <c-j> to
+jump between tags.
+
+This function provides one or two extras over the version of imaps.vim.
+An explanation:
+
+ - ###, +++, ???, !!! are used as markers too.
+ - If a marker is empty (e.g. <++>), the marker will be removed (as
+ imaps.vim does).
+ - If a marker matches <+NAME/DEFAULT+>, the marker will be replaced
+ with DEFAULT.
+ - If a snippet contains numbered placeholders (e.g. <+1+>), these
+ will be selected first in increasing number.
+
+
+%s
View
19 tml/tpl_viki.txt
@@ -690,19 +690,18 @@ Example: >
The filenames are stored as extended viki names. Each line can take a comment
that is restored upon automatic update.
-If a "head" argument is passed to the #Files region, the first N lines will be
-shown after the reference.
+For a list of available arguments, see |viki#DirListing()|.
-There are a few special commands to deal with this region.
-
-If in the following commands a "!" is added, the command works only on files
-in the same directory or a subdirectory as the file on the current line.
+The following arguments can be used to deal with #Files regions. An
+additional <bang> ("!") makes these command work on just files in the
+same directory or a subdirectory as the file on the current line.
Default Key Binding~
-<LocalLeader>vu ... :VikiFilesUpdate
-<LocalLeader>vU ... :VikiFilesUpdateAll
-<LocalLeader>vx ... :VikiFilesExec
-<LocalLeader>vX ... :VikiFilesExec!
+
+ <LocalLeader>vu ... :VikiFilesUpdate
+ <LocalLeader>vU ... :VikiFilesUpdateAll
+ <LocalLeader>vx ... :VikiFilesExec
+ <LocalLeader>vX ... :VikiFilesExec!
Example: >
Use ":VikiFilesExec! e" (<LocalLeader>vXe<cr>) to edit all the files in
Please sign in to comment.
Something went wrong with that request. Please try again.