Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install vim-go in linux?

I would best be described as a dabbler at this point in linux/vim. I'm trying to get started with go. Trying to install the vim-go plugin and i'm having issues. Following the following post.

I added the following to the end of my ~/.bashrc file:

export GOPATH=~/gocode
export PATH=$PATH:$GOPATH/bin

and created the following directory ~/gocode

So i created my ~/.vim/bundle & ~/.vim/autoload directories. I downloaded pathogen.vim to the autoload directory. I cloned the github repository for vim-go into the bundle directory which created a vim-go directory.

I created my ~/.vimrc file and added the following:

call pathogen#infect()
syntax enable  
filetype plugin on  
set number  
let g:go_disable_autoinstall = 0

I executed the following from the vim console (which worked after installing Hg):

:GoInstallBinaries

FYI, i don't use vundle and to be honest don't even know what it is :).

So far the plugin doesn't seem to be working. When i type :help vim-go i get the following error: E149: Sorry, no help for vim-go

What am i do

like image 901
coding4fun Avatar asked Oct 10 '14 03:10

coding4fun


People also ask

What is Vim go?

VIM + Plugins = A Powerful IDE for Go Vim is a fast and lightweight text editor available by default with many Linux distributions and Unix-like operating systems. Vim is widely used to quickly edit text files and make configuration changes.

Is Vim good for go?

vim-go offers most of the features you may need when developing in Go, like syntax highlighting and folding, autocompletion support via gopls, code linting, quick execution using :GoRun , and more.

Is NeoVim better than Vim?

The plugin architecture of NeoVim is a lot better than Vim. Apart from plugin implementation in Vimscript (VimL), we can also use the Lua programming language. In addition, NeoVim has a lot more powerful plugins, which are not compatible with Vim.


1 Answers

Using the manual install method (copying vim-go/ to ~/.vim) I was able to get it working but only once I had the following ~/.vimrc file, and of course the Go binaries installed as per the instructions.

set nocompatible
set shell=/bin/sh
syntax on
filetype plugin on
let g:go_disable_autoinstall = 0

This was done on an Ubuntu 14.04 desktop with no other vim plugins or prior ~/.vim directory or ~/.vimrc. Frankly the official install instructions and many of the tutorials out there assume to much to be useful on a fresh install of Ubuntu.

However "help vim-go" was still not working for me. Tried the following command from within the ~/.vim directory and got that working: Vim helptag generation

like image 194
Paul Swanson Avatar answered Oct 07 '22 11:10

Paul Swanson