Skip to content

Commit

Permalink
Add insert line above / below without inserting (fixes #21).
Browse files Browse the repository at this point in the history
  • Loading branch information
71 committed Nov 20, 2019
1 parent 3f95542 commit ec4a799
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
4 changes: 2 additions & 2 deletions commands/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ They are implemented in [`src/commands`](../src/commands).
| `dance.insert.lineEnd` | Insert at line end | Start insert at line end of each selection. | `Shift+A` (`dance.mode == 'normal'`) |
| `dance.insert.newLine.below` | Insert new line below | Create new line and start insert below. | `O` (`dance.mode == 'normal'`) |
| `dance.insert.newLine.above` | Insert new line above | Create new line and start insert above. | `Shift+O` (`dance.mode == 'normal'`) |
| `dance.newLine.below` | Add new line below | Add a new line below, without entering insert mode. | |
| `dance.newLine.above` | Add new line above | Add a new line above, without entering insert mode. | |
| `dance.newLine.below` | Add new line below | Add a new line below, without entering insert mode. | `Alt+O` (`dance.mode == 'normal'`) |
| `dance.newLine.above` | Add new line above | Add a new line above, without entering insert mode. | `Shift+Alt+O` (`dance.mode == 'normal'`) |
| `dance.repeat.insert` | Repeat last insert-mode change | Repeat last insert-mode change. | `.` (`dance.mode == 'normal'`) |
| `dance.left` | Move left | Move left. | `Left` (`dance.mode == 'normal'`), `H` (`dance.mode == 'normal'`) |
| `dance.right` | Move right | Move right. | `Right` (`dance.mode == 'normal'`), `L` (`dance.mode == 'normal'`) |
Expand Down
2 changes: 2 additions & 0 deletions commands/commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@ insert.newLine.above:
newLine.below:
title: Add new line below
descr: Add a new line below, without entering insert mode.
keys: a-o (normal)

newLine.above:
title: Add new line above
descr: Add a new line above, without entering insert mode.
keys: s-a-o (normal)

repeat.insert:
title: Repeat last insert-mode change
Expand Down
8 changes: 6 additions & 2 deletions commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,18 @@ export const newLineBelow: ICommand & { readonly id: 'dance.newLine.below' } = {
id : 'dance.newLine.below',
title : 'Add new line below',
description: 'Add a new line below, without entering insert mode.',
keybindings: [],
keybindings: [
{ key: 'Alt+o', when: 'editorTextFocus && dance.mode == \'normal\'' },
],
}
/** Add a new line above, without entering insert mode. */
export const newLineAbove: ICommand & { readonly id: 'dance.newLine.above' } = {
id : 'dance.newLine.above',
title : 'Add new line above',
description: 'Add a new line above, without entering insert mode.',
keybindings: [],
keybindings: [
{ key: 'Shift+Alt+o', when: 'editorTextFocus && dance.mode == \'normal\'' },
],
}
/** Repeat last insert-mode change. */
export const repeatInsert: ICommand & { readonly id: 'dance.repeat.insert' } = {
Expand Down
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,16 @@
"key": "Shift+o",
"when": "editorTextFocus && dance.mode == 'normal'"
},
{
"command": "dance.newLine.below",
"key": "Alt+o",
"when": "editorTextFocus && dance.mode == 'normal'"
},
{
"command": "dance.newLine.above",
"key": "Shift+Alt+o",
"when": "editorTextFocus && dance.mode == 'normal'"
},
{
"command": "dance.repeat.insert",
"key": ".",
Expand Down

0 comments on commit ec4a799

Please sign in to comment.