Emacs Configuration Golang

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

Yesterday saw colleagues again with Emacs, good strong appearance, let me this pseudo emacser envy unceasingly, come back after thinking about again tossing and tossing Emacs.

First download Golang's official Emacs mode:

Http://golang.org/misc/emacs/go-mode.el

Download Auto-complete

http://cx4a.org/software/auto-complete/#Downloads

Then extract the files to any directory: Auto-complete

CD Auto-complete

Make

Make Install

Select the directory you want to install

then Emacs to add in the config file

(Add-to-list ' Load-path "Installpath/auto-complete") (Require ' auto-complete) (Require ' auto-complete-config) (Add-to-list ' ac-dictionary-directories "installpath/auto-complete/ac-dict") (Ac-config-default)
Download Misc/emacs two files from Https://code.google.com/p/go:

Go-mode.el

Go-mode-load.el

and copy these two files into your Emacs config file.

Download Gocode:

Get-u GitHub. com / NSF / Gocode
Set propose -  True
Set Lib -  "/usr/lib/go/pkg/linux_amd64/:your_own_gopath/pkg/linux_amd64"//This is your own path

then modify ~/.profile to set path:

Then the Emacs is added to the config file:

(Require ' go-autocomplete) (Require ' auto-complete-config) (Require ' go-mode-load)

This allows the system to automatically set the environment variables as soon as it is started and runs the Gocode

It is best to reboot, and then start Emacs to open a go file, you can automatically prompt the

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.