mirror of
https://github.com/VSCodeVim/Vim.git
synced 2024-09-19 16:18:45 +03:00
Add <leader> support.
This commit is contained in:
parent
6bb5c4e8a5
commit
64a2752732
@ -151,6 +151,10 @@ Bind `ZZ` to save and close the current file:
|
||||
* Width to word-wrap to when using `gq`.
|
||||
* Type: number (Default: `80`)
|
||||
|
||||
#### leader
|
||||
* What key should `<leader>` map to in key remappings?
|
||||
* Type: string (Default: `\`)
|
||||
|
||||
## Configure
|
||||
|
||||
Vim options are loaded in the following sequence:
|
||||
|
@ -269,6 +269,11 @@
|
||||
"description": "Enable some vim ctrl key commands that override otherwise common operations, like ctrl+c",
|
||||
"default": true
|
||||
},
|
||||
"vim.leader": {
|
||||
"type": "string",
|
||||
"description": "What key should <leader> map to in remappings?",
|
||||
"default": "\\"
|
||||
},
|
||||
"vim.searchHighlightColor": {
|
||||
"type": "string",
|
||||
"description": "Color of the search highlight.",
|
||||
|
@ -116,6 +116,11 @@ class ConfigurationClass {
|
||||
*/
|
||||
showcmd = true;
|
||||
|
||||
/**
|
||||
* What key should <leader> map to in key remappings?
|
||||
*/
|
||||
leader = "\\";
|
||||
|
||||
/**
|
||||
* Show results of / or ? search as user is typing?
|
||||
*/
|
||||
|
@ -1,3 +1,5 @@
|
||||
import { Configuration } from './configuration/configuration';
|
||||
|
||||
export class AngleBracketNotation {
|
||||
|
||||
// Mapping from the nomalized string to regex strings that could match it.
|
||||
@ -27,6 +29,10 @@ export class AngleBracketNotation {
|
||||
return "\n";
|
||||
}
|
||||
|
||||
if (key.toLowerCase() === "<leader>") {
|
||||
return Configuration.leader;
|
||||
}
|
||||
|
||||
for (const notationMapKey in this._notationMap) {
|
||||
if (this._notationMap.hasOwnProperty(notationMapKey)) {
|
||||
const regex = new RegExp(this._notationMap[notationMapKey].join('|'), 'gi');
|
||||
|
Loading…
Reference in New Issue
Block a user