Add startInInsertMode configuration option.

This commit is contained in:
johnfn 2016-12-01 15:31:33 -05:00
parent e68a5c550a
commit a0bec14564
4 changed files with 14 additions and 2 deletions

View File

@ -56,6 +56,9 @@ The following is a subset of the supported configurations; the full list is desc
}]
```
#### startInInsertMode
* Have VSCodeVim start in Insert Mode rather than Normal Mode.
#### useCtrlKeys
* Enable Vim ctrl keys overriding common VS Code operations (eg. copy, paste, find, etc). Setting this option to true will enable:
* `ctrl+c`, `ctrl+[` => `<Esc>`

View File

@ -326,6 +326,10 @@
"type": "boolean",
"description": "Indent code automatically.",
"default": true
},
"vim.startInInsertMode": {
"type": "boolean",
"description": "Start in Insert Mode."
}
}
}

View File

@ -65,6 +65,7 @@ export class Configuration {
autoindent = true;
easymotion = false;
incsearch = true;
startInInsertMode = true;
@overlapSetting({ codeName: "tabSize", default: 8})
tabstop: number | undefined = undefined;

View File

@ -177,7 +177,7 @@ export class VimState {
/**
* The mode Vim will be in once this action finishes.
*/
private _currentMode = ModeName.Normal;
private _currentMode: ModeName;
public get currentMode(): number {
return this._currentMode;
@ -460,7 +460,11 @@ export class ModeHandler implements vscode.Disposable {
this.vimState.historyTracker = new HistoryTracker();
this.vimState.easyMotion = new EasyMotion();
if (Configuration.getInstance().startInInsertMode) {
this._vimState.currentMode = ModeName.Insert;
} else {
this._vimState.currentMode = ModeName.Normal;
}
this.setCurrentModeByName(this._vimState);