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
49 changes: 49 additions & 0 deletions problems/plain/021-delete-till-char.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"id": "plain-021",
"category": "plain",
"difficulty": 2,
"start": [
"Hello there, world"
],
"goal": [
", world"
],
"solutions": [
{
"keys": "dt,",
"optimal": true
},
{
"keys": "vt,d"
}
],
"tags": [
"dt",
"t",
"delete"
],
"i18n": {
"ja": {
"title": "指定した文字の手前まで削除する",
"description": "カンマの手前までを削除して , world にしてください",
"hints": [
"t は「その文字の手前まで」移動する。オペレータと組み合わせられる"
],
"notes": [
"dt, で行頭からカンマの手前までを削除する。カンマ自体は残る",
"vt, でカンマの手前まで選択してから d。同じ範囲をビジュアルモードで消す"
]
},
"en": {
"title": "Delete up to a character",
"description": "Delete everything before the comma to get ', world'",
"hints": [
"t moves to just before a character, and it works as a motion for operators"
],
"notes": [
"dt, deletes from the cursor up to (but not including) the comma",
"vt, selects up to just before the comma, then d deletes the selection"
]
}
}
}
49 changes: 49 additions & 0 deletions problems/plain/022-change-in-quotes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"id": "plain-022",
"category": "plain",
"difficulty": 3,
"start": [
"She said \"hello\" quietly"
],
"goal": [
"She said \"goodbye\" quietly"
],
"solutions": [
{
"keys": "ci\"goodbye<Esc>",
"optimal": true
},
{
"keys": "f\"lct\"goodbye<Esc>"
}
],
"tags": [
"ci\"",
"text-object",
"change"
],
"i18n": {
"ja": {
"title": "引用符の中身を変更する",
"description": "hello を goodbye に変えて She said \"goodbye\" quietly にしてください",
"hints": [
"i\" は「引用符の内側」のテキストオブジェクト。行内なら引用符まで移動しなくても効く"
],
"notes": [
"ci\" は引用符の内側だけを変更する。カーソルが引用符より手前にあっても行内なら対象を見つけてくれる",
"f\" で開き引用符へ、l で中へ入り、ct\" で閉じ引用符の手前まで変更する"
]
},
"en": {
"title": "Change text inside quotes",
"description": "Change 'hello' to 'goodbye' to get She said \"goodbye\" quietly",
"hints": [
"i\" is the 'inside quotes' text object; it finds the quoted text on the line for you"
],
"notes": [
"ci\" changes just the text inside the quotes, even from earlier on the line",
"f\" jumps to the opening quote, l steps inside, and ct\" changes up to the closing quote"
]
}
}
}
52 changes: 52 additions & 0 deletions problems/plain/023-delete-to-end-of-file.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"id": "plain-023",
"category": "plain",
"difficulty": 2,
"start": [
"keep this line",
"drop this line",
"drop this too",
"and drop this"
],
"goal": [
"keep this line"
],
"solutions": [
{
"keys": "jdG",
"optimal": true
},
{
"keys": "j3dd"
}
],
"tags": [
"dG",
"G",
"delete"
],
"i18n": {
"ja": {
"title": "ファイル末尾まで削除する",
"description": "2 行目以降を削除して keep this line だけにしてください",
"hints": [
"G はファイル末尾へ移動する。オペレータと組み合わせると末尾までまとめて消せる"
],
"notes": [
"j で 2 行目へ移動し dG。カーソル行から最終行までを行単位で削除する",
"j で 2 行目へ移動し 3dd。消す行数を数えて指定するやり方"
]
},
"en": {
"title": "Delete to the end of the file",
"description": "Delete everything from line 2 down so only 'keep this line' remains",
"hints": [
"G moves to the last line; combined with an operator it reaches the end of the file"
],
"notes": [
"j moves to line 2, then dG deletes linewise from there to the last line",
"j moves to line 2, then 3dd deletes the three lines by count"
]
}
}
}
54 changes: 54 additions & 0 deletions problems/plain/024-search-then-change.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"id": "plain-024",
"category": "plain",
"difficulty": 2,
"start": [
"one two three",
"four five six",
"seven target nine"
],
"goal": [
"one two three",
"four five six",
"seven found nine"
],
"solutions": [
{
"keys": "/target<CR>cwfound<Esc>",
"optimal": true
},
{
"keys": "2jwcwfound<Esc>"
}
],
"tags": [
"search",
"/",
"cw",
"change"
],
"i18n": {
"ja": {
"title": "検索して移動してから書き換える",
"description": "target を found に変えて seven found nine にしてください",
"hints": [
"/ で検索するとカーソルがヒット位置へ飛ぶ。移動手段として使える"
],
"notes": [
"/target<CR> で単語の先頭へ飛び、cw で書き換える。行数を数えなくてよい",
"2j で 3 行目へ、w で target の先頭へ移動してから cw。検索を使わないやり方"
]
},
"en": {
"title": "Search, then change",
"description": "Change 'target' to 'found' to get 'seven found nine'",
"hints": [
"/ searches and moves the cursor to the match, so it doubles as a motion"
],
"notes": [
"/target<CR> jumps straight to the word, then cw changes it — no line counting",
"2j goes to line 3 and w moves onto 'target', then cw changes it"
]
}
}
}
53 changes: 53 additions & 0 deletions problems/plain/025-visual-replace-word.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"id": "plain-025",
"category": "plain",
"difficulty": 3,
"start": [
"apple banana",
"cherry banana"
],
"goal": [
"apple banana",
"cherry apple"
],
"solutions": [
{
"keys": "yiwjwviwp",
"optimal": true
},
{
"keys": "yiwjwcw<C-r>0<Esc>"
}
],
"tags": [
"yiw",
"viwp",
"visual",
"yank",
"put"
],
"i18n": {
"ja": {
"title": "ヤンクした単語で別の単語を置き換える",
"description": "2 行目の banana を apple に変えて cherry apple にしてください",
"hints": [
"ビジュアル選択中に p を押すと、選択範囲がレジスタの中身で置き換わる"
],
"notes": [
"yiw で apple をヤンクし、jw で 2 行目の banana へ。viw で選択して p で置き換える",
"yiw でヤンクし、cw の挿入中に <C-r>0 でヤンクレジスタを貼り付ける"
]
},
"en": {
"title": "Replace a word with a yanked word",
"description": "Change 'banana' on line 2 to 'apple' to get 'cherry apple'",
"hints": [
"Pressing p over a visual selection replaces the selection with the register"
],
"notes": [
"yiw yanks 'apple', jw moves to 'banana' on line 2, viw selects it and p replaces it",
"yiw yanks the word, then cw with <C-r>0 inserts the yank register instead of typing"
]
}
}
}
Loading