Skip to content

Instantly share code, notes, and snippets.

@squaredice
Last active July 14, 2018 03:15
Show Gist options
  • Save squaredice/6d76bd4970373956fdc5a4762e68103a to your computer and use it in GitHub Desktop.
Save squaredice/6d76bd4970373956fdc5a4762e68103a to your computer and use it in GitHub Desktop.
Install vim-go
#!/bin/bash
UPDATECOMMAND="apt update"
INSTALLCOMMAND="apt install vim curl git -y"
if [ $UID != 0 ]; then
sudo $UPDATECOMMAND && sudo $INSTALLCOMMAND
else
$UPDATECOMMAND && $INSTALLCOMMAND
fi
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
echo "call plug#begin()
\" Plugins
Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' }
Plug 'AndrewRadev/splitjoin.vim'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'scrooloose/nerdtree'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'tpope/vim-fugitive'
Plug 'raimondi/delimitmate'
call plug#end()
\" Settings
\" vim
set encoding=utf-8
set t_Co=256
set number
\" vim-airline-theme
let g:airline_theme='badwolf'
\" vim-go
set autowrite
let g:go_list_type = \"quickfix\"
let g:go_highlight_fields = 1
let g:go_highlight_functions = 1
let g:go_highlight_function_calls = 1
let g:go_highlight_extra_types = 1
let g:go_highlight_build_constraints = 1
let g:go_highlight_methods = 1
let g:go_highlight_operators = 1
let g:go_highlight_structs = 1
let g:go_highlight_types = 1
let g:go_auto_sameids = 1
let g:go_auto_type_info = 1
let g:go_metalinter_enabled = ['vet', 'golint', 'errcheck']
let g:go_metalinter_autosave = 1" > ~/.vimrc
echo "q" | vim -c 'PlugInstall'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment