This is a creation in Article, where the information may have evolved or changed.
In two steps:
First step: Install the Vim plugin manager vundle
Step Two: Install the Vim-go plugin.
In addition: I have also written an automatic installation of the script. Lazy friend, you can download it by yourself: https://github.com/aimin/InstallvimGo.git
---------------------------------------------------------------------------------------
Begin:
First step: Install Vundle
According to Vundle installation instructions, first install the Vundle:
$ git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
The. VIMRC is then configured to place the relevant configuration of the Vundle at the very beginning, and only the relevant configuration about Vundle is shown below:
Configure the. VIMRC to place the relevant configuration of the Vundle at the very beginning, and only the relevant configuration for Vundle is shown below (detailed reference Vundle readme.md):
- " -------------
- "Vundle
- "https://github.com/gmarik/vundle.vim
- " -------------
- Set nocompatible "be improved, required
- FileType off "required
- Set the runtime path to include Vundle and initialize
- Set Rtp+=~/.vim/bundle/vundle.vim
- Call Vundle#begin ()
- "Alternatively, pass a path where Vundle should install plugins
- "Call Vundle#begin (' ~/some/path/here ')
- "Let Vundle manage Vundle, required
- Plugin ' Gmarik/vundle.vim '
- "The following is examples of different formats supported.
- "Keep Plugin commands between vundle#begin/end.
- "Plugin on GitHub repo
- "" Plugin ' tpope/vim-fugitive '
- "Plugin from http://vim-scripts.org/vim/scripts.html
- "" Plugin ' L9 '
- "Git plugin not hosted on GitHub
- "" Plugin ' Git://git.wincent.com/command-t.git '
- "Git repos on your local machine (i.e. if working on your own plugin)
- "" Plugin ' File:///home/gmarik/path/to/plugin '
- The sparkup vim script is in a subdirectory of this repo called vim.
- "Pass the path to set the Runtimepath properly.
- "" Plugin ' Rstacruz/sparkup ' , {' RTP ': ' vim/'}
- "Avoid a name conflict with L9
- "" Plugin ' User/l9 ' , {' name ': ' newL9 '}
- "Install vim-go
- Plugin ' fatih/vim-go '
- "All of your Plugins must is added before the following line
- Call Vundle#end () "Required
- FileType plugin indent on "required
- "To ignore plugin indent changes, instead use:
- "FileType plugin on
- "
- "Brief Help
- ":P luginlist-lists configured Plugins
- ":P Lugininstall-installs plugins; Append '! ' to update or just:P luginupdate
- ":P luginsearch foo-searches for foo; Append '! ' to refresh local cache
- ":P luginclean-confirms removal of unused plugins; Append '! ' to auto-approve removal
- "
- "See:h Vundle for more details or wiki for FAQ
- "Put your non-plugin stuff after this line
Step Two: Install Vim-go (View Vim-go's readme.md in detail)
git clone https://github.com/fatih/vim-go.git ~/.vim/bundle/vim-go
Note the path
在上述~/.vimrc里增加下面一行。
Plugin 'fatih/vim-go'
至此安装完成。
打开.go 文件看看效果吧!