forked from mathiasbynens/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
242 lines (207 loc) · 6.48 KB
/
.vimrc
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
" Note: Skip initialization for vim-tiny or vim-small.
if 0 | endif
if has('vim_starting')
if &compatible
set nocompatible " Be iMproved
endif
" Required:
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
" Required:
call neobundle#begin(expand('~/.vim/bundle/'))
" Let NeoBundle manage NeoBundle
" Required:
NeoBundleFetch 'Shougo/neobundle.vim'
NeoBundle "chrisbra/color_highlight.git"
NeoBundle "davidhalter/jedi-vim.git"
NeoBundle "adimit/prolog.vim"
NeoBundle "skwp/vim-colors-solarized"
NeoBundle "itchyny/lightline.vim"
NeoBundle "jby/tmux.vim.git"
NeoBundle "gregsexton/gitv"
NeoBundle 'airblade/vim-gitgutter'
NeoBundle "tpope/vim-fugitive"
NeoBundleLazy 'jelera/vim-javascript-syntax', {'autoload':{'filetypes':['javascript']}}
NeoBundleLazy 'ahayman/vim-nodejs-complete', {'autoload':{'filetypes':['javascript']}}
NeoBundle "scrooloose/syntastic.git"
NeoBundle "vim-addon-mw-utils"
NeoBundle "skwp/vim-html-escape"
NeoBundle "scrooloose/nerdtree.git"
NeoBundle "kien/ctrlp.vim"
NeoBundle "rking/ag.vim"
NeoBundle "vim-scripts/IndexedSearch"
NeoBundle "nathanaelkane/vim-indent-guides"
NeoBundle "vim-scripts/argtextobj.vim"
NeoBundle "tpope/vim-abolish"
NeoBundle "tpope/vim-endwise.git"
NeoBundle "tpope/vim-ragtag"
NeoBundle "tpope/vim-repeat.git"
NeoBundle "tpope/vim-surround.git"
NeoBundle "tpope/vim-unimpaired"
NeoBundle "tpope/vim-dispatch"
NeoBundle "Raimondi/delimitMate"
NeoBundle 'Shougo/vimproc.vim', {
\ 'build' : {
\ 'windows' : 'tools\\update-dll-mingw',
\ 'cygwin' : 'make -f make_cygwin.mak',
\ 'mac' : 'make -f make_mac.mak',
\ 'linux' : 'make',
\ 'unix' : 'gmake',
\ },
\ }
NeoBundle 'Valloric/YouCompleteMe', {
\ 'build' : {
\ 'mac' : './install.sh --clang-completer --system-libclang',
\ 'unix' : './install.sh --clang-completer --system-libclang',
\ 'windows' : './install.sh --clang-completer --system-libclang',
\ 'cygwin' : './install.sh --clang-completer --system-libclang'
\ }
\ }
NeoBundle 'Shougo/unite.vim'
NeoBundle 'xolox/vim-misc'
NeoBundle 'xolox/vim-easytags'
NeoBundle 'majutsushi/tagbar'
NeoBundle 'bling/vim-airline'
NeoBundle 'moll/vim-node'
call neobundle#end()
" Required:
filetype plugin indent on
" If there are uninstalled bundles found on startup,
" this will conveniently prompt you to install them.
NeoBundleCheck
" Use the Solarized Dark theme
set background=dark
colorscheme solarized
let g:solarized_termtrans=1
" Use the OS clipboard by default (on versions compiled with `+clipboard`)
set clipboard=unnamed
" Use UTF-8 without BOM
set encoding=utf-8 nobomb
" Don’t add empty newlines at the end of files
set binary
set noeol
" Don’t create backups when editing files in certain directories
set backupskip=/tmp/*,/private/tmp/*
" Respect modeline in files
set modeline
set modelines=4
" Enable per-directory .vimrc files and disable unsafe commands in them
set exrc
set secure
" Enable syntax highlighting
syntax on
" Highlight current line
set cursorline
" Show “invisible” characters
set lcs=tab:▸\ ,trail:·,eol:¬,nbsp:_
set list
set mouse=a
" Disable error bells
set noerrorbells
" Don’t reset cursor to start of line when moving around.
set nostartofline
" Show the cursor position
set ruler
" Don’t show the intro message when starting Vim
set shortmess=atI
" Show the current mode
set showmode
" Show the filename in the window titlebar
set title
" Show the (partial) command as it’s being typed
set showcmd
" Start scrolling three lines before the horizontal window border
set scrolloff=3
"Perofrmance tweeks
set nocursorcolumn
set nocursorline
syntax sync minlines=256
set synmaxcol=256
set ttyfast " u got a fast terminal
set ttyscroll=3
set lazyredraw " to avoid scrolling problems
" hilight search
hi Search cterm=none ctermbg=4 ctermfg=15
set hlsearch
set incsearch
" Set leaders
let mapleader = '-'
let maplocalleader = ' '
"tabcompleation
set wildmode=longest,list
"Tabs
set shiftwidth=4
set softtabstop=4
set tabstop=4
set expandtab
autocmd FileType python set sw=4
autocmd FileType python set ts=4
autocmd FileType python set sts=4
"search
set ignorecase
set smartcase
"autocomplete
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType scss set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType c set omnifunc=ccomplete#Complete
autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete
"html and sql hilight in php files
let php_sql_query=1
let php_htmlInStrings=1
" php-specifc junk
let g:phpcomplete_index_composer_command="composer"
let g:phpcomplete_index_composer_command="composer"
let g:syntastic_php_checkers = ['phpcs']
let g:syntastic_phpcs_conf="--standard=PSR2"
let g:ycm_add_preview_to_completeopt = 1
"let g:ycm_auto_trigger = 0
"commandremap
cnoremap <expr> %% getcmdtype() == ':' ? expand('%:h').'/' : '%%'
"normal remap
noremap gD <c-]>
noremap ' `
noremap ` '
" Save a file as root (,W)
noremap <leader>W :w !sudo tee % > /dev/null<CR>
" edit vimrc
nnoremap <leader>ev :e ~/.vimrc<cr>
nnoremap <leader>sv :e ~/.vimrc<cr>
" ----- xolox/vim-easytags settings -----
" Where to look for tags files
set tags=./tags;,~/.vimtags
" Sensible defaults
let g:easytags_events = ['BufReadPost', 'BufWritePost']
let g:easytags_async = 1
let g:easytags_dynamic_files = 2
let g:easytags_resolve_links = 1
let g:easytags_suppress_ctags_warning = 1
" ----- majutsushi/tagbar settings -----
" Open/close tagbar with \b
nmap <silent> <leader>b :TagbarToggle<CR>
" Uncomment to open tagbar automatically whenever possible
"autocmd BufEnter * nested :call tagbar#autoopen(0)
"
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#hunks#non_zero_only = 1
hi clear SignColumn
" ----- jistr/vim-nerdtree-tabs -----
" Open/close NERDTree Tabs with \t
nmap <silent> <leader>t :NERDTreeToggle<CR>
" To have NERDTree always open on startup
let g:nerdtree_tabs_open_on_console_startup = 1
set noswapfile
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
" Python
let g:ycm_collect_identifiers_from_tags_files = 1
let g:ycm_use_ultisnips_completer = 1
let g:ycm_seed_identifiers_with_syntax = 1
let g:ycm_complete_in_comments = 1
let g:ycm_complete_in_strings = 1
" Ultisnips
let g:UltiSnipsExpandTrigger="<c-tab>"