vim or emacs for Go

1,084 views
Skip to first unread message

Gour

unread,
Aug 11, 2014, 11:40:04 AM8/11/14
to golan...@googlegroups.com
Hello,

I'm basic user of both Vim and Emacs, but considering that I may switch
from some Emacs-related packages to 3rd party ones, there is no longer
essential to use Emacs for my upcoming Go-related development, so wonder
which editor, iow. Vim or Emacs, is considered to have better support
for Go development?


Sincerely,
Gour

--
As a blazing fire turns firewood to ashes, O Arjuna, so does the
fire of knowledge burn to ashes all reactions to material activities.


Sameer Ajmani

unread,
Aug 11, 2014, 12:52:46 PM8/11/14
to Gour, golang-nuts

Use whichever you prefer.  There is good Go support for both of those editors, and others.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Saul Hazledine

unread,
Aug 11, 2014, 3:57:44 PM8/11/14
to golan...@googlegroups.com, go...@atmarama.net
Hello,


On Monday, 11 August 2014 17:40:04 UTC+2, Gour wrote:

I'm basic user of both Vim and Emacs, but considering that I may switch
from some Emacs-related packages to 3rd party ones, there is no longer
essential to use Emacs for my upcoming Go-related development, so wonder
which editor, iow. Vim or Emacs, is considered to have better support
for Go development?

In other languages I am usually a vim user but I have been using emacs for Go programming with the 'vimpulse'  package to get vi key bindings. Emacs support is really good at the moment and I found this article very useful:

http://dominik.honnef.co/posts/2013/03/writing_go_in_emacs/

I haven't used vim together with go for a long time and so I cannot say much about current vim support.

Saul Hazledine

Gour

unread,
Aug 11, 2014, 4:11:50 PM8/11/14
to golan...@googlegroups.com
Saul Hazledine <sha...@gmail.com> writes:

> In other languages I am usually a vim user but I have been using emacs for
> Go programming with the 'vimpulse' package to get vi key bindings. Emacs
> support is really good at the moment and I found this article very useful:
>
> http://dominik.honnef.co/posts/2013/03/writing_go_in_emacs/

I did read that article and configured Emacs according to it...must say
it looks good.

However, if I'm going to use Vim for other stuff, I'm curious if Vim
support for Go is on par with it?

--
One who is not disturbed in mind even amidst the threefold
miseries or elated when there is happiness, and who is free
from attachment, fear and anger, is called a sage of steady mind.

Fatih Arslan

unread,
Aug 11, 2014, 4:17:32 PM8/11/14
to golang-nuts
Yes it is, have a look (it has most of the features):

https://github.com/fatih/vim-go

The emacs mode is a pretty good one too. I think all editor plugins (Vim, Emacs, Sublime, ..) are in a good shape now. Just use one that you feel you're good at it :)

--
Fatih Arslan

wkharold

unread,
Aug 11, 2014, 5:13:12 PM8/11/14
to golan...@googlegroups.com, fa...@arslan.io
I can vouch for the vim-go plugin. Add NERDTree (https://github.com/scrooloose/nerdtree) and you've got a nice go IDE.

David Symonds

unread,
Aug 11, 2014, 11:20:17 PM8/11/14
to Fatih Arslan, golang-nuts
As the original author and maintainer of the misc/vim editor
integration for Go, I can endorse github.com/fatih/vim-go. It's not
perfect, but it's usable (it's what I'm using), and is the logical
successor to misc/vim.

ma...@govx.com

unread,
Aug 12, 2014, 12:16:30 AM8/12/14
to golan...@googlegroups.com, go...@atmarama.net
My buddy swears by Sublime and it has a vintage (vi) mode. 

I can vouch for vim + fatih/vim-go. My only dislike for vim is on Windows; there is not yet a good alternative for the_silver_searcher (ag). The platinum searcher is close but it doesn't support --columns which breaks the search plugins I use.

Gour

unread,
Aug 12, 2014, 2:51:52 AM8/12/14
to golan...@googlegroups.com
On Mon, 11 Aug 2014 21:16:30 -0700 (PDT)
ma...@govx.com wrote:

> My buddy swears by Sublime and it has a vintage (vi) mode.

I did try Sublime some time ago and I can affirm it's quite usable out of the
box, but I simply do not like depending on proprietary software for app like
editor.

There is a clone written in Go (https://github.com/limetext/lime), but it is
not ready yet.


Sincerely,
Gour

--
The work of a man who is unattached to the modes of material
nature and who is fully situated in transcendental knowledge
merges entirely into transcendence.


Gour

unread,
Aug 12, 2014, 2:59:33 AM8/12/14
to golan...@googlegroups.com
On Tue, 12 Aug 2014 13:20:02 +1000
David Symonds <dsym...@golang.org> wrote:

> As the original author and maintainer of the misc/vim editor
> integration for Go, I can endorse github.com/fatih/vim-go. It's not
> perfect, but it's usable (it's what I'm using), and is the logical
> successor to misc/vim.

Thank you all!

I see that Vim is quite popular for Gophers, so it seems it is a good choice.

Daniel Skinner

unread,
Aug 12, 2014, 1:21:27 PM8/12/14
to Gour, golang-nuts
ive used all three, and they are all three quite usable. I had to disable function syntax highlighting for vim due to scrolling lag on my large monitor but it's a fine choice, especially if you're familiar with vim. Personally I prefer emacs (and I'm not even an emacs user).


ma...@govx.com

unread,
Aug 12, 2014, 1:56:31 PM8/12/14
to golan...@googlegroups.com, go...@atmarama.net
These two VIM settings alleviate most syntax coloring lag

" disable current line highlighting
set nocursorline

" syntax color up to column 128
set synmaxcol=128

Daniel Skinner

unread,
Aug 12, 2014, 2:00:04 PM8/12/14
to ma...@govx.com, golang-nuts, Gour
thanks for the tip, i'll give it a shot as I still use vim from term for quick edits of things im not actively working on


Milan P. Stanic

unread,
Aug 12, 2014, 2:31:56 PM8/12/14
to golan...@googlegroups.com
On Tue, 2014-08-12 at 08:59, Gour wrote:
> On Tue, 12 Aug 2014 13:20:02 +1000
> David Symonds <dsym...@golang.org> wrote:
> > As the original author and maintainer of the misc/vim editor
> > integration for Go, I can endorse github.com/fatih/vim-go. It's not
> > perfect, but it's usable (it's what I'm using), and is the logical
> > successor to misc/vim.
> Thank you all!
>
> I see that Vim is quite popular for Gophers, so it seems it is a good choice.

There were old saying which I forgot how it goes exactly but I remember
it was something like 'Unix is the OS name and VI is the synonym'.

--
Kind regards, Milan

Nick Craig-Wood

unread,
Aug 12, 2014, 6:44:25 PM8/12/14
to Gour, golan...@googlegroups.com
On 11/08/14 16:39, Gour wrote:
> I'm basic user of both Vim and Emacs, but considering that I may switch
> from some Emacs-related packages to 3rd party ones, there is no longer
> essential to use Emacs for my upcoming Go-related development, so wonder
> which editor, iow. Vim or Emacs, is considered to have better support
> for Go development?

Whichever you choose, make sure you take the time to install goimports -
that has really made a huge difference to my productivity (in emacs).

--
Nick Craig-Wood <ni...@craig-wood.com> -- http://www.craig-wood.com/nick

Herbert Fischer

unread,
Aug 12, 2014, 7:59:57 PM8/12/14
to Nick Craig-Wood, Gour, golang-nuts
Take a look at my vim setup for Go and other languages. It is pretty straightforward to use: 


You will need vim compiled with lua support (vim-nox in Ubuntu), since I use neocomplete.


Sam Fourman Jr.

unread,
Aug 12, 2014, 8:12:45 PM8/12/14
to Herbert Fischer, golan...@googlegroups.com, Nick Craig-Wood, Gour

I use vim for go development, I use the faith/vim-go it works well, the only thing I wish is, I want to turn off the syntax checking when you save the file. But other than that its good.

Sam Fourman Jr.

jkwon...@gmail.com

unread,
Aug 12, 2014, 10:06:52 PM8/12/14
to golan...@googlegroups.com, herbert...@gmail.com, ni...@craig-wood.com, go...@atmarama.net
On Tuesday, August 12, 2014 5:12:45 PM UTC-7, Sam Fourman Jr. wrote:

I use vim for go development, I use the faith/vim-go it works well, the only thing I wish is, I want to turn off the syntax checking when you save the file. But other than that its good.


The default behavior of calling GoImports was too slow for me, strangely taking up to 20 seconds for some files, despite repeated edit/saving.  When I run GoImports on the command line, it would be quick.  Are you experiencing the same problem?

I ended up changing the GoImports command to simply use "go fmt", which speeded up the write process.

Any idea on how to speed up "go imports" from vim-go?

David Symonds

unread,
Aug 13, 2014, 2:53:27 AM8/13/14
to Sam Fourman Jr., Herbert Fischer, golang-nuts, Nick Craig-Wood, Gour
On 13 August 2014 10:12, Sam Fourman Jr. <sfou...@gmail.com> wrote:

> I use vim for go development, I use the faith/vim-go it works well, the only
> thing I wish is, I want to turn off the syntax checking when you save the
> file. But other than that its good.

By "checking" you mean running the file through gofmt? I don't know
why you would want to turn that off, add
let g:go_fmt_autosave = 0
to your .vimrc.

Gour

unread,
Aug 14, 2014, 4:07:45 AM8/14/14
to golan...@googlegroups.com
On Tue, 12 Aug 2014 20:59:18 -0300
Herbert Fischer
<herbert...@gmail.com> wrote:

> Take a look at my vim setup for Go and other languages. It is pretty
> straightforward to use:

Thanks a lot...very nice list of potential vim plugins to use.


> You will need vim compiled with lua support (vim-nox in Ubuntu),
> since I use neocomplete.

No problem - Vim in Sid is built as 'huge'.


Sincerely,
Gour

--
The senses, the mind and the intelligence are the sitting places
of this lust. Through them lust covers the real knowledge of the
living entity and bewilders him.


Gour

unread,
Aug 25, 2014, 2:03:18 AM8/25/14
to golan...@googlegroups.com
On Mon, 11 Aug 2014 23:17:03 +0300
Fatih Arslan <fa...@arslan.io> wrote:

> Yes it is, have a look (it has most of the features):
>
> https://github.com/fatih/vim-go

I've problem with it...installed via NeoBundle and then when I launch
some file.go even syntax high. does not work.

:h vim-go

says: "Sorry, no help for vim-go".

I see that vim-go is fetched under my 'bundle' folder.

Do I need to install gocode before, although I see that there are
several binaries installed uner ~/.vim-go?

$ls -l
~/.vim-go/ total 40328
-rwxr-xr-x 1 gour gour 5286192 Kol 25 07:55 errcheck*
-rwxr-xr-x 1 gour gour 9753656 Kol 25 07:55 gocode*
-rwxr-xr-x 1 gour gour 5635568 Kol 25 07:55 godef*
-rwxr-xr-x 1 gour gour 4905360 Kol 25 07:55 goimports*
-rwxr-xr-x 1 gour gour 3659880 Kol 25 07:55 golint*
-rwxr-xr-x 1 gour gour 2858184 Kol 25 07:55 gotags*
-rwxr-xr-x 1 gour gour 9185240 Kol 25 07:55 oracle*

Any hint?

Sincerely,
Gour

--
As a lamp in a windless place does not waver, so the transcendentalist,
whose mind is controlled, remains always steady in his meditation on
the transcendent self.


Gour

unread,
Aug 25, 2014, 5:07:11 AM8/25/14
to golan...@googlegroups.com
On Mon, 25 Aug 2014 08:02:45 +0200
Gour <go...@atmarama.net> wrote:

> I've problem with it...installed via NeoBundle and then when I launch
> some file.go even syntax high. does not work.

The problem was with NeoBundle. After switching to Vundle, everything
seems to be OK.


Sincerely,
Gour

--
The embodied soul may be restricted from sense enjoyment,
though the taste for sense objects remains. But, ceasing
such engagements by experiencing a higher taste,
he is fixed in consciousness.


Reply all
Reply to author
Forward
0 new messages