##Adding Swift Build System
- Open Sublime Text 3
- Go To
Preferences > Browse Packages... - Add a file named
Swift.sublime-buildinsidePackagesdirectory. - Copy the following script in
Swift.sublime-buildfile.
{
"shell_cmd": "xcrun swift $file",
| p = "AABA" // pattern | |
| t = "AABAACAADAABAAABAA" // text | |
| m = p.length | |
| n = t.length; | |
| L = [];x=m;while(x--)L.push(0) // LPS array of size m, initialized to 0 | |
| e = []; // array to store ending indices of the pattern-match in the text | |
| // Knuth–Morris–Pratt algorithm | |
| for(i=1,l=0;i<m;)p[i]==p[l]?L[i++]=++l:l>0?l=L[l-1]:++i;for(i=j=0;i<n;++i)p[j]==t[i]?++j==m?e.push(i):0:j>0&&i--?j=L[j-1]:0 |
##Adding Swift Build System
Preferences > Browse Packages...Swift.sublime-build inside Packages directory.Swift.sublime-build file.{
"shell_cmd": "xcrun swift $file",
| Here is a list of scopes to use in Sublime Text 2 snippets - | |
| ActionScript: source.actionscript.2 | |
| AppleScript: source.applescript | |
| ASP: source.asp | |
| Batch FIle: source.dosbatch | |
| C#: source.cs | |
| C++: source.c++ | |
| Clojure: source.clojure | |
| CoffeeScript: source.coffee |
| [ | |
| { | |
| "keys": ["super+b"], | |
| "command": "build", | |
| "context": [ | |
| { "key": "selector", "operator": "equal", "operand": "source.c++" } | |
| ], | |
| "args": { | |
| "build_system": "Packages/C++/C++.sublime-build", | |
| "variant": "Build" |