MCPcopy Create free account
hub / github.com/charmbracelet/bubbles / DefaultKeyMap

Function DefaultKeyMap

textinput/textinput.go:71–90  ·  view source on GitHub ↗

DefaultKeyMap is the default set of key bindings for navigating and acting upon the textinput.

()

Source from the content-addressed store, hash-verified

69// DefaultKeyMap is the default set of key bindings for navigating and acting
70// upon the textinput.
71func DefaultKeyMap() KeyMap {
72 return KeyMap{
73 CharacterForward: key.NewBinding(key.WithKeys("right", "ctrl+f")),
74 CharacterBackward: key.NewBinding(key.WithKeys("left", "ctrl+b")),
75 WordForward: key.NewBinding(key.WithKeys("alt+right", "ctrl+right", "alt+f")),
76 WordBackward: key.NewBinding(key.WithKeys("alt+left", "ctrl+left", "alt+b")),
77 DeleteWordBackward: key.NewBinding(key.WithKeys("alt+backspace", "ctrl+w", "ctrl+backspace")),
78 DeleteWordForward: key.NewBinding(key.WithKeys("alt+delete", "alt+d", "ctrl+delete")),
79 DeleteAfterCursor: key.NewBinding(key.WithKeys("ctrl+k")),
80 DeleteBeforeCursor: key.NewBinding(key.WithKeys("ctrl+u")),
81 DeleteCharacterBackward: key.NewBinding(key.WithKeys("backspace", "shift+backspace", "ctrl+h")),
82 DeleteCharacterForward: key.NewBinding(key.WithKeys("delete", "ctrl+d")),
83 LineStart: key.NewBinding(key.WithKeys("home", "ctrl+a")),
84 LineEnd: key.NewBinding(key.WithKeys("end", "ctrl+e")),
85 Paste: key.NewBinding(key.WithKeys("ctrl+v")),
86 AcceptSuggestion: key.NewBinding(key.WithKeys("tab")),
87 NextSuggestion: key.NewBinding(key.WithKeys("down", "ctrl+n")),
88 PrevSuggestion: key.NewBinding(key.WithKeys("up", "ctrl+p")),
89 }
90}
91
92// Model is the Bubble Tea model for this text input element.
93type Model struct {

Callers 1

NewFunction · 0.70

Calls 2

NewBindingFunction · 0.92
WithKeysFunction · 0.92

Tested by

no test coverage detected