commands

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package commands is the desktop app's table of commands (docs/specs/ui.md#keyboard-map): each command's ID, as Obsidian names it, title, group, icon and keys. It is plain data: the window gives each command its action and binds its keys through frostui's command table. A test holds it to the spec's keyboard map.

Index

Constants

View Source
const (
	GroupEditor    = "Editor"
	GroupFiles     = "Files"
	GroupWorkspace = "Workspace"
	GroupApp       = "Frostnotes"
)

The groups of the palette.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key struct {
	Mods  ui.Modifiers
	Key   ui.Key
	Scope Scope
}

Key is a key of a command.

type Scope

type Scope uint8

Scope says where a key works.

const (
	// OutsideEditors keys step aside while a text editor has the focus.
	OutsideEditors Scope = iota
	// Everywhere keys work wherever the focus is.
	Everywhere
	// InEditor keys are the note editor's own: the table lists them for
	// the palette's key caps, and the editor binds them.
	InEditor
)

The scopes, the app's own: the window maps them to frostui's KeyScope.

type Spec

type Spec struct {
	ID, Title, Group, Icon string
	Keys                   []Key
	// Unlisted commands have keys but no entry in the palette.
	Unlisted bool
}

Spec is one command.

func Table

func Table() []Spec

Table lists every command of the app, in the palette's order.

Jump to

Keyboard shortcuts

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