<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Vim Snippet Support — Bcfg2 1.3.0 documentation</title> <link rel="stylesheet" href="../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../', VERSION: '1.3.0', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <script type="text/javascript" src="../_static/sidebar.js"></script> <link rel="shortcut icon" href="../_static/favicon.ico"/> <link rel="top" title="Bcfg2 1.3.0 documentation" href="../index.html" /> <link rel="up" title="Unsorted Docs" href="index.html" /> <link rel="next" title="Notes on possible Windows support" href="windows.html" /> <link rel="prev" title="Python SSL" href="ssl.html" /> <link rel="stylesheet" href="../_static/bcfg2.css" type=""/> </head> <body> <div style="text-align: left; padding: 10px 10px 15px 15px"> <a href="../index.html"><img src="../_static/bcfg2_logo.png" border="0" alt="sampledoc"/></a> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="windows.html" title="Notes on possible Windows support" accesskey="N">next</a> |</li> <li class="right" > <a href="ssl.html" title="Python SSL" accesskey="P">previous</a> |</li> <li><a href="../index.html">home</a> | </li> <!--<li><a href="../search.html">search</a> | </li>--> <li><a href="../help/index.html">help</a> | </li> <li><a href="../contents.html">documentation </a> »</li> <li><a href="../contents.html" >Bcfg2 documentation 1.3.0</a> »</li> <li><a href="index.html" accesskey="U">Unsorted Docs</a> »</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="vim-snippet-support"> <span id="unsorted-vim-snippet"></span><h1>Vim Snippet Support<a class="headerlink" href="#vim-snippet-support" title="Permalink to this headline">ΒΆ</a></h1> <p>This page describes using vim with snipMate and a set of snippets that allow quick composition of bundles and base files.</p> <ol class="arabic"> <li><p class="first">Download snipMate from <a class="reference external" href="http://www.vim.org/scripts/script.php?script_id=2540">http://www.vim.org/scripts/script.php?script_id=2540</a></p> </li> <li><p class="first">Install it using the install instructions (unzip snipMate.zip -d ~/.vim or equivalent, e.g. $HOMEvimfiles on Windows)</p> </li> <li><p class="first">Add the following to <tt class="docutils literal"><span class="pre">~/.vim/snippets/xml.snippets</span></tt></p> <div class="highlight-cl"><pre># Bundle snippet <Bundle <Bundle name='${1:bundlename}'> ${2} </Bundle> # Base snippet <Base <Base> ${1} </Base> # Group snippet <Group <Group name='${1:groupname}'> ${2} </Group> # ConfigFile snippet <Config <ConfigFile name='${1:filename}'/> # Service snippet <Service <Service name='${1:svcname}'/> # Package snippet <Package <Package name='${1:packagename}'/> # Action snippet <Action <Action name='${1:name}'/> # Directory snippet <Directory <Directory name='${1:name}'/> # SymLink snippet <SymLink <SymLink name='${1:name}'/> # Permissions snippet <Permissions <Permissions name='${1:name}'/></pre> </div> </li> <li><p class="first">Save and start editing away!</p> </li> </ol> <p>Each 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.</p> <p>The code above only works for bundles and base, but will be expanded to support other xml files as well.</p> </div> </div> </div> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <h4>Previous topic</h4> <p class="topless"><a href="ssl.html" title="previous chapter">Python SSL</a></p> <h4>Next topic</h4> <p class="topless"><a href="windows.html" title="next chapter">Notes on possible Windows support</a></p> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../_sources/unsorted/vim_snippet.txt" rel="nofollow">Show Source</a></li> </ul> <div id="searchbox" style="display: none"> <h3>Quick search</h3> <form class="search" action="../search.html" method="get"> <input type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="windows.html" title="Notes on possible Windows support" >next</a> |</li> <li class="right" > <a href="ssl.html" title="Python SSL" >previous</a> |</li> <li><a href="../index.html">home</a> | </li> <!--<li><a href="../search.html">search</a> | </li>--> <li><a href="../help/index.html">help</a> | </li> <li><a href="../contents.html">documentation </a> »</li> <li><a href="../contents.html" >Bcfg2 documentation 1.3.0</a> »</li> <li><a href="index.html" >Unsorted Docs</a> »</li> </ul> </div> <div class="footer"> © Copyright 2009-2013, Narayan Desai. Last updated on Mar 20, 2013. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3. </div> </body> </html>