ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Snippet​X

by ColinRyan ST3

A Sublime Text 3 plugin for combining tabular data with snippets

Details

Installs

  • Total 1K
  • Win 1K
  • OS X 239
  • Linux 207
Jan 23 Jan 22 Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10 Jan 9 Jan 8 Jan 7 Jan 6 Jan 5 Jan 4 Jan 3 Jan 2 Jan 1 Dec 31 Dec 30 Dec 29 Dec 28 Dec 27 Dec 26 Dec 25 Dec 24 Dec 23 Dec 22 Dec 21 Dec 20 Dec 19 Dec 18 Dec 17 Dec 16 Dec 15 Dec 14 Dec 13 Dec 12 Dec 11 Dec 10 Dec 9
Windows 1 0 2 0 0 0 1 1 0 0 0 1 1 1 3 2 0 1 0 2 0 2 2 0 0 1 0 1 0 0 0 4 0 1 0 0 0 1 2 2 2 1 0 0 1 0
OS X 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 0 3 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1

Readme

Source
raw.​githubusercontent.​com

SnippetX

Turn tabular data into code!

SnippetX takes comma-seperated data (csv) and combines it with a snippet of your choosing. It's like xarg but for snippets.

Demo

SnippetX

Installation

Download it using Package Control.

Basic Usage

Place comma-seperated values in your view or open a csv file. At the bottom or top add 'sx:' followed by the tabTrigger of the snippet you'd like to use as show here:

sx:[TAB-TRIGGER-OF-SNIPPET]

Make sure there are newlines between the data you want manipulated and anything else. Hit Alt+x. Each line will replaced with the snippet you chose, with the data from the line placed in the snippet.

What snippets can I use?

With the exception of built in snippets, any snippet that has a tab trigger can be used. Nothing special has to be added to make this work. The snippets you use everyday work fine with SnippetX.

More Details

The snippet are context sensitive by default, but you can use snippets meant for any context. If you want, for example, to use a Javascript snippet in a plain text file, your sx line would look like this:

sx:[TAB-TRIGGER-OF-SNIPPET]:source.js

Where the data ends up depends on it's column number and sublime placeholder. IE, anything in column one maps to placeholder $1. You can use the placeholders out of order or multiple times and you can give them default values, in the event that your data has missing fields. If there are more placeholders than columns then the last few placeholders will be either empty or default values. If there are more columns than placeholders than SnippetX will use only as many columns as there are placeholders (Note that the full line would still be replaced).

License

MIT © Colin Ryan