Skip to content

Instantly share code, notes, and snippets.

@benmills
Created December 17, 2012 20:34
Show Gist options
  • Save benmills/4321941 to your computer and use it in GitHub Desktop.
Save benmills/4321941 to your computer and use it in GitHub Desktop.
Include in `/.vim/ftplugin/go.vim`
function! GolangCurrentPackage()
let packageLine = search("package", "s")
''
let packageName = split(getline(packageLine), " ")[1]
return packageName
endfunction
function! GolangTestCurrentPackage()
call VimuxRunCommand("clear;go test " . GolangCurrentPackage())
endfunction
map <silent> <LocalLeader>rb :wa<CR> :call RunTests()<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment