go.vim: update iabbrevs

This commit is contained in:
Rob Watson 2022-06-09 05:49:33 +02:00
parent 86644d6d69
commit 3f49b0af6e
1 changed files with 6 additions and 7 deletions

View File

@ -51,10 +51,8 @@ let g:go_statusline_duration = 1000
autocmd BufNewFile,BufRead *.go nmap <silent> <leader>g6 :GoAlternate!<cr>
iabbrev fmtpl fmt.Println("")<esc>hi
iabbrev fmtpf fmt.Printf("\n")<esc>3hi
iabbrev mk make([]MyType, 0)<esc>9h
iabbrev wr w http.ResponseWriter, r *http.Request
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>}
@ -62,10 +60,10 @@ 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 logd log.Debug().Msg("
iabbrev logi log.Info().Msg("
iabbrev loge log.Error().Msg("
iabbrev logf log.Fatal().Msg("
iabbrev fmtpf log.Printf("")<esc>hi<c-r>=Eatchar('\s')<cr>
iabbrev fmtpl log.Println("")<esc>hi<c-r>=Eatchar('\s')<cr>
iabbrev logpf log.Printf("")<esc>hi<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
@ -74,3 +72,4 @@ iabbrev gof go 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