Explorar el Código

Closes #104 - adds keymap setting

main
Eric Amodio hace 7 años
padre
commit
cd5c61f9c6
Se han modificado 6 ficheros con 124 adiciones y 15 borrados
  1. +4
    -0
      CHANGELOG.md
  2. +2
    -0
      README.md
  3. +103
    -14
      package.json
  4. +9
    -0
      src/configuration.ts
  5. +2
    -1
      src/constants.ts
  6. +4
    -0
      src/gitService.ts

+ 4
- 0
CHANGELOG.md Ver fichero

@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
## [6.4.0-beta] - 2017-12-02
### Added
- Adds `gitlens.keymap` setting to specify the keymap to use for GitLens shortcut keys -- closes [#104](https://github.com/eamodio/vscode-gitlens/issues/104)
- `standard` - adds a standard set of shortcut keys
- `chorded` - adds a chorded set of shortcut keys that all start with `Ctrl+Alt+G` (`⌥⌘G` on macOS)
- `none` - no shortcut keys will be added
- Adds progress indicator to the `Show Stashed Changes` command (`gitlens.showQuickStashList`)
- Adds progress indicator to the `Apply Stashed Changes` command (`gitlens.stashApply`)

+ 2
- 0
README.md Ver fichero

@ -28,6 +28,7 @@ While GitLens is highly customizable and provides many [configuration settings](
|`gitlens.codeLens.enabled`|Specifies whether or not to provide any Git code lens, by default<br />Use the `Toggle Git Code Lens` command (`gitlens.toggleCodeLens`) to toggle the Git code lens on and off for the current session
|`gitlens.gitExplorer.enabled`|Specifies whether or not to show the `GitLens` view
|`gitlens.statusBar.enabled`|Specifies whether or not to provide blame information on the status bar
|`gitlens.keymap`|Specifies the keymap to use for GitLens shortcut keys<br />`standard` - adds a standard set of shortcut keys<br />`chorded` - adds a chorded set of shortcut keys that all start with `Ctrl+Alt+G` (`⌥⌘G` on macOS)<br />`none` - no shortcut keys will be added
## Features
@ -345,6 +346,7 @@ GitLens is highly customizable and provides many configuration settings to allow
|-----|------------
|`gitlens.defaultDateFormat`|Specifies how all absolute dates will be formatted by default<br />See https://momentjs.com/docs/#/displaying/format/ for valid formats
|`gitlens.insiders`|Opts into the insiders channel -- provides access to upcoming features
|`gitlens.keymap`|Specifies the keymap to use for GitLens shortcut keys<br />`standard` - adds a standard set of shortcut keys<br />`chorded` - adds a chorded set of shortcut keys that all start with `Ctrl+Alt+G` (`⌥⌘G` on macOS)<br />`none` - no shortcut keys will be added
|`gitlens.outputLevel`|Specifies how much (if any) output will be sent to the GitLens output channel
### Blame Settings

+ 103
- 14
package.json Ver fichero

@ -65,6 +65,17 @@
"description": "Specifies whether or not to enable new experimental features (expect there to be issues)",
"scope": "window"
},
"gitlens.keymap": {
"type": "string",
"default": "standard",
"enum": [
"standard",
"chorded",
"none"
],
"description": "Specifies the keymap to use for GitLens shortcut keys\n `standard` - adds a standard set of shortcut keys\n `chorded` - adds a chorded set of shortcut keys that all start with `Ctrl+Alt+G` (`⌥⌘G` on macOS)\n `none` - no shortcut keys will be added",
"scope": "window"
},
"gitlens.outputLevel": {
"type": "string",
"default": "silent",
@ -2352,67 +2363,145 @@
{
"command": "gitlens.toggleFileBlame",
"key": "alt+b",
"when": "editorTextFocus && gitlens:activeIsBlameable"
"when": "gitlens:keymap == standard && editorTextFocus && gitlens:activeIsBlameable"
},
{
"command": "gitlens.toggleCodeLens",
"key": "shift+alt+b",
"when": "editorTextFocus && gitlens:activeIsTracked && gitlens:canToggleCodeLens"
"when": "gitlens:keymap == standard && editorTextFocus && gitlens:activeIsTracked && gitlens:canToggleCodeLens"
},
{
"command": "gitlens.showLastQuickPick",
"key": "alt+-",
"when": "gitlens:enabled"
"when": "gitlens:keymap == standard && gitlens:enabled"
},
{
"command": "gitlens.showCommitSearch",
"key": "alt+/",
"when": "gitlens:enabled"
"when": "gitlens:keymap == standard && gitlens:enabled"
},
{
"command": "gitlens.showQuickFileHistory",
"key": "alt+h",
"when": "gitlens:enabled"
"when": "gitlens:keymap == standard && gitlens:enabled"
},
{
"command": "gitlens.showQuickRepoHistory",
"key": "shift+alt+h",
"when": "gitlens:enabled"
"when": "gitlens:keymap == standard && gitlens:enabled"
},
{
"command": "gitlens.showQuickRepoStatus",
"key": "alt+s",
"when": "gitlens:enabled"
"when": "gitlens:keymap == standard && gitlens:enabled"
},
{
"command": "gitlens.showQuickCommitFileDetails",
"key": "alt+c",
"when": "editorTextFocus && gitlens:enabled"
"when": "gitlens:keymap == standard && editorTextFocus && gitlens:enabled"
},
{
"command": "gitlens.diffWithNext",
"key": "alt+.",
"when": "editorTextFocus && gitlens:activeIsTracked"
"when": "gitlens:keymap == standard && editorTextFocus && gitlens:activeIsTracked"
},
{
"command": "gitlens.diffLineWithPrevious",
"key": "shift+alt+,",
"when": "editorTextFocus && gitlens:activeIsTracked"
"when": "gitlens:keymap == standard && editorTextFocus && gitlens:activeIsTracked"
},
{
"command": "gitlens.diffWithPrevious",
"key": "alt+,",
"when": "editorTextFocus && gitlens:activeIsTracked"
"when": "gitlens:keymap == standard && editorTextFocus && gitlens:activeIsTracked"
},
{
"command": "gitlens.diffLineWithWorking",
"key": "alt+w",
"when": "editorTextFocus && gitlens:activeIsTracked"
"when": "gitlens:keymap == standard && editorTextFocus && gitlens:activeIsTracked"
},
{
"command": "gitlens.diffWithWorking",
"key": "shift+alt+w",
"when": "editorTextFocus && gitlens:activeIsTracked"
"when": "gitlens:keymap == standard && editorTextFocus && gitlens:activeIsTracked"
},
{
"command": "gitlens.toggleFileBlame",
"key": "ctrl+alt+g b",
"mac": "cmd+alt+g b",
"when": "gitlens:keymap == chorded && editorTextFocus && gitlens:activeIsBlameable"
},
{
"command": "gitlens.toggleCodeLens",
"key": "ctrl+alt+g shift+b",
"mac": "cmd+alt+g shift+b",
"when": "gitlens:keymap == chorded && editorTextFocus && gitlens:activeIsTracked && gitlens:canToggleCodeLens"
},
{
"command": "gitlens.showLastQuickPick",
"key": "ctrl+alt+g -",
"mac": "cmd+alt+g -",
"when": "gitlens:keymap == chorded && gitlens:enabled"
},
{
"command": "gitlens.showCommitSearch",
"key": "ctrl+alt+g /",
"mac": "cmd+alt+g /",
"when": "gitlens:keymap == chorded && gitlens:enabled"
},
{
"command": "gitlens.showQuickFileHistory",
"key": "ctrl+alt+g h",
"mac": "cmd+alt+g h",
"when": "gitlens:keymap == chorded && gitlens:enabled"
},
{
"command": "gitlens.showQuickRepoHistory",
"key": "ctrl+alt+g shift+h",
"mac": "cmd+alt+g shift+h",
"when": "gitlens:keymap == chorded && gitlens:enabled"
},
{
"command": "gitlens.showQuickRepoStatus",
"key": "ctrl+alt+g s",
"mac": "cmd+alt+g s",
"when": "gitlens:keymap == chorded && gitlens:enabled"
},
{
"command": "gitlens.showQuickCommitFileDetails",
"key": "ctrl+alt+g c",
"mac": "cmd+alt+g c",
"when": "gitlens:keymap == chorded && editorTextFocus && gitlens:enabled"
},
{
"command": "gitlens.diffWithNext",
"key": "ctrl+alt+g .",
"mac": "cmd+alt+g .",
"when": "gitlens:keymap == chorded && editorTextFocus && gitlens:activeIsTracked"
},
{
"command": "gitlens.diffLineWithPrevious",
"key": "ctrl+alt+g shift+,",
"mac": "cmd+alt+g shift+,",
"when": "gitlens:keymap == chorded && editorTextFocus && gitlens:activeIsTracked"
},
{
"command": "gitlens.diffWithPrevious",
"key": "ctrl+alt+g ,",
"mac": "cmd+alt+g ,",
"when": "gitlens:keymap == chorded && editorTextFocus && gitlens:activeIsTracked"
},
{
"command": "gitlens.diffLineWithWorking",
"key": "ctrl+alt+g w",
"mac": "cmd+alt+g w",
"when": "gitlens:keymap == chorded && editorTextFocus && gitlens:activeIsTracked"
},
{
"command": "gitlens.diffWithWorking",
"key": "ctrl+alt+g shift+w",
"mac": "cmd+alt+g shift+w",
"when": "gitlens:keymap == chorded && editorTextFocus && gitlens:activeIsTracked"
}
],
"views": {
@ -2464,4 +2553,4 @@
"typescript": "2.6.2",
"vscode": "1.1.10"
}
}
}

+ 9
- 0
src/configuration.ts Ver fichero

@ -44,6 +44,12 @@ export enum GitExplorerFilesLayout {
Tree = 'tree'
}
export enum KeyMap {
Standard = 'standard',
Chorded = 'chorded',
None = 'none'
}
export enum StatusBarCommand {
DiffWithPrevious = 'gitlens.diffWithPrevious',
DiffWithWorking = 'gitlens.diffWithWorking',
@ -254,6 +260,8 @@ export interface IConfig {
gitExplorer: IGitExplorerConfig;
keymap: KeyMap;
remotes: IRemotesConfig[];
statusBar: {
@ -384,6 +392,7 @@ const emptyConfig: IConfig = {
statusFileFormat: ''
// dateFormat: string | null;
},
keymap: 'standard' as KeyMap,
remotes: [],
statusBar: {
enabled: false,

+ 2
- 1
src/constants.ts Ver fichero

@ -38,7 +38,8 @@ export enum CommandContext {
ActiveHasRemote = 'gitlens:activeHasRemote',
ActiveIsBlameable = 'gitlens:activeIsBlameable',
ActiveFileIsTracked = 'gitlens:activeIsTracked',
Key = 'gitlens:key'
Key = 'gitlens:key',
KeyMap = 'gitlens:keymap'
}
export function setCommandContext(key: CommandContext | string, value: any) {

+ 4
- 0
src/gitService.ts Ver fichero

@ -153,6 +153,10 @@ export class GitService extends Disposable {
const cfg = configuration.get<IConfig>();
if (initializing || configuration.changed(e, configuration.name('keymap').value)) {
setCommandContext(CommandContext.KeyMap, cfg.keymap);
}
if (initializing || configuration.changed(e, configuration.name('advanced')('caching')('enabled').value)) {
if (cfg.advanced.caching.enabled) {
this._cacheDisposable && this._cacheDisposable.dispose();

Cargando…
Cancelar
Guardar