I installed GoFmt with vundle, and a lot of the commands work, such as :GoBuild and :GoRun, but trying :GoFmt and :GoLint gives E492: Not an editor command: GoFmt and the autosave also does not work.
The first-run install thing worked and I have
~ ➤ ls .vim-go
errcheck gocode godef goimports golint oracle
Sorry, I don't know enough about vim plugins to give better error descriptions.
Any ideas on what to try would be appreciated.
Hi Will. First of all there is no plugin such as GoFmt I think you mean there vim-go ? The error you get is a standard Vim error, which indicates that the Command doesnt exist. If you type a random command, such as :RandomCommand123456 you'll get the same error.
However the commands :GoFmt and :GoLint are defined in the code:
https://github.com/fatih/vim-go/blob/master/ftplugin/go/fmt.vim#L58
https://github.com/fatih/vim-go/blob/master/ftplugin/go/lint.vim#L19
I think there is something else wrong here, maybe in your installation. I would get lot's of complaints otherwise that this doesn't work, because it's one of the essentials commands. What OS are you using?
Thanks for pointing out the files. I was able to figure out that none of the files in /ftpluign were being loaded at all, by first trying to put in echos, then later just random gibberish syntax errors. Knowing they weren't even being loaded narrowed it down to my .vimrc.
The issue was my .vimrc I forgot to filetype plugin indent on after you turn it off in the vundle readme. Fixing that made everything work. Thanks
Awesome, glad to hear its being fixed.
Just to note for future people. I was using only: filetype plugin indent on and not doing filetype off before vundle, and it still didn't work. I needed to add filetype off before vundle ran in order to get it all to work properly.
This bit me as well because I had some other go-related filetype settings in my .vimrc. So if you install it to try it out, remember to double-check your vimrc!
:+1: for @jonathanwgoodwin comment, worked for me
Most helpful comment
Just to note for future people. I was using only:
filetype plugin indent onand not doingfiletype offbefore vundle, and it still didn't work. I needed to addfiletype offbefore vundle ran in order to get it all to work properly.