vim 安裝vim-go 打造GOLANG 專用IDE

來源:互聯網
上載者:User
這是一個建立於 的文章,其中的資訊可能已經有所發展或是發生改變。

分兩步:

第一步:安裝vim外掛程式管理器Vundle

第二步:安裝vim-go外掛程式。

另外:我也寫了一個自動安裝的指令碼。手懶的朋友,可以自行下載使用:https://github.com/aimin/InstallvimGo.git

---------------------------------------------------------------------------------------

開始:

第一步:安裝Vundle

根據Vundle的安裝說明,首先安裝Vundle:

$ git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim

然後對.vimrc進行配置,將Vundle的相關配置置在最開始處,下面只顯示關於Vundle的相關配置:

對.vimrc進行配置,將Vundle的相關配置置在最開始處,下面只顯示關於Vundle的相關配置(詳細參考Vundle的README.MD):

  1. " -------------  
  2. " Vundle  
  3. " https://github.com/gmarik/Vundle.vim  
  4. " -------------  
  5.   
  6. set nocompatible              " be iMproved, required  
  7. filetype off                  " required  
  8.   
  9. " set the runtime path to include Vundle and initialize  
  10. set rtp+=~/.vim/bundle/Vundle.vim  
  11. call vundle#begin()  
  12. " alternatively, pass a path where Vundle should install plugins  
  13. "call vundle#begin('~/some/path/here')  
  14.   
  15. " let Vundle manage Vundle, required  
  16. Plugin 'gmarik/Vundle.vim'  
  17.   
  18. " The following are examples of different formats supported.  
  19. " Keep Plugin commands between vundle#begin/end.  
  20. " plugin on GitHub repo  
  21. ""Plugin 'tpope/vim-fugitive'  
  22. " plugin from http://vim-scripts.org/vim/scripts.html  
  23. ""Plugin 'L9'  
  24. " Git plugin not hosted on GitHub  
  25. ""Plugin 'git://git.wincent.com/command-t.git'  
  26. " git repos on your local machine (i.e. when working on your own plugin)  
  27. ""Plugin 'file:///home/gmarik/path/to/plugin'  
  28. " The sparkup vim script is in a subdirectory of this repo called vim.  
  29. " Pass the path to set the runtimepath properly.  
  30. ""Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}  
  31. " Avoid a name conflict with L9  
  32. ""Plugin 'user/L9', {'name': 'newL9'}  
  33.   
  34. " Install Vim-go  
  35. Plugin 'fatih/vim-go'  
  36.   
  37. " All of your Plugins must be added before the following line  
  38. call vundle#end()            " required  
  39. filetype plugin indent on    " required  
  40. " To ignore plugin indent changes, instead use:  
  41. "filetype plugin on  
  42. "  
  43. " Brief help  
  44. " :PluginList       - lists configured plugins  
  45. " :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate  
  46. " :PluginSearch foo - searches for foo; append `!` to refresh local cache  
  47. " :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal  
  48. "  
  49. " see :h vundle for more details or wiki for FAQ  
  50. " Put your non-Plugin stuff after this line 

第二步:安裝vim-go (詳細查看vim-go的README.MD)

git clone https://github.com/fatih/vim-go.git ~/.vim/bundle/vim-go 注意路徑
在上述~/.vimrc裡增加下面一行。
Plugin 'fatih/vim-go'

至此安裝完成。
開啟.go 檔案看看效果吧!


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.