mirror of
https://github.com/VSCodeVim/Vim.git
synced 2024-09-19 08:07:28 +03:00
Add startInInsertMode configuration option.
This commit is contained in:
parent
e68a5c550a
commit
a0bec14564
@ -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>`
|
||||
|
@ -326,6 +326,10 @@
|
||||
"type": "boolean",
|
||||
"description": "Indent code automatically.",
|
||||
"default": true
|
||||
},
|
||||
"vim.startInInsertMode": {
|
||||
"type": "boolean",
|
||||
"description": "Start in Insert Mode."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -65,6 +65,7 @@ export class Configuration {
|
||||
autoindent = true;
|
||||
easymotion = false;
|
||||
incsearch = true;
|
||||
startInInsertMode = true;
|
||||
|
||||
@overlapSetting({ codeName: "tabSize", default: 8})
|
||||
tabstop: number | undefined = undefined;
|
||||
|
@ -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();
|
||||
|
||||
this._vimState.currentMode = ModeName.Normal;
|
||||
if (Configuration.getInstance().startInInsertMode) {
|
||||
this._vimState.currentMode = ModeName.Insert;
|
||||
} else {
|
||||
this._vimState.currentMode = ModeName.Normal;
|
||||
}
|
||||
|
||||
this.setCurrentModeByName(this._vimState);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user