pmy

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// RulePath is a json path contining rules
	RulePath string
	// SnippetPath defines snippet root directry path
	SnippetPath string
	// LogPath is a path of the log file
	LogPath = os.ExpandEnv(defaultLogPath)
	// TagDelimiter defines delimiter string
	// that divide `tag` and one line of source
	TagDelimiter = "\\t"
)

Functions

func MeasureElapsedTime added in v0.4.0

func MeasureElapsedTime(start time.Time, name string)

MeasureElapsedTime measures elapsed time given a started time.

func Run

func Run(in Input) string

Run runs the main process of pmy. It returns zsh statement, where resulting values will be passed into zsh variables.

func SetConfigs

func SetConfigs()

SetConfigs set all Pmy config variable from shell's environment variables.

Types

type CmdGroup

type CmdGroup struct {
	Tag   string `json:"tag"`
	Stmt  string `json:"stmt"`
	After string `json:"after"`
	// contains filtered or unexported fields
}

CmdGroup represents one command creating sources for fzf

type CmdGroups

type CmdGroups []*CmdGroup

CmdGroups is representing Slice of Cmd Resulting all commands will be one set of fzf-sources

type Input

type Input struct {
	BufferLeft  string
	BufferRight string
}

Input represents input from zsh

type Out added in v0.2.0

type Out struct {
	// contains filtered or unexported fields
}

Out represents Output of pmy against zsh routine. This struct has strings exported to shell, whose embedded variables are all expanded.

type Rule added in v0.2.0

type Rule struct {
	Name           string    `json:"name" yaml:"name"`
	Matcher        string    `json:"matcher" yaml:"matcher"`
	Description    string    `json:"description" yaml:"description"`
	RegexpLeft     string    `json:"regexpLeft" yaml:"regexp-left"`
	RegexpRight    string    `json:"regexpRight" yaml:"regexp-right"`
	CmdGroups      CmdGroups `json:"cmdGroups" yaml:"cmd-groups"`
	FuzzyFinderCmd string    `json:"fuzzyFinderCmd" yaml:"fuzzy-finder-cmd"`
	BufferLeft     string    `json:"bufferLeft" yaml:"buffer-left"`
	BufferRight    string    `json:"bufferRight" yaml:"buffer-right"`
	// contains filtered or unexported fields
}

Rule is a struct representing one rule

type RuleFile added in v0.2.0

type RuleFile struct {
	Path     string
	Basename string
	// contains filtered or unexported fields
}

RuleFile represents one Rule Json file information

func GetAllRuleFiles added in v0.2.0

func GetAllRuleFiles() []*RuleFile

GetAllRuleFiles get all files under $PMY_RULE_PATH configured by environment variable

type Rules added in v0.2.0

type Rules []*Rule

Rules represents slice of `Rule` struct

type SnippetFile added in v0.2.0

type SnippetFile struct {
	Path     string
	Basename string
	Relpath  string
}

SnippetFile represents one Snippet Json file information

func GetAllSnippetFiles added in v0.2.0

func GetAllSnippetFiles() []*SnippetFile

GetAllSnippetFiles get all pmy snippets txt paths configured by environment variable

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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