Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cursorless-talon/src/cursorless.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def private_cursorless_show_command_statistics():
def private_cursorless_start_tutorial():
"""Start the introductory Cursorless tutorial"""
actions.user.private_cursorless_run_rpc_command_no_wait(
"cursorless.tutorial.start", "1-introduction"
"cursorless.tutorial.start", "introduction"
)

def private_cursorless_tutorial_next():
Expand Down
4 changes: 2 additions & 2 deletions packages/app-web-docs/src/docs/user/tutorial/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ To follow along interactively, focus VS Code and say `"cursorless tutorial"`.

## 1. Introduction

[Start Introduction](./1-introduction.mdx) - This tutorial will teach you the basics of Cursorless.
[Start Introduction](./introduction.mdx) - This tutorial will teach you the basics of Cursorless.
Comment thread
AndreasArvidsson marked this conversation as resolved.

## 2. Basic coding

[Start Basic coding](./2-basic-coding.mdx) - This tutorial will teach you the basics of coding with Cursorless.
[Start Basic coding](./basic-coding.mdx) - This tutorial will teach you the basics of coding with Cursorless.

## Use the interactive tutorial

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RecordedTestVisualizer, RecordedTestVisualizerOptions, RecordedTestVisualizerProvider } from "@site/src/docs/components/RecordedTestVisualizer";
import recordedTests from "./fixtures/2-basic-coding.json";
import recordedTests from "./fixtures/basic-coding.json";

# 2. Basic coding

Expand All @@ -13,47 +13,47 @@ This tutorial will teach you the basics of coding with Cursorless.

When editing code, we often think in terms of statements, functions, etc. Let's clone a statement: `"clone state sit"`

<RecordedTestVisualizer fixtureName="tutorial/2-basic-coding/cloneStateInk" />
<RecordedTestVisualizer fixtureName="tutorial/basic-coding/cloneStateInk" />

## Step 2

Cursorless tries its best to keep your commands short.

In the following command, we just say "string" once, but Cursorless infers that both targets are strings: `"swap string air with whale"`

<RecordedTestVisualizer fixtureName="tutorial/2-basic-coding/swapStringAirWithWhale" />
<RecordedTestVisualizer fixtureName="tutorial/basic-coding/swapStringAirWithWhale" />

## Step 3

Great. Let's learn a new action. The "pour" action lets you start editing a new line below any line on your screen: `"pour urge"`

<RecordedTestVisualizer fixtureName="tutorial/2-basic-coding/pourUrge" />
<RecordedTestVisualizer fixtureName="tutorial/basic-coding/pourUrge" />

## Step 4

Now let's try applying a Cursorless action to the current line: `"dedent this"`

<RecordedTestVisualizer fixtureName="tutorial/2-basic-coding/dedentThis" />
<RecordedTestVisualizer fixtureName="tutorial/basic-coding/dedentThis" />

## Step 5

Code reuse is a fact of life as a programmer. Cursorless makes this easy with the "bring" command: `"bring state urge"`

<RecordedTestVisualizer fixtureName="tutorial/2-basic-coding/bringStateUrge" />
<RecordedTestVisualizer fixtureName="tutorial/basic-coding/bringStateUrge" />

## Step 6

"bring" also works with two targets just like "swap": `"bring blue cap to value red"`

<RecordedTestVisualizer fixtureName="tutorial/2-basic-coding/bringBlueCapToValueRisk" />
<RecordedTestVisualizer fixtureName="tutorial/basic-coding/bringBlueCapToValueRisk" />

## Step 7

Cursorless tries its best to use its knowledge of programming languages to leave you with syntactically valid code.

Note how it cleans up the comma here: `"chuck arg blue vest"`

<RecordedTestVisualizer fixtureName="tutorial/2-basic-coding/chuckArgueBlueVest" />
<RecordedTestVisualizer fixtureName="tutorial/basic-coding/chuckArgueBlueVest" />

## Step 8

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"path": "tutorial/2-basic-coding/cloneStateInk.yml",
"name": "tutorial/2-basic-coding/cloneStateInk",
"path": "tutorial/basic-coding/cloneStateInk.yml",
"name": "tutorial/basic-coding/cloneStateInk",
"fixture": {
"languageId": "python",
"command": {
Expand Down Expand Up @@ -1547,8 +1547,8 @@
}
},
{
"path": "tutorial/2-basic-coding/swapStringAirWithWhale.yml",
"name": "tutorial/2-basic-coding/swapStringAirWithWhale",
"path": "tutorial/basic-coding/swapStringAirWithWhale.yml",
"name": "tutorial/basic-coding/swapStringAirWithWhale",
"fixture": {
"languageId": "python",
"command": {
Expand Down Expand Up @@ -3211,8 +3211,8 @@
}
},
{
"path": "tutorial/2-basic-coding/pourUrge.yml",
"name": "tutorial/2-basic-coding/pourUrge",
"path": "tutorial/basic-coding/pourUrge.yml",
"name": "tutorial/basic-coding/pourUrge",
"fixture": {
"languageId": "python",
"command": {
Expand Down Expand Up @@ -4848,8 +4848,8 @@
}
},
{
"path": "tutorial/2-basic-coding/dedentThis.yml",
"name": "tutorial/2-basic-coding/dedentThis",
"path": "tutorial/basic-coding/dedentThis.yml",
"name": "tutorial/basic-coding/dedentThis",
"fixture": {
"languageId": "python",
"command": {
Expand Down Expand Up @@ -6472,8 +6472,8 @@
}
},
{
"path": "tutorial/2-basic-coding/bringStateUrge.yml",
"name": "tutorial/2-basic-coding/bringStateUrge",
"path": "tutorial/basic-coding/bringStateUrge.yml",
"name": "tutorial/basic-coding/bringStateUrge",
"fixture": {
"languageId": "python",
"command": {
Expand Down Expand Up @@ -8148,8 +8148,8 @@
}
},
{
"path": "tutorial/2-basic-coding/bringBlueCapToValueRisk.yml",
"name": "tutorial/2-basic-coding/bringBlueCapToValueRisk",
"path": "tutorial/basic-coding/bringBlueCapToValueRisk.yml",
"name": "tutorial/basic-coding/bringBlueCapToValueRisk",
"fixture": {
"languageId": "python",
"command": {
Expand Down Expand Up @@ -9871,8 +9871,8 @@
}
},
{
"path": "tutorial/2-basic-coding/chuckArgueBlueVest.yml",
"name": "tutorial/2-basic-coding/chuckArgueBlueVest",
"path": "tutorial/basic-coding/chuckArgueBlueVest.yml",
"name": "tutorial/basic-coding/chuckArgueBlueVest",
"fixture": {
"languageId": "python",
"command": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"path": "tutorial/1-introduction/takeCap.yml",
"name": "tutorial/1-introduction/takeCap",
"path": "tutorial/introduction/takeCap.yml",
"name": "tutorial/introduction/takeCap",
"fixture": {
"languageId": "plaintext",
"command": {
Expand Down Expand Up @@ -629,8 +629,8 @@
}
},
{
"path": "tutorial/1-introduction/takeBlueSun.yml",
"name": "tutorial/1-introduction/takeBlueSun",
"path": "tutorial/introduction/takeBlueSun.yml",
"name": "tutorial/introduction/takeBlueSun",
"fixture": {
"languageId": "plaintext",
"command": {
Expand Down Expand Up @@ -1258,8 +1258,8 @@
}
},
{
"path": "tutorial/1-introduction/takeHarpPastDrum.yml",
"name": "tutorial/1-introduction/takeHarpPastDrum",
"path": "tutorial/introduction/takeHarpPastDrum.yml",
"name": "tutorial/introduction/takeHarpPastDrum",
"fixture": {
"languageId": "plaintext",
"command": {
Expand Down Expand Up @@ -1910,8 +1910,8 @@
}
},
{
"path": "tutorial/1-introduction/takeNearAndSun.yml",
"name": "tutorial/1-introduction/takeNearAndSun",
"path": "tutorial/introduction/takeNearAndSun.yml",
"name": "tutorial/introduction/takeNearAndSun",
"fixture": {
"languageId": "plaintext",
"command": {
Expand Down Expand Up @@ -2572,8 +2572,8 @@
}
},
{
"path": "tutorial/1-introduction/chuckTrap.yml",
"name": "tutorial/1-introduction/chuckTrap",
"path": "tutorial/introduction/chuckTrap.yml",
"name": "tutorial/introduction/chuckTrap",
"fixture": {
"languageId": "plaintext",
"command": {
Expand Down Expand Up @@ -3207,8 +3207,8 @@
}
},
{
"path": "tutorial/1-introduction/chuckLineOdd.yml",
"name": "tutorial/1-introduction/chuckLineOdd",
"path": "tutorial/introduction/chuckLineOdd.yml",
"name": "tutorial/introduction/chuckLineOdd",
"fixture": {
"languageId": "plaintext",
"command": {
Expand Down Expand Up @@ -3752,8 +3752,8 @@
}
},
{
"path": "tutorial/1-introduction/takeLine.yml",
"name": "tutorial/1-introduction/takeLine",
"path": "tutorial/introduction/takeLine.yml",
"name": "tutorial/introduction/takeLine",
"fixture": {
"languageId": "plaintext",
"command": {
Expand Down Expand Up @@ -4187,8 +4187,8 @@
}
},
{
"path": "tutorial/1-introduction/preUrge.yml",
"name": "tutorial/1-introduction/preUrge",
"path": "tutorial/introduction/preUrge.yml",
"name": "tutorial/introduction/preUrge",
"fixture": {
"languageId": "plaintext",
"command": {
Expand Down Expand Up @@ -4620,8 +4620,8 @@
}
},
{
"path": "tutorial/1-introduction/postAir.yml",
"name": "tutorial/1-introduction/postAir",
"path": "tutorial/introduction/postAir.yml",
"name": "tutorial/introduction/postAir",
"fixture": {
"languageId": "plaintext",
"command": {
Expand Down Expand Up @@ -5053,8 +5053,8 @@
}
},
{
"path": "tutorial/1-introduction/changeSit.yml",
"name": "tutorial/1-introduction/changeSit",
"path": "tutorial/introduction/changeSit.yml",
"name": "tutorial/introduction/changeSit",
"fixture": {
"languageId": "plaintext",
"command": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RecordedTestVisualizer, RecordedTestVisualizerOptions, RecordedTestVisualizerProvider } from "@site/src/docs/components/RecordedTestVisualizer";
import recordedTests from "./fixtures/1-introduction.json";
import recordedTests from "./fixtures/introduction.json";

# 1. Introduction

Expand All @@ -13,69 +13,69 @@ This tutorial will teach you the basics of Cursorless.

Say `"take cap"`

<RecordedTestVisualizer fixtureName="tutorial/1-introduction/takeCap" />
<RecordedTestVisualizer fixtureName="tutorial/introduction/takeCap" />

## Step 2

Well done! 🙌 You just used the code word for 'c', "cap", to refer to the word with a gray hat over the 'c'.

When a hat is not gray, we say its color: say `"take blue sun"`

<RecordedTestVisualizer fixtureName="tutorial/1-introduction/takeBlueSun" />
<RecordedTestVisualizer fixtureName="tutorial/introduction/takeBlueSun" />

## Step 3

Selecting a single token is great, but often we need something bigger.

Say `"take harp past drum"` to select a range.

<RecordedTestVisualizer fixtureName="tutorial/1-introduction/takeHarpPastDrum" />
<RecordedTestVisualizer fixtureName="tutorial/introduction/takeHarpPastDrum" />

## Step 4

Despite its name, one of the most powerful aspects of Cursorless is the ability to use more than one cursor.

Let's try that: `"take near and sun"`

<RecordedTestVisualizer fixtureName="tutorial/1-introduction/takeNearAndSun" />
<RecordedTestVisualizer fixtureName="tutorial/introduction/takeNearAndSun" />

## Step 5

But let's show that Cursorless can live up to its name: we can say `"chuck trap"` to delete a word without ever moving our cursor.

<RecordedTestVisualizer fixtureName="tutorial/1-introduction/chuckTrap" />
<RecordedTestVisualizer fixtureName="tutorial/introduction/chuckTrap" />

## Step 6

Tokens are great, but they're just one way to think of a document.

Let's try working with lines: `"chuck line odd"`

<RecordedTestVisualizer fixtureName="tutorial/1-introduction/chuckLineOdd" />
<RecordedTestVisualizer fixtureName="tutorial/introduction/chuckLineOdd" />

## Step 7

We can also use "line" to refer to the line containing our cursor: `"take line"`

<RecordedTestVisualizer fixtureName="tutorial/1-introduction/takeLine" />
<RecordedTestVisualizer fixtureName="tutorial/introduction/takeLine" />

## Step 8

You now know how to select and delete; let's give you a couple more actions to play with: say "pre" to place the cursor before a target, as in `"pre urge"`

<RecordedTestVisualizer fixtureName="tutorial/1-introduction/preUrge" />
<RecordedTestVisualizer fixtureName="tutorial/introduction/preUrge" />

## Step 9

Say "post" to place the cursor after a target: `"post air"`

<RecordedTestVisualizer fixtureName="tutorial/1-introduction/postAir" />
<RecordedTestVisualizer fixtureName="tutorial/introduction/postAir" />

## Step 10

Say "change" to delete a word and move your cursor to where it used to be: `"change sit"`

<RecordedTestVisualizer fixtureName="tutorial/1-introduction/changeSit" />
<RecordedTestVisualizer fixtureName="tutorial/introduction/changeSit" />

## Step 11

Expand All @@ -85,4 +85,4 @@ And that wraps up unit 1 of the Cursorless tutorial! Next time, we'll write some

## Next tutorial: 2. Basic coding

[Continue to Basic coding](./2-basic-coding.mdx) - This tutorial will teach you the basics of coding with Cursorless.
[Continue to Basic coding](./basic-coding.mdx) - This tutorial will teach you the basics of coding with Cursorless.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { RawTutorialContent } from "./tutorial.types";

export const tutorial2BasicCoding: RawTutorialContent = {
id: "2-basic-coding",
export const tutorialBasicCoding: RawTutorialContent = {
id: "basic-coding",
title: "Basic coding",
description:
"This tutorial will teach you the basics of coding with Cursorless.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import type { RawTutorialContent } from "./tutorial.types";
const wrapsUp =
"And that wraps up unit 1 of the Cursorless tutorial! Next time, we'll write some code 🙌.";

export const tutorial1Introduction: RawTutorialContent = {
id: "1-introduction",
export const tutorialIntroduction: RawTutorialContent = {
id: "introduction",
Comment thread
AndreasArvidsson marked this conversation as resolved.
title: "Introduction",
description: "This tutorial will teach you the basics of Cursorless.",
steps: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { RawTutorialContent } from "./tutorial.types";

export const tutorial3Visualization: RawTutorialContent = {
id: "3-visualization",
export const tutorialVisualization: RawTutorialContent = {
id: "visualization",
title: "Visualization",
description:
"This tutorial will teach you how to visualize different scopes in Cursorless.",
Expand Down
Loading
Loading