utils

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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"),
	),
	NextTab: key.NewBinding(
		key.WithKeys("tab"),
		key.WithHelp("tab", "next tab"),
	),
	PrevTab: key.NewBinding(
		key.WithKeys("shift+tab"),
		key.WithHelp("shift+tab", "previous tab"),
	),
	NextCol: key.NewBinding(
		key.WithKeys("right", "l"),
		key.WithHelp("/l", "next col"),
	),
	PrevCol: key.NewBinding(
		key.WithKeys("left", "h"),
		key.WithHelp("/h", "previous col"),
	),
	StartSearch: key.NewBinding(
		key.WithKeys("/"),
		key.WithHelp("/", "search"),
	),
	EndSearch: key.NewBinding(
		key.WithKeys("esc", "enter"),
	),
	InspectField: key.NewBinding(
		key.WithKeys("i"),
		key.WithHelp("i", "inspect"),
	),
	Home: key.NewBinding(
		key.WithKeys("backspace"),
		key.WithHelp("backspace", "homepage"),
	),
	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"),
	),
	Refresh: key.NewBinding(
		key.WithKeys("r"),
		key.WithHelp("r", "refresh"),
	),
	Help: key.NewBinding(
		key.WithKeys("?"),
		key.WithHelp("?", "toggle help"),
	),
	Quit: key.NewBinding(
		key.WithKeys("q", "esc", "ctrl+c"),
		key.WithHelp("q", "quit"),
	),
}

Functions

func BoolPtr

func BoolPtr(b bool) *bool

func IntPtr

func IntPtr(i int) *int

func Max

func Max(a, b int) int

func Min

func Min(a, b int) int

func StringPtr

func StringPtr(s string) *string

func UseStr

func UseStr(s *string) string

Types

type KeyMap

type KeyMap struct {
	Up            key.Binding
	Down          key.Binding
	FirstLine     key.Binding
	LastLine      key.Binding
	TogglePreview key.Binding
	Refresh       key.Binding
	NextTab       key.Binding
	PrevTab       key.Binding
	NextCol       key.Binding
	PrevCol       key.Binding
	StartSearch   key.Binding
	EndSearch     key.Binding
	InspectField  key.Binding
	Home          key.Binding
	Help          key.Binding
	Quit          key.Binding
}

func (KeyMap) FullHelp

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

func (KeyMap) ShortHelp

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

Jump to

Keyboard shortcuts

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