Skip to content

Commit

Permalink
Merge pull request #222 from geksilla/feature/basic-fold-support
Browse files Browse the repository at this point in the history
Added basic fold commands zc, zo, zC, zO.
  • Loading branch information
jpoon committed May 17, 2016
2 parents 95003c2 + 3f4ea41 commit 5091b73
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/mode/commands.ts
Expand Up @@ -45,6 +45,12 @@ export enum Command {
// Find
Find,

// Folding
Fold,
Unfold,
FoldAll,
UnfoldAll,

// Text Modification
Undo,
Redo,
Expand Down Expand Up @@ -131,6 +137,12 @@ export function newDefaultNormalKeymap() : {[key: string]: Command} {
"X": Command.DeleteLastChar,

"/": Command.Find,

"zc": Command.Fold,
"zo": Command.Unfold,
"zC": Command.FoldAll,
"zO": Command.UnfoldAll,

":": Command.EnterCommand,
"v": Command.EnterVisualMode,
"esc": Command.ExitMessages
Expand Down
8 changes: 8 additions & 0 deletions src/mode/modeNormal.ts
Expand Up @@ -20,6 +20,14 @@ export class NormalMode extends Mode {
return async () => { return showCmdLine("", this._modeHandler); };
case Command.Find:
return async () => { return vscode.commands.executeCommand("actions.find"); };
case Command.Fold:
return async () => { return vscode.commands.executeCommand("editor.fold"); };
case Command.Unfold:
return async () => { return vscode.commands.executeCommand("editor.unfold"); };
case Command.FoldAll:
return async () => { return vscode.commands.executeCommand("editor.foldAll"); };
case Command.UnfoldAll:
return async () => { return vscode.commands.executeCommand("editor.unfoldAll"); };
case Command.Undo:
return async () => { return vscode.commands.executeCommand("undo"); };
case Command.Redo :
Expand Down

0 comments on commit 5091b73

Please sign in to comment.