mirror of
https://github.com/VSCodeVim/Vim.git
synced 2024-09-11 12:25:59 +03:00
An option to show the colon at the start of the command line box (#2064)
* Added an option to show the colon at the start of the command line box
This commit is contained in:
parent
bee6ac6088
commit
68137e91eb
@ -165,6 +165,10 @@ We have removed this option, due to it making VSCodeVim's performance suffer imm
|
||||
* etc.
|
||||
* Type: Boolean (Default: `true`)
|
||||
|
||||
#### `"vim.cmdLineInitialColon"`
|
||||
* Set this to have VSCodeVim mimick Vim, showing the ':' colon character in the Vim command line when it is called.
|
||||
* Type: Boolean (Default: `false`)
|
||||
|
||||
#### `"vim.handleKeys"`
|
||||
* Allows user to select certain modifier keybindings and delegate them back to VSCode so that VSCodeVim does not process them.
|
||||
* Complete list of keys that can be delegated back to VSCode can be found in our [package.json](https://github.com/VSCodeVim/Vim/blob/master/package.json#L44). Each key that has a vim.use<C-...> in the when argument can be delegated back to vscode by doing "<C-...>":false.
|
||||
|
@ -541,11 +541,16 @@
|
||||
"vim.substituteGlobalFlag": {
|
||||
"type": "boolean",
|
||||
"description": "Automatically apply the global flag, /g, to substitute commands. When set to true, use /g to mean only first match should be replaced.",
|
||||
"default": "false"
|
||||
"default": false
|
||||
},
|
||||
"vim.cursorStylePerMode": {
|
||||
"type": "object",
|
||||
"description": "Customize cursor style per mode"
|
||||
},
|
||||
"vim.cmdLineInitialColon": {
|
||||
"type": "boolean",
|
||||
"description": "When typing a command show the initial colon ':' character",
|
||||
"default": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,14 +16,21 @@ export async function showCmdLine(
|
||||
|
||||
const options: vscode.InputBoxOptions = {
|
||||
prompt: 'Vim command line',
|
||||
value: initialText,
|
||||
value: Configuration.cmdLineInitialColon ? ':' + initialText : initialText,
|
||||
ignoreFocusOut: true,
|
||||
valueSelection: [initialText.length, initialText.length],
|
||||
valueSelection: [
|
||||
Configuration.cmdLineInitialColon ? initialText.length + 1 : initialText.length,
|
||||
Configuration.cmdLineInitialColon ? initialText.length + 1 : initialText.length,
|
||||
],
|
||||
};
|
||||
|
||||
try {
|
||||
const cmdString = await vscode.window.showInputBox(options);
|
||||
await runCmdLine(cmdString!, modeHandler);
|
||||
const trimmedCmdString =
|
||||
cmdString && Configuration.cmdLineInitialColon && cmdString[0] === ':'
|
||||
? cmdString.slice(1)
|
||||
: cmdString;
|
||||
await runCmdLine(trimmedCmdString!, modeHandler);
|
||||
return;
|
||||
} catch (e) {
|
||||
modeHandler.setStatusBarText(e.toString());
|
||||
|
@ -324,6 +324,11 @@ class ConfigurationClass {
|
||||
visualblock: undefined,
|
||||
replace: undefined,
|
||||
};
|
||||
|
||||
/**
|
||||
* When typing a command show the initial colon ':' character
|
||||
*/
|
||||
cmdLineInitialColon = false;
|
||||
}
|
||||
|
||||
function overlapSetting(args: {
|
||||
|
Loading…
Reference in New Issue
Block a user