Wednesday, 15 July 2015

vim - UltiSnips not completing all the placeholders -



vim - UltiSnips not completing all the placeholders -

how write simple snippet placeholder value replaced @ both places.

snippet test "test struct" type ${1} struct { id string } func (p *${1}) id() string { homecoming p.id } endsnippet

so when type test<tab>, needs prompt entering 1 value results in (if come in xyz)

type xyz struct { id string } func (p *xyz) id() string { homecoming p.id }

there conflict other plugins in system, when trigger snippet, cursor moves sec placeholder (at func (p *${1}) id() string {), , never completes first one.

remove braces around sec {1} (and, maybe, add together default text first placeholder pointed out ingo karkat):

snippet test "test struct" type ${1:foo} struct { id string } func (p *$1) id() string { homecoming p.id } endsnippet

vim ultisnips

No comments:

Post a Comment