Thursday, April 7, 2016

把vim變成go language的編輯器

安裝vim的plugin manager。 apt-vim,以及 pathogen
curl -sL https://raw.githubusercontent.com/egalpin/apt-vim/master/install.sh | sh

用這個指令來看,目前安裝了哪些vim plugin。
apt-vim list
=======================================
安裝 vim-go
$apt-vim install -y https://github.com/fatih/vim-go.git
安裝完之後,會得到syntax highlight 和存檔時自動gofmt的功能。

vim-go要正常作用。需要搭配的.vimrc內容為 (參考)
execute pathogen#infect()
syntax on
filetype plugin indent on
=======================================
安裝好看配色 molokai
$ cd ~/.vim
$ mkdir colors

$ git clone https://github.com/tomasr/molokai

$ mv molokai/colors/molokai.vim ~/.vim/colors/
在 ~/.vimrc裡增加兩行
colorscheme molokai
set t_Co=256