Documentation ¶
Index ¶
- Constants
- Variables
- func GenScript(shell, fnName string) (string, error)
- func IsStatusAdd(st int) bool
- func IsSupported(name string) bool
- type Metadata
- func (m *Metadata) AddHistory(dirPath string) (string, bool)
- func (m *Metadata) AddNamed(name string, pathStr string) (ok bool)
- func (m *Metadata) AddNamedPaths(pathMap map[string]string) (ok bool)
- func (m *Metadata) CheckOrMatch(keywords []string) string
- func (m *Metadata) CleanHistories() (ss []string)
- func (m *Metadata) FormatKeywords(keywords []string) []string
- func (m *Metadata) Search(keywords []string, limit int, withName bool) []string
- func (m *Metadata) SearchByString(keywords string, limit int, withName bool) []string
- func (m *Metadata) SearchHistory(keywords []string, limit int) []string
- func (m *Metadata) SearchNamed(keywords []string, limit int, withName bool) []string
- type QuickJump
Constants ¶
View Source
const ( StatusErr = iota StatusAdd // new add StatusRpt // repeat add )
View Source
const ( ShellBash = "bash" ShellZsh = "zsh" ShellFish = "fish" // TODO )
Variables ¶
View Source
var JumpBashTpl = `` /* 1116-byte string literal not displayed */
JumpBashTpl is the bash template for quick jump
View Source
var JumpZshTpl = `` /* 1255-byte string literal not displayed */
JumpZshTpl is the zsh template for quick jump
View Source
var ShellTplMap = map[string]string{ ShellBash: JumpBashTpl, ShellZsh: JumpZshTpl, }
ShellTplMap shell templates
Functions ¶
Types ¶
type Metadata ¶
type Metadata struct { Datetime string `json:"datetime"` LastPath string `json:"last_path"` PrevPath string `json:"prev_path"` NamedPaths map[string]string `json:"named_paths"` Histories map[string]string `json:"histories"` // contains filtered or unexported fields }
Metadata struct for quick jump
func (*Metadata) AddHistory ¶
AddHistory add history path
func (*Metadata) AddNamedPaths ¶
AddNamedPaths add named path
func (*Metadata) CheckOrMatch ¶
CheckOrMatch path by input keywords(name,path,...)
func (*Metadata) CleanHistories ¶
CleanHistories refresh histories, remove invalid paths
func (*Metadata) FormatKeywords ¶
FormatKeywords handle
func (*Metadata) SearchByString ¶
SearchByString search named paths and history paths
func (*Metadata) SearchHistory ¶
SearchHistory named paths
type QuickJump ¶
type QuickJump struct { *Metadata `json:"-"` common.PathResolver // DataDir is data dir for save metadata files. DataDir string `json:"data_dir"` // CheckExist check path is exists CheckExist bool `json:"check_exist"` // SlashPath if true, will replace the path separator to slash // // - Useful on Windows SlashPath bool `json:"slash_path"` // NamedPaths pre-define named paths NamedPaths map[string]string `json:"named_paths"` // contains filtered or unexported fields }
QuickJump struct
Click to show internal directories.
Click to hide internal directories.