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

Antiki

by swdunlop ALL

A Xiki Clone for Sublime Text 2/3

Details

  • 2015.05.26.06.22.27
  • github.​com
  • github.​com
  • 9 years ago
  • 6 minutes ago
  • 12 years ago

Installs

  • Total 652
  • Win 463
  • Mac 109
  • Linux 80
Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31 Oct 30 Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23 Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7
Windows 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2

Readme

Source
raw.​githubusercontent.​com

Antiki – a Xiki Clone for Sublime Text 2

Antiki implements a tiny subset of Xiki for Sublime Text 2 and Sublime Text 3. It is intended to be more portable and predictable than sophisticated combination of Xiki and @lunixboch's SublimeXiki, while implementing the essential feature of executing shell commands and replacing them with output.

Antiki considers any line starting with $ after zero or more tabs or spaces to be a possible command for execution. Placing your cursor on a command and pressing either “Command+Enter” or “Control+Enter” will cause Antiki to pass the command to your shell prompt, execute it, and replace a number of subquent lines with the output. Antiki will replace any lines with more indent than the command's indent, which effectively allows you to repeately run a command by returning your cursor to the original position and hitting “Command+Enter” again.

If you set your syntax to “Antiki”, you can simply use the “Enter” key, without the “Command” or “Control” modifier, if your cursor is currently on a line starting with $.

This makes Antiki a great tool for writing documentation, examples and working through demos.

Example – Git Commit from README.md:

For example, while hacking on an update to this README.md, Antiki was used to check git status:

$ git status
    # On branch hack
    # Changes not staged for commit:
    #   (use "git add <file>..." to update what will be committed)
    #   (use "git checkout -- <file>..." to discard changes in working directory)
    #
    #   modified:   README.md
    #
    no changes added to commit (use "git add" and/or "git commit -a")

Once satisfied with the changes, the following command would submit the changes:

$ git commit -a -m "added git commit example" --amend
    [hack 62db141] added git commit example
     1 file changed, 19 insertions(+), 13 deletions(-)

Example – Documenting Remote Setups:

To duplicate the results, simply place your cursor on the command line and hit “Command+Enter” or “Control+Enter”. If your SSH agent is properly configured in your environment and loaded with your key, you can check a remote command:

$ ssh mutation.ether uptime
     17:32:22 up 2 days, 22:39,  0 users,  load average: 0.01, 0.04, 0.05

Features:

Antiki's insistence on being stupid and simple is its greatest advantage compared to similar implementations, making it portable, maintainable and understandable.

  • Can execute shell commands in any buffer, not just Xiki buffers.
  • Does not require anything beyond Sublime Text itself, works out of the box in Windows and OSX.
  • Passes all commands through shell, ensuring features like piping to JQ or grep are easily available.

Limitations:

Antiki does not provide Xiki menus or use Xiki helpers. It also does not support continuously updating output, and will hang until a command exits or ten seconds have passed – for these features, the much more powerful SublimeXiki is recommended.

Contributors:

  • @efi – bug report and fix for windows output decoding