29 lines
1.3 KiB
VimL

nnoremap <silent> <leader>_ ciw_<esc>b
iabbrev mk make([]MyType, 0)<esc>9h
iabbrev wr w http.ResponseWriter, r *http.Request<c-r>=Eatchar('\s')<cr>
iabbrev ttt t *testing.T
iabbrev errP <esc>ccif err != nil {<cr>panic(err)<cr>}
iabbrev errl <esc>ccif err != nil {<cr>log.Println(err)<cr>}
iabbrev errf <esc>ccif err != nil {<cr>log.Fatal(err)<cr>}
iabbrev errp <esc>ccif err != nil {<cr>fmt.Println(err)<cr>}
iabbrev errr <esc>ccif err != nil {<cr>return err<cr>}
iabbrev defr <esc>ccdefer func() {<cr><cr>}()<esc>ki
iabbrev fmtpf fmt.Printf("\n")<esc>3hi<c-r>=Eatchar('\s')<cr>
iabbrev fmtpl fmt.Println("")<esc>hi<c-r>=Eatchar('\s')<cr>
iabbrev fmterr fmt.Errorf(": %s", err)<esc>10hi<c-r>=Eatchar('\s')<cr>
iabbrev logpf log.Printf("\n")<esc>3hi<c-r>=Eatchar('\s')<cr>
iabbrev logpl log.Println("")<esc>hi<c-r>=Eatchar('\s')<cr>
iabbrev ctxcc ctx context.Context
iabbrev err! err != nil {<cr><cr>}<esc>kcc<c-r>=Eatchar('\s')<cr>
iabbrev ior io.Reader
iabbrev iorc io.ReadCloser
iabbrev iow io.Writer
iabbrev gfnc go func() {<cr><cr>}()<esc>kcc<c-r>=Eatchar('\s')<cr>
iabbrev fnc func() {<cr><cr>}<esc>kcc<c-r>=Eatchar('\s')<cr>
iabbrev fortc for _, tc := range testCases {<cr>t.Run(tc.name, func(t *testing.T) {<cr><cr>})<cr>}<esc>kkcc<c-r>=Eatchar('\s')<cr>
iabbrev mapss map[string]string
iabbrev mapsi map[string]int
iabbrev mapsa map[string]any
iabbrev mapaa map[any]any