go and vim-go

sudo apt-get install golang golang-golang-x-tools golint
  • set GOPATH in .bashrc, such as ~/go, where bin, pkg, src will be put
  • use vundle to download vim-go from
    https://github.com/fatih/vim-go
  • In vim, run :GoInstallBinaries
    It will complain unable to download some, but so far it is enough for most functionalities.
    Saving a .go file will invoke gofmt.
    ^x^o to auto complete
    :GoDef
    :GoBuild
    :GoInstall
    :GoTest
    :GoRun
    :GoPath
    :GoLint
    :GoImport package_name
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章