keys

package
v4.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BranchKeys = BranchKeyMap{
	Checkout: key.NewBinding(
		key.WithKeys("C", " "),
		key.WithHelp("C/space", "checkout"),
	),
	New: key.NewBinding(
		key.WithKeys("n"),
		key.WithHelp("n", "new"),
	),
	CreatePr: key.NewBinding(
		key.WithKeys("O"),
		key.WithHelp("O", "create PR"),
	),
	FastForward: key.NewBinding(
		key.WithKeys("f"),
		key.WithHelp("f", "fast-forward"),
	),
	Push: key.NewBinding(
		key.WithKeys("P"),
		key.WithHelp("P", "push"),
	),
	ForcePush: key.NewBinding(
		key.WithKeys("F"),
		key.WithHelp("F", "force-push"),
	),
	Delete: key.NewBinding(
		key.WithKeys("d", "backspace"),
		key.WithHelp("d/backspace", "delete"),
	),
	ViewPRs: key.NewBinding(
		key.WithKeys("s"),
		key.WithHelp("s", "Switch to PRs"),
	),
}
View Source
var IssueKeys = IssueKeyMap{
	Assign: key.NewBinding(
		key.WithKeys("a"),
		key.WithHelp("a", "assign"),
	),
	Unassign: key.NewBinding(
		key.WithKeys("A"),
		key.WithHelp("A", "unassign"),
	),
	Comment: key.NewBinding(
		key.WithKeys("c"),
		key.WithHelp("c", "comment"),
	),
	Close: key.NewBinding(
		key.WithKeys("x"),
		key.WithHelp("x", "close"),
	),
	Reopen: key.NewBinding(
		key.WithKeys("X"),
		key.WithHelp("X", "reopen"),
	),
	ViewPRs: key.NewBinding(
		key.WithKeys("s"),
		key.WithHelp("s", "switch to PRs"),
	),
}
View Source
var Keys = &KeyMap{
	Up: key.NewBinding(
		key.WithKeys("up", "k"),
		key.WithHelp("↑/k", "move up"),
	),
	Down: key.NewBinding(
		key.WithKeys("down", "j"),
		key.WithHelp("↓/j", "move down"),
	),
	FirstLine: key.NewBinding(
		key.WithKeys("g", "home"),
		key.WithHelp("g/home", "first item"),
	),
	LastLine: key.NewBinding(
		key.WithKeys("G", "end"),
		key.WithHelp("G/end", "last item"),
	),
	TogglePreview: key.NewBinding(
		key.WithKeys("p"),
		key.WithHelp("p", "open in Preview"),
	),
	OpenGithub: key.NewBinding(
		key.WithKeys("o"),
		key.WithHelp("o", "open in GitHub"),
	),
	Refresh: key.NewBinding(
		key.WithKeys("r"),
		key.WithHelp("r", "refresh"),
	),
	RefreshAll: key.NewBinding(
		key.WithKeys("R"),
		key.WithHelp("R", "refresh all"),
	),
	PageDown: key.NewBinding(
		key.WithKeys("ctrl+d"),
		key.WithHelp("Ctrl+d", "preview page down"),
	),
	PageUp: key.NewBinding(
		key.WithKeys("ctrl+u"),
		key.WithHelp("Ctrl+u", "preview page up"),
	),
	NextSection: key.NewBinding(
		key.WithKeys("right", "l"),
		key.WithHelp("󰁔/l", "next section"),
	),
	PrevSection: key.NewBinding(
		key.WithKeys("left", "h"),
		key.WithHelp("󰁍/h", "previous section"),
	),
	Search: key.NewBinding(
		key.WithKeys("/"),
		key.WithHelp("/", "search"),
	),
	CopyNumber: key.NewBinding(
		key.WithKeys("y"),
		key.WithHelp("y", "copy number"),
	),
	CopyUrl: key.NewBinding(
		key.WithKeys("Y"),
		key.WithHelp("Y", "copy url"),
	),
	Help: key.NewBinding(
		key.WithKeys("?"),
		key.WithHelp("?", "help"),
	),
	Quit: key.NewBinding(
		key.WithKeys("q", "esc", "ctrl+c"),
		key.WithHelp("q", "quit"),
	),
}
View Source
var PRKeys = PRKeyMap{
	Approve: key.NewBinding(
		key.WithKeys("v"),
		key.WithHelp("v", "approve"),
	),
	Assign: key.NewBinding(
		key.WithKeys("a"),
		key.WithHelp("a", "assign"),
	),
	Unassign: key.NewBinding(
		key.WithKeys("A"),
		key.WithHelp("A", "unassign"),
	),
	Comment: key.NewBinding(
		key.WithKeys("c"),
		key.WithHelp("c", "comment"),
	),
	Diff: key.NewBinding(
		key.WithKeys("d"),
		key.WithHelp("d", "diff"),
	),
	Checkout: key.NewBinding(
		key.WithKeys("C", " "),
		key.WithHelp("C/Space", "checkout"),
	),
	Close: key.NewBinding(
		key.WithKeys("x"),
		key.WithHelp("x", "close"),
	),
	Reopen: key.NewBinding(
		key.WithKeys("X"),
		key.WithHelp("X", "reopen"),
	),
	Ready: key.NewBinding(
		key.WithKeys("W"),
		key.WithHelp("W", "ready for review"),
	),
	Merge: key.NewBinding(
		key.WithKeys("m"),
		key.WithHelp("m", "merge"),
	),
	WatchChecks: key.NewBinding(
		key.WithKeys("w"),
		key.WithHelp("w", "Watch checks"),
	),
	ViewIssues: key.NewBinding(
		key.WithKeys("s"),
		key.WithHelp("s", "Switch to issues"),
	),
}

Functions

func BranchFullHelp added in v4.6.0

func BranchFullHelp() []key.Binding

func CreateKeyMapForView added in v4.6.0

func CreateKeyMapForView(viewType config.ViewType) help.KeyMap

func IssueFullHelp

func IssueFullHelp() []key.Binding

func PRFullHelp

func PRFullHelp() []key.Binding

func Rebind added in v4.2.0

func Rebind(universal, issueKeys, prKeys, branchKeys []config.Keybinding) error

Rebind will update our saved keybindings from configuration values.

Types

type BranchKeyMap added in v4.6.0

type BranchKeyMap struct {
	Checkout    key.Binding
	New         key.Binding
	CreatePr    key.Binding
	FastForward key.Binding
	Push        key.Binding
	ForcePush   key.Binding
	Delete      key.Binding
	ViewPRs     key.Binding
}

type IssueKeyMap

type IssueKeyMap struct {
	Assign   key.Binding
	Unassign key.Binding
	Comment  key.Binding
	Close    key.Binding
	Reopen   key.Binding
	ViewPRs  key.Binding
}

type KeyMap

type KeyMap struct {
	Up            key.Binding
	Down          key.Binding
	FirstLine     key.Binding
	LastLine      key.Binding
	TogglePreview key.Binding
	OpenGithub    key.Binding
	Refresh       key.Binding
	RefreshAll    key.Binding
	PageDown      key.Binding
	PageUp        key.Binding
	NextSection   key.Binding
	PrevSection   key.Binding
	Search        key.Binding
	CopyUrl       key.Binding
	CopyNumber    key.Binding
	Help          key.Binding
	Quit          key.Binding
	// contains filtered or unexported fields
}

func (KeyMap) AppKeys

func (k KeyMap) AppKeys() []key.Binding

func (KeyMap) FullHelp

func (k KeyMap) FullHelp() [][]key.Binding

func (KeyMap) NavigationKeys

func (k KeyMap) NavigationKeys() []key.Binding

func (KeyMap) QuitAndHelpKeys

func (k KeyMap) QuitAndHelpKeys() []key.Binding

func (KeyMap) ShortHelp

func (k KeyMap) ShortHelp() []key.Binding

type PRKeyMap

type PRKeyMap struct {
	Approve     key.Binding
	Assign      key.Binding
	Unassign    key.Binding
	Comment     key.Binding
	Diff        key.Binding
	Checkout    key.Binding
	Close       key.Binding
	Ready       key.Binding
	Reopen      key.Binding
	Merge       key.Binding
	WatchChecks key.Binding
	ViewIssues  key.Binding
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL