Home Download Buy Blog Forum Support

Xiki Support in Sublime (With Incentive)

Xiki Support in Sublime (With Incentive)

Postby JeffreyWay on Thu Sep 06, 2012 6:28 pm

Hey, all -

Jeffrey here from Nettuts+. I recently came across this tool, http://xiki.org/, and would *love* to see it in Sublime Text. If you're unfamiliar with it, have a look at some of the screencasts to see what's possible: http://xiki.org/screencasts/

According to their GitHub page, if we want to add support to Sublime, they'll assist: https://github.com/trogdoro/xiki (See "Other Editors')

I thought I'd, on behalf of Envato and Nettuts+, throw in a small incentive; we'll give a $500 bonus to the developer who can make it happen. :)
JeffreyWay
 
Posts: 6
Joined: Wed Dec 28, 2011 3:27 pm

Re: Xiki Support in Sublime (With Incentive)

Postby JeffreyWay on Thu Sep 06, 2012 6:36 pm

Also, curious to hear if this is even possible, given Sublime's API. I've heard yes and no from folks.
JeffreyWay
 
Posts: 6
Joined: Wed Dec 28, 2011 3:27 pm

Re: Xiki Support in Sublime (With Incentive)

Postby C0D312 on Fri Sep 07, 2012 12:50 am

Thanks for the link Jeff. After looking over some of the screencasts, it looks a bit out of reach for ST's API at the moment (the only things that look possible are the code folding and mousemap stuff) but I know Jon's working on an update and I can only speculate as to the future. So hopefully we can see plugins like this soon.
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: Xiki Support in Sublime (With Incentive)

Postby trogdoro on Sun Sep 09, 2012 4:54 am

> would *love* to see it in Sublime Text

Awesome!

> curious to hear if this is even possible, given Sublime's API

I haven't looked into Sublime's API yet but I've heard it's pretty decent. Xiki has kind of an insane number of features that do all kinds of disparate things. It might be helpful to scope a first version to, for example, the stuff shown in the "Can your shell console do this?" screencast:

http://www.youtube.com/watch?v=bUR_eUVc ... r_embedded

Most of the hard work for what's in the screencast can be handled by the 'xiki' shell command that gets installed when you "gem install xiki". For example, you can have ruby code invoke the shell command "xiki tables" and then just dump the text that is returned straight into the Sublime window.

There'd primarily be one keyboard shortcut (does Command+enter or Control-enter currently do something in Sublime?) that would need to pass control to a Sublime Xiki plugin. Also, for files that have a ".notes" extension, when the user double-clicked anywhere control would need to be passed to the plugin. Once the ruby code for the plugin had control, it would need to be able to:

- know where the cursor is
- read, delete, and insert at arbitrary parts of the text in the Sublime window
- prompt the user to enter text
- read one character of input at a time from the user
- without giving up control

The plugin would grab the line from the Sublime window (and possibly some surrounding text), pass it to the 'xiki' shell command, and insert the results into the Sublime window (indented 2 spaces deeper). Then it would prompt for characters from the user to implement the incremental search. (It would delete the text and insert a filtered-down version for each character a user typed).

Once that were achieved, Sublime users would be able to add a "foo.rb" file to their ~/menu/ dir. Then they could type "foo" on any line and double-click on it (etc.) to activate it and browse its menus. This would allow creation of plugins in just a few lines of code, which could do a pretty decent job of accessing and controlling external tools / apps, so long as nothing graphical were required in the UI itself.

The coloring is optional, but I'm guessing since sublime can colorize many different formats, this wouldn't be an issue.

--Craig
trogdoro
 
Posts: 2
Joined: Sun Sep 09, 2012 4:02 am

Re: Xiki Support in Sublime (With Incentive)

Postby lunixbochs on Thu Sep 13, 2012 11:22 am

This is all possible with the current Sublime APIs. I've started a plugin at https://github.com/lunixbochs/SublimeXiki

This is a real Xiki instance with my (very much WIP) plugin:

Image

All I ask of Jon is a way to properly use contexts for mouse events (the same way they work on keys), because hooking double-click right now will break your normal double click (even if I tell it to use a context).
lunixbochs
 
Posts: 91
Joined: Fri Oct 08, 2010 10:18 pm

Re: Xiki Support in Sublime (With Incentive)

Postby trishume on Thu Sep 13, 2012 6:33 pm

That looks pretty awesome lunixbochs.
I am interested in working on this plugin as I love the idea of Xiki I just don't like Emacs and love Sublime Text.

I'm interested in helping out with your plugin. I might try and make a syntax mode to highlight Xiki notes.
After that is done your trick of the "xiki" view setting could be replaced by checking for the Xiki syntax mode.
trishume
 
Posts: 6
Joined: Thu Jan 26, 2012 3:59 pm

Re: Xiki Support in Sublime (With Incentive)

Postby trogdoro on Fri Sep 14, 2012 7:19 am

Nice!

Should probably stick to indenting by 2 spaces though.
trogdoro
 
Posts: 2
Joined: Sun Sep 09, 2012 4:02 am

Re: Xiki Support in Sublime (With Incentive)

Postby lunixbochs on Fri Sep 14, 2012 8:54 am

Now using two spaces, and including basic command line support:
Image
New directory support:
Image
lunixbochs
 
Posts: 91
Joined: Fri Oct 08, 2010 10:18 pm

Re: Xiki Support in Sublime (With Incentive)

Postby sublimator on Tue Sep 18, 2012 9:41 am

No $500 for lunixbochs ?
It is better to remain silent and be thought a fool, than to speak out and remove all doubt
sublimator
 
Posts: 649
Joined: Thu Mar 20, 2008 5:41 am

Re: Xiki Support in Sublime (With Incentive)

Postby lunixbochs on Wed Sep 19, 2012 1:31 am

Tons of updates (including a couple of original features). The best/fastest place to follow my progress is still the respository: https://github.com/lunixbochs/SublimeXiki

Commands with more than 24 lines of output will have their output folded continuously.
There's also a syntax mode now.

Image

Commands are now executed asynchronously from the editor, with the output streamed back to Sublime smoothly. My use case for this was `git push` and friends, which previously froze the editor and got killed by my timeout in `communicate()`.

This means you can do something obnoxious like `find /` and it won't freeze your editor (though that much output might eventually slow it down a bit :P).

Image

The highlight means a command is still running. If you cmd+enter invoke a running command before it finishes, it will kill the process.
lunixbochs
 
Posts: 91
Joined: Fri Oct 08, 2010 10:18 pm

Next

Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 6 guests