示例#1
0
文件: doc.go 项目: garyburd/vigor
func NewManager(p *plugin.Plugin) *Manager {
	m := &Manager{nvim: p.Nvim, docs: make(map[int]*data), highlights: make(map[nvim.Window]*windowHighlight)}
	p.Handle("doc.onUpdateHighlight", m.onUpdateHighlight)
	p.Handle("doc.onBufDelete", m.onBufDelete)
	p.Handle("doc.onJump", m.onJump)
	return m
}
示例#2
0
文件: explore.go 项目: garyburd/vigor
func Register(p *plugin.Plugin) {
	e := &explorer{docm: doc.NewManager(p), nvim: p.Nvim}
	p.HandleCommand(&plugin.CommandOptions{Name: "Godoc", NArgs: "*", Complete: "customlist,QQQDocComplete", Eval: "*"}, e.onDoc)
	p.HandleCommand(&plugin.CommandOptions{Name: "Godef", NArgs: "*", Complete: "customlist,QQQDocComplete", Eval: "*"}, e.onDef)
	p.HandleFunction(&plugin.FunctionOptions{Name: "QQQDocComplete", Eval: "*"}, e.onComplete)
	p.HandleAutocmd(&plugin.AutocmdOptions{Event: "BufReadCmd", Pattern: bufNamePrefix + "**", Eval: "*"}, e.onBufReadCmd)
}
示例#3
0
文件: format.go 项目: garyburd/vigor
func Register(p *plugin.Plugin) {
	p.HandleCommand(&plugin.CommandOptions{Name: "Fmt", Range: "%", Eval: "*"}, format)
}