Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
bryphe committed Jun 22, 2018
2 parents 5a68ac0 + 6ea66d9 commit 0278c63
Show file tree
Hide file tree
Showing 10 changed files with 240 additions and 86 deletions.
10 changes: 8 additions & 2 deletions browser/src/Services/Learning/Tutorial/Notes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ export const UKey = (): JSX.Element => {
return <KeyWithDescription keyCharacter="u" description={<span>Undo a single change</span>} />
}

export const RedoKey = (): JSX.Element => {
return (
<KeyWithDescription keyCharacter="Ctrl-r" description={<span>Redo a single undo</span>} />
)
}

export const GGKey = (): JSX.Element => {
return (
<KeyWithDescription
Expand Down Expand Up @@ -233,7 +239,7 @@ export const DeleteOperatorKey = (): JSX.Element => {
keyCharacter="d"
description={
<span>
<Bold>+ motion</Bold>: Deletes text specified by a `motion`. Examples:
<Bold>+ motion</Bold>: Deletes text specified by a `motion`
</span>
}
/>
Expand Down Expand Up @@ -278,7 +284,7 @@ export const ChangeOperatorKey = (): JSX.Element => {
keyCharacter="c"
description={
<span>
<Bold>+ motion</Bold>: Change text specified by a `motion`. Examples:
<Bold>+ motion</Bold>: Change text specified by a `motion`
</span>
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,21 @@ export class BeginningsAndEndingsTutorial implements ITutorial {
new Stages.MoveToGoalStage("Use '0' to move to the BEGINNING of the line", 1, 0),
new Stages.SetBufferStage([Line1, Line2, Line3]),
new Stages.MoveToGoalStage("Use `j` to move down to the next line", 2),
new Stages.MoveToGoalStage("Use '_' to move to the FIRST CHARACTER", 2, 4),
new Stages.MoveToGoalStage(
"Use '_' to move to the FIRST NON-WHITESPACE CHARACTER",
2,
4,
),
new Stages.MoveToGoalStage(
"Use '$' to move to the END of the line",
2,
Line3.length - 1,
),
new Stages.MoveToGoalStage("Use '_' to move to the FIRST CHARACTER", 2, 4),
new Stages.MoveToGoalStage(
"Use '_' to move to the FIRST NON-WHITESPACE CHARACTER",
2,
4,
),
new Stages.MoveToGoalStage("Use '0' to move to the BEGINNING of the line", 2, 0),
new Stages.MoveToGoalStage(
"Use '$' to move to the END of the line",
Expand All @@ -53,9 +61,9 @@ export class BeginningsAndEndingsTutorial implements ITutorial {
public get metadata(): ITutorialMetadata {
return {
id: "oni.tutorials.beginnings_and_endings",
name: "Motion: _, 0, $",
name: "Start/End Motion: _, 0, $",
description:
"You don't need to keep hitting `w` or `b` when you need to go all the way to the beginning or the end of a line. You can use the `0` key to move to the very beginning a line, and `$` to move to the end. Also, `_` moves to the first character in the line, which is often more convenient than `0`.",
"You don't need to keep hitting `w` or `b` when you need to go all the way to the beginning or the end of a line. You can use the `0` key to move to the very beginning a line, and `$` to move to the end. Also, `_` moves to the first non-whitespace character in the line, which is often more convenient than `0`.",
level: 140,
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@ const Line3c = "--> using the `dk` command."
const Line2d = "--> The delete operator works with other motions, too."
const Line3d = "--> Let's try out `dw` - delete word. Delete the duplicate words below:"
const Line4d = "--> Help delete the duplicate duplicate words."
const Line4dCorrect = "--> Help delete the duplicate words."
const Line4dCorrecta = "--> Help delete the duplicate words."
const Line4dCorrectb = "--> Help delete the words."

const Line2e = "--> `d` followed by any motion will delete to that destination"
const Line3e = "--> This can allow for more precision when there aren't simple boundaries"
const Line4e = "--> public void somethingsomething(arg1, arg2, extra1, extra2)"
const Line4eCorrecta = "--> public void something(arg1, arg2, extra1, extra2)"
const Line4eCorrectb = "--> public void something(arg1, arg2)"

export class DeleteOperatorTutorial implements ITutorial {
private _stages: ITutorialStage[]
Expand Down Expand Up @@ -74,7 +81,31 @@ export class DeleteOperatorTutorial implements ITutorial {
Stages.combine(
"Delete the duplicate word with 'dw'",
new Stages.DeleteCharactersStage(null, 3, 20, "duplicate"),
new Stages.WaitForStateStage(null, [Line1, Line2d, Line3d, Line4dCorrect]),
new Stages.WaitForStateStage(null, [Line1, Line2d, Line3d, Line4dCorrecta]),
),
Stages.combine(
"Delete the word again with 'dw'",
new Stages.DeleteCharactersStage(null, 3, 20, "duplicate"),
new Stages.WaitForStateStage(null, [Line1, Line2d, Line3d, Line4dCorrectb]),
),
Stages.combine(
null,
new Stages.FadeInLineStage(null, 1, Line2e),
new Stages.FadeInLineStage(null, 2, Line3e),
new Stages.FadeInLineStage(null, 3, Line4e),
new Stages.SetBufferStage([Line1, Line2e, Line3e, Line4e]),
),
new Stages.MoveToGoalStage("Move to the goal marker", 3, 16),
Stages.combine(
"Use 'dts' to delete to the next 's'",
new Stages.DeleteCharactersStage(null, 3, 16, "something"),
new Stages.WaitForStateStage(null, [Line1, Line2e, Line3e, Line4eCorrecta]),
),
new Stages.MoveToGoalStage("Move to the goal marker", 3, 36),
Stages.combine(
"Use 'dt)' to delete to the ')'",
new Stages.DeleteCharactersStage(null, 3, 36, ", extra1, extra2"),
new Stages.WaitForStateStage(null, [Line1, Line2e, Line3e, Line4eCorrectb]),
),
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,72 @@ export class InlineFindingTutorial implements ITutorial {
constructor() {
this._stages = [
new Stages.SetBufferStage([Line1]),
new Stages.MoveToGoalStage("Move to the 'n' in 'next' using 'fn'", 0, 23),
new Stages.MoveToGoalStage("Move to the nearest 'n' using 'fn'", 0, 23),
new Stages.MoveToGoalStage("Move to the nearest 'a' using 'fa'", 0, 42),
new Stages.SetBufferStage([Line1, Line2]),
new Stages.MoveToGoalStage("Use 'j' to move down a line", 1, 23),
new Stages.MoveToGoalStage("Use 'F' to move LEFT to the goal", 1, 15),
new Stages.MoveToGoalStage("Move down a line", 1, 42),
new Stages.MoveToGoalStage("Use 'Fm' to move BACKWARDS to the nearest 'm'", 1, 15),
new Stages.MoveToGoalStage("Use 'Fs' to move BACKWARDS to the nearest 's'", 1, 5),
new Stages.SetBufferStage([Line1, Line2, Line3]),
new Stages.MoveToGoalStage("Use 'j' to move down a line", 2, 15),
new Stages.MoveToGoalStage("Move to the character before 'b' using 'tb'", 2, 43),
new Stages.MoveToGoalStage("Move down a line", 2, 5),
new Stages.MoveToGoalStage("Use 'tx' to move to the character before 'x'", 2, 16),
new Stages.MoveToGoalStage("Use 'tb' to move to the character before 'b'", 2, 43),
new Stages.SetBufferStage([Line1, Line2, Line3, Line4]),
new Stages.MoveToGoalStage("Use 'j' to move down a line", 3, 43),
new Stages.MoveToGoalStage("Use 'T' to move to the goal", 3, 12),
new Stages.MoveToGoalStage("Move down a line", 3, 43),
new Stages.MoveToGoalStage(
"Use 'Tx' to move BACKWARDS to the character before 'x'",
3,
22,
),
new Stages.MoveToGoalStage(
"Use 'Tl' to move BACKWARDS to the character before 'l'",
3,
12,
),
new Stages.SetBufferStage([Line1, Line2, Line3, Line4, Line5]),
new Stages.MoveToGoalStage("Use 'j' to move down a line", 4, 12),
new Stages.MoveToGoalStage("Use 'f' to move to the goal", 4, 24),
new Stages.MoveToGoalStage("Use ';' to move to the goal", 4, 34),
new Stages.MoveToGoalStage("Use ';' to move to the goal", 4, 36),
new Stages.MoveToGoalStage("Use ';' to move to the goal", 4, 42),
new Stages.MoveToGoalStage("Move down a line", 4, 12),
new Stages.MoveToGoalStage("Use 'fe' to move to the nearest 'e'", 4, 24),
new Stages.MoveToGoalStage("Use ';' to move to the next instance of 'e'", 4, 34),
new Stages.MoveToGoalStage("Use ';' to move to the next instance of 'e'", 4, 36),
new Stages.MoveToGoalStage("Use ';' to move to the next instance of 'e'", 4, 42),
new Stages.SetBufferStage([Line1, Line2, Line3, Line4, Line5, Line6]),
new Stages.MoveToGoalStage("Use 'j' to move down a line", 5, 42),
new Stages.MoveToGoalStage("Use ',' to move to the goal", 5, 24),
new Stages.MoveToGoalStage("Use ',' to move to the goal", 5, 18),
new Stages.MoveToGoalStage("Use ',' to move to the goal", 5, 16),
new Stages.MoveToGoalStage("Use ',' to move to the goal", 5, 6),
new Stages.MoveToGoalStage("Move down a line", 5, 42),
new Stages.MoveToGoalStage("Use ',' to move to the previous instance of 'e'", 5, 24),
new Stages.MoveToGoalStage("Use ',' to move to the previous instance of 'e'", 5, 18),
new Stages.MoveToGoalStage("Use ',' to move to the previous instance of 'e'", 5, 16),
new Stages.MoveToGoalStage("Use ',' to move to the previous instance of 'e'", 5, 6),
new Stages.MoveToGoalStage("Move up a line", 4, 6),
new Stages.MoveToGoalStage("Use 'te' to move before the nearest 'e'", 4, 23),
new Stages.MoveToGoalStage("Use ';' to move before the next instance of 'e'", 4, 33),
new Stages.MoveToGoalStage("Use ';' to move before the next instance of 'e'", 4, 35),
new Stages.MoveToGoalStage("Use ';' to move before the next instance of 'e'", 4, 41),
new Stages.SetBufferStage([Line1, Line2, Line3, Line4, Line5, Line6]),
new Stages.MoveToGoalStage("Move down a line", 5, 41),
new Stages.MoveToGoalStage(
"Use ',' to move before the previous instance of 'e'",
5,
25,
),
new Stages.MoveToGoalStage(
"Use ',' to move before the previous instance of 'e'",
5,
19,
),
new Stages.MoveToGoalStage(
"Use ',' to move before the previous instance of 'e'",
5,
17,
),
new Stages.MoveToGoalStage("Use ',' to move before the previous instance of 'e'", 5, 7),
]
}

public get metadata(): ITutorialMetadata {
return {
id: "oni.tutorials.inline_finding",
name: "Motion: f, F, t, T",
name: "Character Find Motion: f, F, t, T",
description:
"Sometimes you need to move faster than 'h' and 'l' allow you to but need more control than 'w', 'e', and 'b', especially when using different operators. 'f' moves to a specific character to the right of the cursor, 'F' moves to a specific character to the left, and ';' and ',' allow you to repeat these motions in different directions.",
"Sometimes you need to move faster than 'h' and 'l' allow but need more control than 'w', 'e', and 'b', especially when using the operators you'll learn later. 'f' followed by any character moves to the next instance of that character, 'F' followed by any character moves backwards to the next instance of that character. Similarly, 't' and 'T' move forwards and backwards up to (but not on) the specified character. After performing a 'f', 'F', 't', or 'T' operation ';' and ',' allow you to repeat those motions in different directions.",
level: 145,
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* InsertAndUndoTutorial.tsx
*
* Tutorial that brings together moving and inserting
* Tutorial for undo and redo before we learn destructive changes
*/

import * as React from "react"
Expand Down Expand Up @@ -64,15 +64,39 @@ export class InsertAndUndoTutorial implements ITutorial {
"There is some text msing this .",
TutorialLine1Correct,
]),
new Stages.WaitForStateStage("Press 'u' to undo yet another change", [
"There is text msing this .",
TutorialLine1Correct,
]),
new Stages.WaitForStateStage("Press 'Ctrl+r' to redo the last undo", [
"There is some text msing this .",
TutorialLine1Correct,
]),
new Stages.WaitForStateStage("Press 'Ctrl+r' to redo the next undo", [
"There is some text missing this .",
TutorialLine1Correct,
]),
new Stages.WaitForStateStage("Press 'Ctrl+r' to redo yet another undo", [
"There is some text missing from this .",
TutorialLine1Correct,
]),
new Stages.WaitForStateStage("Press 'Ctrl+r' to redo yet another undo", [
"There is some text missing from this line.",
TutorialLine1Correct,
]),
new Stages.WaitForStateStage("Press 'u' to undo the last change", [
"There is some text missing from this .",
TutorialLine1Correct,
]),
]
}

public get metadata(): ITutorialMetadata {
return {
id: "oni.tutorial.insert_and_undo",
name: "Insert and Undo",
id: "oni.tutorial.undo_and_redo",
name: "Undo and Redo",
description:
"It's important to be able to switch between normal and insert mode, in order to edit text! Let's put together the cursor motion and insert mode from the previous tutorials. If you make any mistakes, you can undo inserted text with 'u'.",
"It's important to be able to switch between normal and insert mode, in order to edit text! Let's put together the cursor motion and insert mode from the previous tutorials. If you make any mistakes, you can undo inserted text with 'u'. To bring back an undo, hit 'Ctrl+r' to redo.",
level: 170,
}
}
Expand All @@ -82,6 +106,12 @@ export class InsertAndUndoTutorial implements ITutorial {
}

public get notes(): JSX.Element[] {
return [<Notes.HJKLKeys />, <Notes.IKey />, <Notes.EscKey />, <Notes.UKey />]
return [
<Notes.HJKLKeys />,
<Notes.IKey />,
<Notes.EscKey />,
<Notes.UKey />,
<Notes.RedoKey />,
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const Line7 = "The '?' key will let you search backwards instead!"
const Line8 = "'?' searches backward, the 'n' and 'N' keys operate backward as well!"
const Line9 = "'N' will move you to the next instance going down"
const Line10 = "'n' will move you to the next instance going up"
const Line11 = "It may take you some practice to use reverse search"

export class SearchInBufferTutorial implements ITutorial {
private _stages: ITutorialStage[]
Expand Down Expand Up @@ -55,28 +56,41 @@ export class SearchInBufferTutorial implements ITutorial {
new Stages.MoveToGoalStage("Use 'N' to go to the previous instance of 'move'", 2, 21),
new Stages.MoveToGoalStage("Use 'N' to go to the previous instance of 'move'", 1, 28),
// Backward search
new Stages.SetBufferStage([Line7]),
new Stages.SetCursorPositionStage(0, 48),
new Stages.MoveToGoalStage("Use '?' to search backwards for the word 'you'", 0, 21),
new Stages.SetBufferStage([Line7, Line8, Line9]),
new Stages.SetBufferStage([Line7, Line8, Line9, Line10, Line11]),
new Stages.SetCursorPositionStage(4, 33),
new Stages.MoveToGoalStage("Use '?' to search backwards for the word 'you'", 4, 12),
new Stages.MoveToGoalStage(
"Use 'N' to go to the previous (backwards) instance of 'you'",
"Use 'n' to go to the next (backwards) instance of 'you'",
3,
14,
),
new Stages.MoveToGoalStage(
"Use 'n' to go to the next (backwards) instance of 'you'",
2,
14,
),
new Stages.SetBufferStage([Line7, Line8, Line9, Line10]),
new Stages.MoveToGoalStage(
"Use 'n' to go to the next (backwards) instance of 'move'",
"Use 'n' to go to the next (backwards) instance of 'you'",
0,
21,
),
new Stages.MoveToGoalStage(
"Use 'N' to go to the previous (backwards) instance of 'you'",
2,
14,
),
new Stages.MoveToGoalStage(
"Use 'N' to go to the previous (backwards) instance of 'you'",
3,
14,
),
]
}

public get metadata(): ITutorialMetadata {
return {
id: "oni.tutorials.find_across_buffer",
name: "Motion: /, ?, n, N",
name: "Search Motion: /, ?, n, N",
description:
"To navigate a buffer efficiently, Oni lets you search for strings with `/` and `?`. `n` and `N` let you navigate quickly between the matches!",
level: 160,
Expand Down
Loading

0 comments on commit 0278c63

Please sign in to comment.