-
-
Notifications
You must be signed in to change notification settings - Fork 85
What's next
Cursorless's major direction can be summed up as follows:
Cursorless will become a spoken programming language enabling large-scale, structurally aware voice-controlled code generation and refactoring.
This direction will enable levels of efficiency that aren't possible using today's keyboard-driven interfaces. Let's break down each component of the above statement.
There's two aspects here: one is "programming language", and the second is "spoken ... language". Let's take each in turn
Today's cursorless grammar will become a full-fledged programming language inspired by jq. In the same way that jq enables powerful one-liners, which can easily grow into longer programs, we'd like cursorless commands to function like powerful "spoken one-liners", but also be chained into larger scale "spoken programs" that can transform your code in semantically rich ways by leveraging cursorless's deep integration with tree-sitter and vscode.
Today, cursorless targets are flat, enabling only a single modifier to be applied to a given mark, eg "funk air"
. We intend to make cursorless modifiers fully compositional, so that they can be joined into long chains. Examples include:
"first line [in] every funk"
"every string [in] block"
"first past fourth char [of] funk name"
-
"bring every reference to air as list"
(for creating a mark down list of every reference to a particular symbol)
In addition to these inline chained targets, the targets can be stored in an intermediate form to enable even longer chains than can be uttered in a single command, either by using an enhanced that
mark for impromptu chains, or by bookmarking intermediate steps of a chain, or even by bookmarking the chain itself as a reusable pipeline component.
See the tracker project for more info.
Because cursorless is spoken, there is the opportunity for users to speak in long continuous sentences, rather than short, choppy commands. Although it is possible to issue fairly long phrases today, there are still limitations due to the way that cursorless handles its targets today. A great example of this limitation is described in #414. The best way to understand the type of limitations that exist today and how we plan to address them is to take a look at the tracker project.
Beyond just removing technical limitations, an important aspect of attaining fluency is education. The learning curve for cursorless can be quite daunting, so we have several efforts underway to enable new users to get up to speed much faster, and existing users to rapidly improve fluency. In particular, the cursorless tutorial will give users hands-on experience editing real code and text using cursorless, and our regular videos will also help users see cursorless in action and understand new features and concepts.
There are two primary ways in which cursorless will be able to perform large-scale transformations.
One of the great ironies with cursorless is that it is most powerful when used with multiple cursors. Using multiple cursors without cursorless can be like herding cats. The problem is that the operations supported by your editor are often too low level to work correctly at each cursor. For example let's say I have three strings on my clipboard, and I want them to replace each of the following strings:
a = "hello world";
b = "high";
c = "I am a big old string";
Assuming I have a cursor in each string, with cursorless I can just say "paste to string"
.
We'd like to expand this power further by introducing new scope types and actions, as well as expanding support for operations that are specifically targeted at multiple cursor manipulation.
Check out the tracker project for more details
We'd also like to extend the powers of cursorless beyond operations within a single file. One of our inspirations for this type of operation is Plop, a "micro-generator framework" that allows parametrized operations across multiple files. The bookmarks described above could be stitched together into a combined bookmark that spans multiple files. Each component of the combined bookmark can indicate how new items are inserted using a stable snippet with smart holes.
For example, notice how much boilerplate is needed to add a cursorless hat color.
- new scope types project
- snippets with holes like agda
- snippets enabling constructive
- plopjs thing