-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathminimal_vimrc.vim
136 lines (110 loc) · 3.19 KB
/
minimal_vimrc.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
" turn of Vi compatibility mode
set nocompatible
" plugins will be stored relative to current file {{{1
" Eg:- ~/.vim/vimrc.vim => ~/.vim/bundle
let plugins_dir_name = 'bundle'
let vimrc_path = resolve(expand('<sfile>'))
let vimrc_dir = fnamemodify(vimrc_path, ':h')
let plugins_dir = vimrc_dir . '/' . plugins_dir_name
let plugins_dir_exists = isdirectory(plugins_dir)
let vundle_dir = plugins_dir . '/' . 'vundle'
let hybrid_dir = plugins_dir . '/' . 'vim-hybrid'
let vundle_dir_exists = isdirectory(vundle_dir)
" }}}1
" install vundle if not found {{{1
if !vundle_dir_exists
call mkdir(vundle_dir, 'p')
let install_cmds = []
call add(install_cmds, 'echo "Installing Vundle ..."')
call add(install_cmds, 'git clone https://github.com/gmarik/vundle.git ' . vundle_dir)
" allows using hybrid color scheme during the plugin installs
call add(install_cmds, 'echo "Installing Hybrid Color Scheme ..."')
call add(install_cmds, 'git clone https://github.com/w0ng/vim-hybrid.git ' . hybrid_dir)
execute ':set rtp+=' . hybrid_dir
let install_cmd = ":silent !" . join(install_cmds, ' && ')
execute install_cmd
endif
" }}}1
" vundle configuration {{{1
filetype off
execute ':set rtp+=' . vundle_dir
call vundle#rc(plugins_dir)
" }}}1
" vim defaults {{{1
set showcmd
set hidden
set number
set modelines=0
set nomodeline
set ruler
set wildmode=list:full
set undolevels=100
set wildignore=.svn,CVS,.git,*.o,*.a,*.class,*.mo,*.la,*.so,*.obj,*.swp,*.jpg,*.png,*.xpm,*.gif,*.pdf,*.bak,*.beam,*.pyc
set encoding=utf-8
set laststatus=2
set t_Co=256
set timeout
set timeoutlen=500
set ttimeoutlen=500
set synmaxcol=512
set ttyfast
set scrolloff=5
set backspace=indent,eol,start
set autoindent
" }}}1
" plugin configuration {{{1
" airline
let g:airline_theme='hybrid'
" Ultisnips
" switch triggers to maintain compatibility with SuperTab & YCM
let g:UltiSnipsExpandTrigger = "<c-j>"
let g:UltiSnipsJumpForwardTrigger = "<c-j>"
let g:UltiSnipsJumpBackwardTrigger = "<c-k>"
" Ctrlp
set wildignore+=vendor/*,docs/*,node_modules/*,components/*,build/*,dist/*
" SuperTab
let g:SuperTabDefaultCompletionType = "context"
let g:SuperTabCompletionContexts = ['s:ContextText', 's:ContextDiscover']
let g:SuperTabContextTextOmniPrecedence = ['&omnifunc', '&completefunc']
let g:SuperTabContextDiscoverDiscovery = ["&completefunc:<c-x><c-u>", "&omnifunc:<c-x><c-o>"]
" }}}1
" vundle managed plugins {{{1
" core
Plugin 'gmarik/vundle'
" colorschemes
Plugin 'w0ng/vim-hybrid'
" status bar
Plugin 'bling/vim-airline'
" code browsing
Plugin 'kien/ctrlp.vim'
" autocompletion
Plugin 'ervandew/supertab'
" snippets
Plugin 'SirVer/ultisnips'
" language common
Plugin 'scrooloose/syntastic'
" php
Plugin 'StanAngeloff/php.vim'
Plugin 'shawncplus/phpcomplete.vim'
" general web dev
Plugin 'tpope/vim-markdown'
Plugin 'tyru/open-browser.vim'
" wordpress
Plugin 'dsawardekar/wordpress.vim'
" }}}1
" vundle installation {{{1
" use hybrid if present
silent! colorscheme hybrid
if !vundle_dir_exists
redraw!
PluginInstall
end
" }}}1
" appearance {{{1
" omnicompletion config
set completeopt=menu,menuone,longest
set pumheight=15
" }}}1
" vundle complete, turn back filetypes
filetype plugin indent on
syntax on