fixes #1576 and showcmd configuration option

This commit is contained in:
xconverge 2017-10-12 22:01:09 -07:00
parent 68137e91eb
commit 50c7b86b1f
4 changed files with 28 additions and 1 deletions

View File

@ -369,6 +369,10 @@ Vim settings are loaded in the following sequence:
* Show the text of any command you are in the middle of writing.
* Type: Boolean (Default: `true`)
#### `"vim.showmodename"`
* Show the name of the current mode in the statusbar.
* Type: Boolean (Default: `true`)
#### `"vim.textwidth"`
* Width to word-wrap to when using `gq`.
* Type: number (Default: `80`)

View File

@ -400,6 +400,11 @@
"description": "Show the text of any command you are in the middle of writing.",
"default": true
},
"vim.showmodename": {
"type": "boolean",
"description": "Show the name of the current mode in the statusbar.",
"default": true
},
"vim.iskeyword": {
"type": "string",
"description": "keywords contain alphanumeric characters and '_'",

View File

@ -208,6 +208,11 @@ class ConfigurationClass {
*/
showcmd = true;
/**
* Display mode name text on status bar?
*/
showmodename = true;
/**
* What key should <leader> map to in key remappings?
*/

View File

@ -2008,7 +2008,20 @@ export class ModeHandler implements vscode.Disposable {
? 'Recording @' + this._vimState.recordedMacro.registerName
: '';
const statusBarText = [modeText, this._createCurrentCommandText(), macroText].join(' ');
// Create status bar text
let statusBarTextArray = [];
if (Configuration.showmodename) {
statusBarTextArray.push(modeText);
}
if (Configuration.showcmd) {
statusBarTextArray.push(this._createCurrentCommandText());
}
statusBarTextArray.push(macroText);
const statusBarText = statusBarTextArray.join(' ');
this.setStatusBarText(statusBarText);
}