Skip to content

Commit

Permalink
snippets: improve UltiSnips to pick Visual selections
Browse files Browse the repository at this point in the history
  • Loading branch information
fatih committed Jan 31, 2015
1 parent 07f95f0 commit cf4e7ab
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions gosnippets/UltiSnips/go.snippets
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ endsnippet
# anonymous function
snippet anon "fn := func() { ... }"
${1:fn} := func() {
${0}
${2:${VISUAL}}
}
${0}
endsnippet

# append
Expand Down Expand Up @@ -192,7 +193,7 @@ endsnippet

# Fmt Printf debug
snippet ff "fmt.Printf(...)"
fmt.Printf("${1} = %+v\n", $1)
fmt.Printf("${1:${VISUAL}} = %+v\n", $1)
endsnippet

# Fmt Println debug
Expand Down Expand Up @@ -294,8 +295,9 @@ endsnippet
# goroutine anonymous function
snippet gof "go func() { ... }()"
go func() {
${1}
${1:${VISUAL}}
}()
${0}
endsnippet

# test function
Expand Down

0 comments on commit cf4e7ab

Please sign in to comment.