2014-11-11 20:56:27 +00:00
|
|
|
set nocompatible " be iMproved, required
|
|
|
|
filetype off " required
|
|
|
|
|
2015-01-14 11:12:25 +00:00
|
|
|
" Disable bell
|
|
|
|
set vb
|
|
|
|
|
2014-11-21 19:56:52 +00:00
|
|
|
" Ensure vim knows about Go(lang)
|
2014-11-21 19:54:02 +00:00
|
|
|
set rtp+=$GOROOT/misc/vim
|
|
|
|
|
2014-11-11 20:56:27 +00:00
|
|
|
" set the runtime path to include Vundle and initialize
|
|
|
|
set rtp+=~/.vim/bundle/Vundle.vim
|
|
|
|
call vundle#begin()
|
|
|
|
|
2015-06-20 11:42:12 +01:00
|
|
|
" Plugins
|
2014-11-11 20:56:27 +00:00
|
|
|
Plugin 'tpope/vim-fugitive'
|
2014-11-11 21:43:07 +00:00
|
|
|
Plugin 'tpope/vim-commentary'
|
2014-11-11 21:51:41 +00:00
|
|
|
Plugin 'tpope/vim-surround'
|
2014-11-11 20:56:27 +00:00
|
|
|
Plugin 'scrooloose/syntastic'
|
2014-11-11 21:52:13 +00:00
|
|
|
Plugin 'scrooloose/nerdtree'
|
2015-10-26 20:32:51 +00:00
|
|
|
Plugin 'itchyny/lightline.vim'
|
|
|
|
Plugin 'w0ng/vim-hybrid'
|
|
|
|
Plugin 'cocopon/lightline-hybrid.vim'
|
2014-11-11 22:01:25 +00:00
|
|
|
Plugin 'Shougo/neocomplcache.vim'
|
2014-11-11 22:03:45 +00:00
|
|
|
Plugin 'kien/ctrlp.vim'
|
2014-11-12 07:04:37 +00:00
|
|
|
Plugin 'rodjek/vim-puppet'
|
2014-11-13 19:27:26 +00:00
|
|
|
Plugin 'godlygeek/tabular'
|
2014-11-16 13:33:13 +00:00
|
|
|
Plugin 'ap/vim-buftabline'
|
2014-11-30 10:04:58 +00:00
|
|
|
Plugin 'vim-scripts/WhiteWash'
|
2015-04-22 15:22:54 +01:00
|
|
|
Plugin 'jistr/vim-nerdtree-tabs'
|
2014-11-11 20:56:27 +00:00
|
|
|
|
|
|
|
" All of your Plugins must be added before the following line
|
|
|
|
call vundle#end() " required
|
|
|
|
filetype plugin indent on " required
|
|
|
|
|
2015-10-26 20:32:51 +00:00
|
|
|
" Hybrid color scheme
|
|
|
|
let g:hybrid_use_Xresources = 1
|
|
|
|
set background=dark
|
|
|
|
colorscheme hybrid
|
2014-11-11 20:56:27 +00:00
|
|
|
|
2014-11-11 21:32:48 +00:00
|
|
|
" Tabs and indents
|
2014-11-11 20:56:27 +00:00
|
|
|
set tabstop=4
|
|
|
|
set shiftwidth=4
|
|
|
|
set softtabstop=4
|
|
|
|
set smarttab
|
|
|
|
set expandtab
|
2014-11-11 21:24:00 +00:00
|
|
|
|
|
|
|
" Always use vertical diffs
|
|
|
|
set diffopt+=vertical
|
|
|
|
|
2014-11-11 21:32:48 +00:00
|
|
|
" Syntax highlighting
|
2014-11-11 20:56:27 +00:00
|
|
|
syntax on
|
2014-11-11 21:32:48 +00:00
|
|
|
|
|
|
|
" NERDTree
|
|
|
|
map <C-n> :NERDTreeToggle<CR>
|
2014-11-11 22:01:25 +00:00
|
|
|
|
|
|
|
" Autocomplete
|
|
|
|
let g:neocomplcache_enable_at_startup = 1
|
2014-11-12 07:20:47 +00:00
|
|
|
|
2014-11-15 17:05:36 +00:00
|
|
|
" Set filetypes
|
2014-11-12 07:20:47 +00:00
|
|
|
au BufRead,BufNewFile *.md set filetype=markdown
|
2014-11-15 17:05:36 +00:00
|
|
|
au BufRead,BufNewFile *.go set filetype=go
|
2015-10-26 20:32:51 +00:00
|
|
|
|
|
|
|
" Lightline
|
|
|
|
set laststatus=2
|
|
|
|
let g:lightline = {
|
2015-10-26 20:52:22 +00:00
|
|
|
\ 'colorscheme': 'hybrid',
|
|
|
|
\ 'active': {
|
|
|
|
\ 'left': [ [ 'mode', 'paste' ],
|
|
|
|
\ [ 'fugitive', 'readonly', 'filename', 'modified' ] ]
|
|
|
|
\ },
|
|
|
|
\ 'component_function': {
|
|
|
|
\ 'fugitive': 'LightLineFugitive',
|
|
|
|
\ 'readonly': 'LightLineReadonly',
|
|
|
|
\ 'modified': 'LightLineModified',
|
|
|
|
\ 'filename': 'LightLineFilename'
|
|
|
|
\ },
|
|
|
|
\ 'mode_map': {
|
|
|
|
\ 'n' : 'N',
|
|
|
|
\ 'i' : 'I',
|
|
|
|
\ 'R' : 'R',
|
|
|
|
\ 'v' : 'V',
|
|
|
|
\ 'V' : 'V-L',
|
|
|
|
\ "\<C-v>": 'V-B',
|
|
|
|
\ 'c' : 'C',
|
|
|
|
\ 's' : 'S',
|
|
|
|
\ 'S' : 'S-L',
|
|
|
|
\ "\<C-s>": 'S-B',
|
|
|
|
\ '?': ' '
|
|
|
|
\ },
|
|
|
|
\ 'separator': { 'left': '', 'right': '' },
|
|
|
|
\ 'subseparator': { 'left': '>', 'right': '<' }
|
|
|
|
\ }
|
2015-10-26 20:32:51 +00:00
|
|
|
|
|
|
|
function! LightLineModified()
|
|
|
|
if &filetype == "help"
|
|
|
|
return ""
|
|
|
|
elseif &modified
|
|
|
|
return "+"
|
|
|
|
elseif &modifiable
|
|
|
|
return ""
|
|
|
|
else
|
|
|
|
return ""
|
|
|
|
endif
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
function! LightLineReadonly()
|
|
|
|
if &filetype == "help"
|
|
|
|
return ""
|
|
|
|
elseif &readonly
|
|
|
|
return "!"
|
|
|
|
else
|
|
|
|
return ""
|
|
|
|
endif
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
function! LightLineFugitive()
|
|
|
|
if exists("*fugitive#head")
|
|
|
|
let _ = fugitive#head()
|
|
|
|
return strlen(_) ? 'git:'._ : ''
|
|
|
|
endif
|
|
|
|
return ''
|
|
|
|
endfunction
|