]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - vim/vim/ftplugin/go/go.xpt.vim
50d8e6976a4a7e7a90e3299765f58111a383feb1
[config/dotfiles.git] / vim / vim / ftplugin / go / go.xpt.vim
1 " vim: ft=xpt
2
3 " XPTemplate template file.
4 "
5 " Language:     Go
6 " Maintainer:   Simon Ruderich <simon@ruderich.org>
7 " License:      GPL v3+
8
9 " Copyright (C) 2018  Simon Ruderich
10 "
11 " This file is free software: you can redistribute it and/or modify
12 " it under the terms of the GNU General Public License as published by
13 " the Free Software Foundation, either version 3 of the License, or
14 " (at your option) any later version.
15 "
16 " This file is distributed in the hope that it will be useful,
17 " but WITHOUT ANY WARRANTY; without even the implied warranty of
18 " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 " GNU General Public License for more details.
20 "
21 " You should have received a copy of the GNU General Public License
22 " along with this file.  If not, see <http://www.gnu.org/licenses/>.
23
24
25 " Prevent errors if XPTemplate is not installed.
26 if !exists('g:XPT#ver')
27     finish
28 endif
29
30 XPTemplate priority=personal
31
32
33 XPT f
34 XSET description|post=S(V(), '^description$', 'XXX')
35 // `description^
36
37 // Copyright (C) `strftime("%Y")^  Simon Ruderich
38 //
39 // This program is free software: you can redistribute it and/or modify
40 // it under the terms of the GNU General Public License as published by
41 // the Free Software Foundation, either version 3 of the License, or
42 // (at your option) any later version.
43 //
44 // This program is distributed in the hope that it will be useful,
45 // but WITHOUT ANY WARRANTY; without even the implied warranty of
46 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
47 // GNU General Public License for more details.
48 //
49 // You should have received a copy of the GNU General Public License
50 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
51
52 package main
53
54 import (
55     `imports^
56 )
57
58 func main() {
59     `cursor^
60 }
61
62 XPT ie "if err != nil { ... }
63 if err != nil {
64     `cursor^
65 }
66 XPT ier " if err != nil { return err }
67 if err != nil {
68     return ``ret?`, ^err
69 }
70 `cursor^
71 XPT iel " if err != nil { log.Fatal\(err) }
72 if err != nil {
73     log.Fatal(err)
74 }
75 `cursor^
76
77
78 XPT p
79 fmt.Println(`cursor^)
80 XPT pf
81 fmt.Printf(`cursor^)
82
83 XPT l
84 log.Print(`cursor^)
85 XPT lf
86 log.Printf(`cursor^)