import { RecordedTestVisualizer, RecordedTestVisualizerOptions, RecordedTestVisualizerProvider } from "@site/src/docs/components/RecordedTestVisualizer"; import recordedTests from "./fixtures/basic-coding.json";
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"
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"
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"
Now let's try applying a Cursorless action to the current line: "dedent this"
Code reuse is a fact of life as a programmer. Cursorless makes this easy with the "bring" command: "bring state urge"
"bring" also works with two targets just like "swap": "bring blue cap to value red"
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"
We introduced a lot of different scopes today. If you're anything like us, you've already forgotten them all.
The important thing to remember is that you can always say "cursorless help" to see a list.
That wraps up the Basic coding tutorial. Happy coding 😊.