summaryrefslogtreecommitdiff
path: root/vim/pack/downloads/opt/snippets/snippets.vim
blob: c4362f5313caa0a658e6243335eca8cbd3efe151 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
autocmd FileType go
  \ :iabbrev <buffer> err@ if err != nil {<CR><CR>}<Left><Up><tab>

autocmd FileType go
  \ :iabbrev <buffer> h@ <Backspace><Esc>^ifunc <Esc>A(c *gin.Context) {<CR><CR>}<Left><Up><tab>
	  
autocmd FileType go
  \ :iabbrev <buffer> t@ <Backspace><Esc>^ifunc <Esc>A(t *testing.T) {<CR><CR>}<Left><Up><tab>

autocmd FileType go
  \ :iabbrev <buffer> for@ <Backspace><Esc>^ifor _, <Esc>A {<CR><CR>}<Left><Up><tab>
  
  
autocmd FileType go
  \ :iabbrev <buffer> s@ <Backspace><Esc>^itype <Esc>A struct {<CR><CR>}<Up><tab>

autocmd FileType go
  \ :iabbrev <buffer> f@ <Backspace><Esc>^ifunc <Esc>A() {<CR><CR>}<Esc><Up><Up>f(li

autocmd FileType go
  \ :iabbrev <buffer> fat@ log.Fatal(" %v", err)<Esc>F%i<Left>

:autocmd FileType go
  \ :iabbrev <buffer> if@ if {<CR><CR>}<Esc>%<Left>i


:autocmd FileType php,html.twig,html,javascript,typescript,vue
  \ :iabbrev <buffer> if@ if() {<CR>}<Esc>%<Left><Left>i