Skip to content

Commit

Permalink
Merge pull request VSCodeVim#2069 from xconverge/disable-mode-string-…
Browse files Browse the repository at this point in the history
…option

fixes VSCodeVim#1576 and showcmd configuration option
  • Loading branch information
xconverge authored Oct 13, 2017
2 parents 68137e9 + 50c7b86 commit 70b270c
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 '_'",
Expand Down
5 changes: 5 additions & 0 deletions src/configuration/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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?
*/
Expand Down
15 changes: 14 additions & 1 deletion src/mode/modeHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 70b270c

Please sign in to comment.