zoukankan      html  css  js  c++  java
  • vim golang dev

    1.vundle

    2. Plugin 'fatih/vim-go'

    3 vim +GoInstallBinaries

    4

    cd $GOPATH/src/github.com/nsf/gocode/vim
    ./update.bash
    gocode set propose-builtins true
    gocode set lib-path "/home/anjun/go/path/pkg/linux_amd64"

    .vimrc

    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()
    Plugin 'VundleVim/Vundle.vim'
    Plugin 'fatih/vim-go'
    Plugin 'scrooloose/nerdtree'
    Plugin 'dgryski/vim-godef'
    Plugin 'Blackrush/vim-gocode'
    Plugin 'majutsushi/tagbar'
    Plugin 'Shougo/neocomplete.vim'
    call vundle#end()            " required
    filetype plugin indent on    " required
    " To ignore plugin indent changes, instead use:
    "filetype plugin on
    "
    " Brief help
    " :PluginList       - lists configured plugins
    " :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
    " :PluginSearch foo - searches for foo; append `!` to refresh local cache
    " :PluginClean      - 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
    set number
    let g:go_disable_autoinstall = 0
    let g:neocomplete#enable_at_startup = 1
    colorscheme molokai
    let g:tagbar_type_go = {
        'ctagstype' : 'go',
        'kinds'     : [
            'p:package',
            'i:imports:1',
            'c:constants',
            'v:variables',
            't:types',
            'n:interfaces',
            'w:fields',
            'e:embedded',
            'm:methods',
            'r:constructor',
            'f:functions'
        ],
        'sro' : '.',
        'kind2scope' : {
            't' : 'ctype',
            'n' : 'ntype'
        },
        'scope2kind' : {
            'ctype' : 't',
            'ntype' : 'n'
        },
        'ctagsbin'  : 'gotags',
        'ctagsargs' : '-sort -silent'
        }
    nmap <F8> :TagbarToggle<CR>
    autocmd BufWritePre *.go :Fmt

  • 相关阅读:
    MyEclipse快捷键大全
    重新整理,MyBatis3之Mapper封装
    重新整理,MyBatis3之初步,实体的增加、修改、删除、查询
    VUE学习二十,组件初步component
    SSIS探索之SSIS增量抽取数据
    VS2015 搭建.NET Core 开发环境
    用Middleware给ASP.NET Core Web API添加自己的授权验证
    后端开发都应该了解点接口的压力测试(Apache Bench版)
    基于OpenSSH+WinSCP完成Windows服务器之间的文件传输
    ASP.NET Core Authentication系列(二)实现认证、登录和注销
  • 原文地址:https://www.cnblogs.com/anjuncc/p/5572609.html
Copyright © 2011-2022 走看看