Missing goimports does not fallback to gofmt in Vim

301 views
Skip to first unread message

Igor Gatis

unread,
May 12, 2014, 9:58:42 AM5/12/14
to golang-nuts
My .vimrc file looks like this:

filetype off

let g:gofmt_command = 'goimports'
set rtp+=$GOROOT/misc/vim
autocmd FileType go autocmd BufWritePre <buffer> Fmt

filetype plugin indent on


Still, when I call :Fmt, I get:

/bin/bash: goimports: command not found
10 more lines; before #1  0 seconds ago
Gofmt returned error


What am I doing wrong?

Fatih Arslan

unread,
May 12, 2014, 10:13:42 AM5/12/14
to Igor Gatis, golang-nuts
Did you install goimports? You can install it with

go get -u code.google.com/p/go.tools/cmd/goimports
> --
> 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.



--
Fatih Arslan

minux

unread,
May 12, 2014, 11:28:38 AM5/12/14
to Igor Gatis, golang-nuts

i don't think the change you cited added the fallback capabilities.

if you set g:gofmt_command, the gofmt plugin will use that program unconditionally.

Reply all
Reply to author
Forward
0 new messages