[go: up one dir, main page]

VSCode

To run git-gamble from VSCode

Setup

Add this in your .vscode/tasks.json

{
	// See https://go.microsoft.com/fwlink/?LinkId=733558
	// for the documentation about the tasks.json format
	"version": "2.0.0",
	"tasks": [
		{
			"label": "Gamble fail",
			"type": "shell",
			"command": "direnv exec . git gamble --fail",
			"group": "test",
		},
		{
			"label": "Gamble pass",
			"type": "shell",
			"command": "direnv exec . git gamble --pass",
			"group": "test",
		},
		{
			"label": "Gamble red",
			"type": "shell",
			"command": "direnv exec . git gamble --red",
			"group": "test",
		},
		{
			"label": "Gamble green",
			"type": "shell",
			"command": "direnv exec . git gamble --green",
			"group": "test",
		},
		{
			"label": "Gamble refactor",
			"type": "shell",
			"command": "direnv exec . git gamble --refactor",
			"group": "test",
		},
	]
}

Remove direnv exec . if you don't use DirEnv yet

Execute

Using command palette

  1. Open the Command Palette (F1 or CTRL + Shift + P)
  2. Select Tasks: Run Task
  3. Select the task (e.g. Gamble refactor)

Using shortcuts

You can bind keyboard shortcuts

For example

[
    {
        "key": "ctrl+g ctrl+f",
        "command": "workbench.action.tasks.runTask",
        "args": "Gamble fail"
    },
    {
        "key": "ctrl+g ctrl+p",
        "command": "workbench.action.tasks.runTask",
        "args": "Gamble pass"
    },
]

Using buttons in the sidebar

Task Explorer extension can be installed to trigger using click