Changes between Initial Version and Version 1 of VimSnippetSupport


Ignore:
Timestamp:
11/06/09 09:37:55 (12 years ago)
Author:
solj
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • VimSnippetSupport

    v1 v1  
     1= Using Bcfg2 with Vim + [http://www.vim.org/scripts/script.php?script_id=2540 snipMate] = 
     2 
     3This page describes using vim with snipMate and a set of snippets that allow quick composition of bundles and base files. More snippets are under development. 
     4 
     5 1. Download snipMate from http://www.vim.org/scripts/script.php?script_id=2540 
     6 1. Install it using the install instructions (unzip snipMate.zip -d ~/.vim or equivalent, e.g. $HOME\vimfiles on Windows) 
     7 1. Add the following to ~/.vim/snippets/xml.snippets 
     8{{{ 
     9#!text/xml 
     10# Bundle 
     11snippet <Bundle 
     12        <Bundle name='${1:bundlename}'> 
     13                ${2} 
     14        </Bundle> 
     15# Base 
     16snippet <Base 
     17        <Base> 
     18                ${1} 
     19        </Base> 
     20# Group 
     21snippet <Group 
     22        <Group name='${1:groupname}'> 
     23                ${2} 
     24        </Group> 
     25# ConfigFile 
     26snippet <Config 
     27        <ConfigFile name='${1:filename}'/> 
     28# Service 
     29snippet <Service 
     30        <Service name='${1:svcname}'/> 
     31# Package 
     32snippet <Package 
     33        <Package name='${1:packagename}'/> 
     34# Action 
     35snippet <Action 
     36        <Action name='${1:name}'/> 
     37# Directory 
     38snippet <Directory 
     39        <Directory name='${1:name}'/> 
     40# SymLink 
     41snippet <SymLink 
     42        <SymLink name='${1:name}'/> 
     43# Permissions 
     44snippet <Permissions 
     45        <Permissions name='${1:name}'/> 
     46}}} 
     47 1. Save and start editing away! 
     48 
     49Each of these snippets activates on the opening element, ie <Bundle. After this string is entered, but before entering a space, press <TAB>, and the snippet will be expanded. The template will be inserted into the text with a set of input prompts, which default to overwrite mode and can be tabbed through. 
     50 
     51The code above only works for bundles and base, but will be expanded to support other xml files as well. 
     52 
     53p.s. This idea shamelessly stolen from [wiki:EmacsSnippetSupport]