This is a creation in Article, where the information may have evolved or changed.
1 Introduction
Listen to the previous blog we introduced the installation, compilation, and operation of Golang, this blog we describe how to set up a vim development environment for Golang. The native vim cannot identify the Golang keyword by itself, and the development environment is like editing plain text files, not highlighting, not to mention auto-complement function. To do this, we need to add the Golang-oriented plug-in vim-go to vim. At the same time, we also need to install Youcompleteme (YCM) According to the Vim-go installation boot.
2 Installing Vundle
Vundle git page listen to Https://github.com/VundleVim/Vundle.vim
Git listen to clone listen Https://github.com/gmarik/Vundle.vim.git listen to ~/.vim/bundle/vundle.vim
3 Installing Vim-go
Vim-go git page https://github.com/fatih/vim-go
Git listen to clone listen Https://github.com/fatih/vim-go.git listen to ~/.vim/bundle/vim-go
4 Installing YCM
YCM git page https://github.com/Valloric/YouCompleteMe
4.1 Pre-conditions
Vim version 7.3.584 above
Installation dependencies
sudo listen to Apt-get listen to install listen to build-essential listen to Cmakesudo listen to Apt-get listen to install listen to Python-dev
4.2 Git clone
Git listen to clone listen Https://github.com/Valloric/YouCompleteMe.git listen to ~/.vim/bundle/youcompleteme
4.3 Compiling the installation
Enter the ~/.vim/bundle/youcompleteme directory and execute
Git listen to submoduleupdate listen to--init listen to--recursive./install.py listen to –clang-completer listen to –gocode-completer
These two commands take a long time to execute, especially the first one, and you can do something else in parallel.
5 Configuration
Edit ~/.VIMRC
"-------------listen to" Vundle listen to "Https://github.com/gmarik/Vundle.vim Listen"------------- Listen to set listen to Theruntime listen to the "include listen to Vundle listen to and listen to initialize listen to Setrtp+=~/.vim/bundle/vundle.vim listen to Callvundle#begin () listen to" Alternatively, listen to the pass listen to the path listen to the where listen to vundle listen to should listen to the install listen to plugins listen to "callvundle#begin (' ~/some/path/here ') listen to hear" Listen to Letvundle listen to manage listen to Vundle, listen to required listen to plugin ' Gmarik/vundle.vim ' Listen listen Listen to thefollowing listen to examples listen to listen to different listen to formats listen to supported. Listen to Keepplugin Listen commands listen to between heard the Vundle#begin/end. Listen. Listen to Pluginon listen to GitHub listen to repo listen "Plugin ' tpope/vim-fugitive ' listen to listen to Pluginfrom listen to http://vim-scripts.org/vim/scripts.html listen" Plugin ' L9 ' listen to Gitplugin hear not hear hosted listen on GitHub listen "Plugin ' git://git.wincent.com/command-t.git ' Listen" Listen to Gitrepos listen to your listen to the local listening machine listening (i.e. listen to working listen to your listen to own listen to Plugin) listen to "Plugin" file:///home/gmarik/path/to/ Plugin ' Listen to Thesparkup listen to Vim listen to the script listen to is listen in listen to a listen to subdirectory listen to this listen to the repo listen to the called Listen to Vim. Listen to the " Listen to Passthe listen to the set listen to listen to the Runtimepath listen to the PROperly. Listen to "Plugin ' rstacruz/sparkup ', listen to {' RTP ': Listen to ' vim/'} Listen" Listen to avoid listen to aname listen to conflict listen to L9 listen "" Plugin ' user/l9 ', listen to {' Name ': Listen to ' newL9 ' listen and listen ' Listen to installvim-go listen to plugin ' fatih/vim-go ' hear ' listen ' Install listen ycmplugin ' Valloric/youcompleteme ' listen Listen to Ofyour listen to plugins listen to must listen to be listen to added listen to before listen to the following listen to the line listen to Callvundle#end () listen to listen to listen to listen to hear listen to listen to hear listen Required Listen to Filetypeplugin listen to listen to indent listen to listen to hear "listen to required listen to listen to Toignore listen to plugin listen indent listen to changes, listen to instead listen to use: Listen to" Filetypeplugin listen to listen to listen to Briefhelp listen to the "listen to listen to listen to":P luginlist listen to listen to hear listen to hear-listen to lists listen to Configuredplugins listen to listen to ": Plugininstall Listen and listen-listen to installs listen to the Plugins;append listen to the update listen to or listen to the just hear: Pluginupdate listen to: Pluginsearch Listen to Foo Listen-listen to searches listen to Foo, listen to append listen '! ' Listen to refresh listen to the local listen to the cache listening: Pluginclean listen to hear-listen to confirms listen to removal listen to ofunused listen to plugins, listen to append hear '! ' Listen to Auto-approve listen to removal listen to ' listen ' listen to hear: Hvundle listen to more listen to details listen to or listen to the wiki listen to the FAQ listen to " Listen to Putyour listen to non-plugin listen to stuff listen to this listen to the line listen to set listen to Smarttabsetshiftwidth=4set listen to tabstop=4setsofttabstop= 4set Listen Expandtabautocmdfiletype Listen to go listen set listen to Expandtab
6 References
Https://github.com/gmarik/Vundle.vim
http://studygolang.com/articles/2927
Https://github.com/fatih/vim-go
http://howiefh.github.io/2015/05/22/vim-install-youcompleteme-plugin/
Https://github.com/Valloric/YouCompleteMe
This article from "Talking Cabbage" blog, declined reprint!