Skip to content

Commit 30012f2

Browse files
jdsutherlandbergercookie
authored andcommitted
Add support for Go
1 parent c599126 commit 30012f2

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ D | :x: | :x:
6363
Dockerfile | :heavy_check_mark: | :heavy_check_mark:
6464
Fish-Shell | :heavy_check_mark: | :heavy_check_mark:
6565
Fortran | :heavy_check_mark: | :heavy_check_mark:
66-
Go | :x: | :x:
66+
Go | :heavy_check_mark: | :heavy_check_mark:
6767
Haskell | :heavy_check_mark: | :heavy_check_mark:
6868
Java | :heavy_check_mark: | :heavy_check_mark:
6969
Javascript | :heavy_check_mark: | :heavy_check_mark:

ftplugin/go.vim

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
function! s:DebugStringFunBase(desc, var)
2+
let l:debug_str = "fmt.Printf(\"" . a:desc . "%+v\\n\", " . a:var . ")"
3+
return l:debug_str
4+
endfunc
5+
6+
command! -buffer -nargs=0 AddDebugString
7+
\ put=s:DebugStringFunBase(g:DebugstringPrefixStr(), g:debugStringCounter)
8+
command! -buffer -nargs=1 AddDebugStringExpr
9+
\ put=s:DebugStringFunBase(<args> . ': ', <args>)

test/basic.vader

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ Execute (Vim):
6262
:set filetype=vim
6363
Execute (Fortran):
6464
:set filetype=fortran
65+
Execute (Go):
66+
:set filetype=go
6567
Execute (Arduino):
6668
:set filetype=arduino
6769
Execute (Makefile):

test/ft/a.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
fmt.Printf("[[Vader-workbench]:$1$] DEBUGGING STRING ==> %+v\n", $2$)
2+
fmt.Printf("a**2 + b**2: %+v\n", a**2 + b**2)

0 commit comments

Comments
 (0)