From: Simon Ruderich Date: Sat, 14 Jul 2018 12:20:30 +0000 (+0200) Subject: vim: xptemplate: add more go snippets X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=a714fb6097aa86bcd16bc2ffa6b05b641591c0e4;p=config%2Fdotfiles.git vim: xptemplate: add more go snippets --- diff --git a/vim/vim/ftplugin/go/go.xpt.vim b/vim/vim/ftplugin/go/go.xpt.vim index b3af56c..50d8e69 100644 --- a/vim/vim/ftplugin/go/go.xpt.vim +++ b/vim/vim/ftplugin/go/go.xpt.vim @@ -59,14 +59,28 @@ func main() { `cursor^ } +XPT ie "if err != nil { ... } +if err != nil { + `cursor^ +} XPT ier " if err != nil { return err } if err != nil { return ``ret?`, ^err } `cursor^ - XPT iel " if err != nil { log.Fatal\(err) } if err != nil { log.Fatal(err) } `cursor^ + + +XPT p +fmt.Println(`cursor^) +XPT pf +fmt.Printf(`cursor^) + +XPT l +log.Print(`cursor^) +XPT lf +log.Printf(`cursor^)