Build a Golang environment with sublime text 3 on Ubuntu

Source: Internet
Author: User
Tags sublime text using git
This is a creation in Article, where the information may have evolved or changed. Sublime Text 3 Download:Http://www.sublimetext.com/3
$sudo dpkg-i sublime-text_build---3103$subl

#卸载
$dpkg-R Sublime-text
Registration code:
-–begin license-–michael barnessingle User licenseea7e-8213858a353c41 872a0d5c df9b2950 aff6f667c458ea6d 8ea3c286 98d1d650 131a97abaa919aec ef20e143 b361b1e7 4c8b7f04b085e65e 2F5F5360 8489D422 fb8fc1aa93f6323c fd7f7544 3f39c318 d95e6480fccc7561 8a4a1741 68fa4223 adcede07200c25be DBBC4855 C4CFB774 C5EC138C0FEC1CEF d9dcecec d3a5dad1 01316c36--end license--

Install the package Control

The package control is a good tool for managing plug-ins that can be used to install, delete, and disable the appropriate plugins, which can be found on top of common plugins. Its source address on the Https://github.com/wbond/package_control_channel, installation is very convenient, using Git to clone the code first, and then copied to the ~/.config/sublime-text-3/ Under the packages/directory and named Package control. (You can also pack and download it directly on GitHub, and then unzip it to the ~/.config/sublime-text-3/packages/directory and name it as the package Control).
CD ~/.config/sublime-text-3/packages/
git clone https://github.com/wbond/package_control_channel.git package\ control or open Sublime_text and press the shortcut key CTRL + ' ( ESC key below), enter the following information in the popup command input window to return:
ImportUrllib.request,os,hashlib; h ='2915d1851351e5ee549c20394736b442'+'8bc59f460fa1548d1514676163dafc88'; PF ='Package Control.sublime-package'; IPP = Sublime.installed_packages_path (); Urllib.request.install_opener (Urllib.request.build_opener (Urllib.request.ProxyHandler ())); by = Urllib.request.urlopen ('http://packagecontrol.io/'+ Pf.replace (' ','%20'). read (); DH = hashlib.sha256 (by). Hexdigest ();Print('Error validating download (got%s instead of%s), please try manual install'% (DH, h))ifDH! = hElseOpen (Os.path.join (IPP, PF),'WB'). Write (by)

Restart Sublimetext 3 and you can find the menu item in the Preferences menu under the package Control. We want to install the Gosublime plugin, press and hold ctrl+shift+p will pop up a session box, enter "Install", enter "Gosublime" and "Go Build", select and enter,

Open the package Settings-gosublime-setting-default, copy everything, and paste it into settings-user (this is done to ensure that your changes are not reset by the plugin update, which is frequently updated).

Where Gopath is the path to your program, inside there is a folder bin, pkg, Src. $GOROOT for Go install directory

"env": {
"Gopath": "/local/program/go",
"Goroot": "/local/tools/go"
},

Edit Hello.go in $gopath src,
Package Mainimport ("fmt") Func main () {fmt. Printf ("Hello, world.\n")}

In Tools-build system-go

Let Ctrl + B choose Go Run to see the results at the sublime terminal.

Sublime Text 2 don ' t support Gosublime http://www.sublimetext.com/2 ----- BEGIN LICENSE ----- Andrew Weber  single user license ea7e-855605 813a03dd 5e4ad9e6 6c0eeb94 bc99798f  942194a6 02396e98 e62c9979 4bb979fe 91424c9d a45400bf f6747d88 2fb88078  90F5CC94 1CDC92DC 8457107A F151657B 1D22E383 A997F016 42397640  33f41cfc e1d0ae85 a0bbd039 0e9c8d55 e1b89d5d 5cdb7036 e56de1c0 efcc0840  650CD3A6 B98FC99C 8FAC73EE D2B95564 DF450523 ------ END LICENSE  ------   Installation  gosublime First, we need to install  Sublime Text   Package Control  features, After opening the software, press the shortcut key  ctrl+ ', (' This symbol is in English half-width mode, press the  Tab  key above, the number key 1 left of the button), this time a command window will open, copy and enter the following, and finally return to:  import urllib2,os; pf= ' package control.sublime-package ';  ipp=sublime.installed_packages_ Path ();  os.makedirs (IPP) &nbsP;if not os.path.exists (IPP)  else none; urllib2.install_opener (Urllib2.build_opener ( Urllib2. Proxyhandler ()));  open (Os.path.join (IPP,PF), ' WB '). Write (Urllib2.urlopen (' http://sublime.wbond.net/' + Pf.replace ('   ', '%20 '). Read ()); print  ' please restart sublime text to  Finish installation '

You can find the menu item in the Preferences menu under the package Control. We want to install Gosublime plug-in, press and hold ctrl+shift+p will pop up a session box, in which enter "Install", enter "Gosublime", select and enter, will appear sublime Text 2 no longer support gosublime.

Sublime Text 2 is no longer supported by Gosublime
See Https://github.com/DisposaBoy/GoSublime/blob/master/SUPPORT.md#sublime-text

If you had a *good* reason to not upgrade to Sublime Text 3,
Discuss it here https://github.com/DisposaBoy/GoSublime/issues/689

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.