zoukankan      html  css  js  c++  java
  • vim配置go语法高亮

    操作系统 : CentOS7.3.1611_x64

    go 版本 : go1.8.3 linux/amd64

    vim版本 :version 7.4.160

    vim配置go语言语法高亮的问题已经遇到过好几次了,每次都去查找太麻烦,这里总结下。

    安装git:

    yum install git

    安装vim-go :

    cd ~
    mkdir .vim
    mkdir -p ~/.vim/autoload ~/.vim/bundle
    
    curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim

    cd ~/.vim/bundle
    git clone https://github.com/fatih/vim-go vim-go

    配置vimrc文件:

    vim ~/.vimrc
    
    call pathogen#infect()
    syntax enable
    filetype plugin on
    set number
    let g:go_disable_autoinstall = 0

    好,就这些了,希望对你有帮助。

    一次操作完成设置

    执行以下命令即可完成go语法高亮设置:

    mkdir -p ~/.vim/autoload 
    && mkdir -p ~/.vim/plugged 
    && cd ~/.vim/plugged 
    && git clone https://github.com/fatih/vim-go vim-go
    && cd ~/.vim/autoload 
    && wget https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim 
    && cd ~ 
    && tee .vimrc <<-'EOF'
    call plug#begin()
    Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' }
    call plug#end()
    let g:go_version_warning = 0
    EOF
  • 相关阅读:
    69. 二叉树的层次遍历
    17. 子集(Subsets)
    33. N皇后问题(回溯)
    15. 全排列
    53. 数字组合 II
    135. 数字组合
    95. 验证二叉查找树
    88. 最近公共祖先
    245. 子树
    [python应用]python简单图片抓取
  • 原文地址:https://www.cnblogs.com/enumx/p/12304678.html
Copyright © 2011-2022 走看看