sponsor Vim development Vim logo Vim Book Ad

Exoskeleton : Skeleton - improved!

 script karma  Rating 0/0, Downloaded by 17  Comments, bugs, improvements  Vim wiki

created by
Joe Reynolds
 
script type
utility
 
description
NOTE: Development happens on github: https://github.com/joereynolds/exoskeleton.vim

# Exoskeleton - Skeleton improved

Open files and evaluates vimscript from a template.

Example:

```
The year is {{strftime("%Y")}}
```

Transforms to

```
The year is 2018
```

# Installation

Using vim-plug

```
Plug 'joereynolds/exoskeleton.vim'
```

# Templates

There are two kinds of templates `ft` and `place`.

## ft

`ft` is the traditional skeleton that you're used to, but this time with vimscript!
     Dump your `ft` templates in `~/.vim/exoskeleton/ft` e.g. `~/.vim/exoskeleton/ft/test.php`

Any vimscript enclosed in these (configurable) delimiters will be evaluated.

```
Copyright {{strftime("%Y")}}
The year is {{strftime("%Y")}}

This string has no placeholder

The files in here are:
{{glob("./*")}}
```
Transforms to
```
Copyright 2018
The year is 2018

This string has no placeholder

The files in here are:
./Desktop
./Documents
./Downloads
./Music
./Pictures
./Public
./Templates
./Videos
./a.php
./code
./examples.desktop
./examples.desktop.gpg
./install-inspect-deb
./neovim-gtk
./npm-debug.log
./phpactor.log
./programs
./salutem
./snap
./sqlp
./test
./test_file
./test_file.sig
```

## place examples

`place` is a mapping to a directory on your filesystem, this is mega handy for the newer
         frameworks that are cropping up and force you to a specific structure.
         Dump your `place` templates in `~/.vim/exoskeleton/place`


(Nested in ~/.vim/exoskeleton/place/home-joe-code-models)

```
<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}

class {{expand('%:t:r')}} extends CI_Model
{

}
```

Transforms to
(assuming the filename is MyModel.php)

```
<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}

class MyModel extends CI_Model
{

}
```
 
install details
Using vim-plug

```
Plug 'joereynolds/exoskeleton.vim'
```
 

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
exoskeleton.zip 1 2018-05-23 7.0 Joe Reynolds Initial upload
ip used for rating: 54.226.36.60

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.
   
OSDN.net Logo