Over the past weeks I’ve written about Zed, my experimental code editor project. I explained why I started the project, why it’s a Chrome app and explained some of its design choices. Those who couldn’t wait, probably found the project already (it has been on github all along). Now it includes some basic installation instructions. You can download Zed from Github. Getting it setup may be a bit more involved than your average editor, because you need to run a WebFS server.
WebFS is a super simple RESTful protocol that I came up with, consider it a super lightweight version of WebDAV, without the XML. It is documented here. What it does is expose a file system via HTTP, supporting PUT for storing a file, GET for retrieving a file, OPTIONS for getting file metadata (currently just an ETag, used for file watching) and DELETE for deleting a file. The protocol is as simple as can be, the Python implementation is just 128 lines of code. So why does Zed need WebFS? In a previous post I explained that Chrome’s APIs do not support free access the the local file system (yet). You can open individual files via a file picker, and with a bit of effort even get write access to a bunch of them, but creating new files in a directory in the user’s file system is not supported. WebFS is a way to work around this problem, but also is a natural fit for the grander vision of moving your development environment “to the cloud”. Since Zed communicates with a WebFS server via HTTP, that server may live locally or remotely. This is a key feature to me, because I often want to edit file systems running inside a VM or remote. Zed with WebFS support that easily and efficiently. Zed comes with a PHP, Python and now node.js implementation of WebFS. The PHP version supports authentication via BasicAuth, the Python and node.js version does not yet, but that should be easy to add. Reimplementing WebFS in any other language should be easy, send me a pull request if you do.
The project’s README contains basic installation instructions. Once you get the application running, you’ll notice that there’s two projects already created:
Settings this is where you change Zed’s settings. As described in a previous post, Zed has a special settings file system. It loads its base settings from the app/settings directory, and stores anything you put in user.json files in Chrome’s sync storage. For instance the default key bindings are here, and you can override them by editing /keys.user.json.
Manual this is a read only project that eventually will contain more documentation about the editor. It retrieves its files from app/manual, which is just a bunch of Markdown files, you navigate it either using the usual Cmd-E/Ctrl-E or by moving your cursor to a file name and pressing Cmd-Shift-E/Ctrl-Shift-E to jump to the file. As the README describes, you create a new project by just typing its name and pressing Return, you will then be asked for the WebFS endpoint you’d like to mount.
This is alpha software Don’t sue me if it breaks. Please report issues in the issue tracker, or fix them yourself and create a pull request, it’s open source software after all. Also, if you create plugins for languages not already supported, please create a pull request.