forked from ywjno/vundle-vimfiles
-
Notifications
You must be signed in to change notification settings - Fork 2
/
vimrc
317 lines (259 loc) · 8.21 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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
" Easy version Vimrc
"
"
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
set nobackup
set foldmethod=syntax
set nofoldenable
set nocompatible
filetype off
if has("win32") || has("win64")
set rtp+=$VIM\vimfiles\bundle\vundle
call vundle#rc('$VIM\vimfiles\bundle')
else
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
endif
Bundle 'gmarik/vundle'
Bundle 'elzr/vim-json'
Bundle 'kien/rainbow_parentheses.vim'
let g:rbpt_colorpairs = [
\ ['brown', 'RoyalBlue3'],
\ ['Darkblue', 'SeaGreen3'],
\ ['darkgray', 'DarkOrchid3'],
\ ['darkgreen', 'firebrick3'],
\ ['darkcyan', 'RoyalBlue3'],
\ ['darkred', 'SeaGreen3'],
\ ['darkmagenta', 'DarkOrchid3'],
\ ['brown', 'firebrick3'],
\ ['gray', 'RoyalBlue3'],
\ ['black', 'SeaGreen3'],
\ ['darkmagenta', 'DarkOrchid3'],
\ ['Darkblue', 'firebrick3'],
\ ['darkgreen', 'RoyalBlue3'],
\ ['darkcyan', 'SeaGreen3'],
\ ['darkred', 'DarkOrchid3'],
\ ['red', 'firebrick3'],
\ ]
let g:rbpt_max = 16
let g:rbpt_loadcmd_toogle = 0
au VimEnter * RainbowParenthesesToggle
au Syntax * RainbowParenthesesLoadRound
au Syntax * RainbowParenthesesLoadSquare
au Syntax * RainbowParenthesesLoadBraces
Bundle 'altercation/vim-colors-solarized'
Bundle 'vim-scripts/DoxygenToolkit.vim'
let g:DoxygenToolkit_authorName = 'Edward Chen'
let g:DoxygenToolkit_licenseTag = 'IntSig Information Co., Ltd'
Bundle 'rizzatti/funcoo.vim'
Bundle 'rizzatti/dash.vim'
Bundle 'xuhdev/SingleCompile'
Bundle 'mileszs/ack.vim'
" Bundle 'vim-scripts/bufexplorer.zip'
Bundle 'vim-scripts/c.vim'
Bundle 'vim-scripts/IndexedSearch'
Bundle 'c9s/colorselector.vim'
Bundle 'kien/ctrlp.vim'
Bundle 'Raimondi/delimitMate'
let delimitMate_expand_cr = 1
Bundle 'airblade/vim-rooter.git'
let g:rooter_manual_only = 1
map <silent> <unique> <Leader>ctrd <Plug>RooterChangeToRootDirectory
Bundle 'mattn/emmet-vim'
Bundle 'vim-scripts/matchit.zip'
Bundle 'scrooloose/nerdtree'
" auto format
Bundle "Chiel92/vim-autoformat"
noremap <F3> :Autoformat<CR><CR>
" Lua
Bundle "xolox/vim-misc"
Bundle "xolox/vim-lua-ftplugin"
Bundle "xolox/vim-lua-inspect"
let g:lua_check_syntax = 1 " done via syntastic
let g:lua_complete_keywords = 1 " interferes with YouCompleteMe
let g:lua_complete_globals = 1 " interferes with YouCompleteMe?
let g:lua_complete_library = 1 " interferes with YouCompleteMe
let g:lua_complete_dynamic = 1 " interferes with YouCompleteMe
let g:lua_complete_omni = 1 " Disabled by default. Likely to crash Vim!
let g:lua_omni_blacklist = ['pl\.strict', 'lgi\..']
let g:lua_define_omnifunc = 1 " must be enabled also (g:lua_complete_omni=1, but crashes Vim!)
let g:lua_define_completion_mappings = 0
let g:lua_internal = 0"
let g:lua_inspect_mappings = 0
let g:lua_inspect_warnings = 0
let g:lua_inspect_events = ''
inoremap <buffer> <silent> <F5> <C-o>:LuaInspectRename<CR>
nnoremap <buffer> <silent> <F5> :LuaInspectRename<CR>
nnoremap <buffer> <silent> gd :LuaInspectGoTo<CR
" Nginx
Bundle "evanmiller/nginx-vim-syntax"
" Syntastic
Bundle 'scrooloose/syntastic'
" highlight SyntasticErrorSign guifg=white guibg=red
" highlight SyntasticErrorLine guibg=red
let g:syntastic_check_on_open = 0
let g:syntastic_check_on_wq = 1
let g:syntastic_error_symbol = '✗'
let g:syntastic_warning_symbol = '⚠'
let g:syntastic_enable_highlighting = 0
let g:syntastic_enable_signs = 0
let g:syntastic_enable_ballons = 0
let g:syntastic_quiet_messages = {'level': 'warnings'}
let g:syntastic_auto_loc_list = 0
let g:syntastic_java_checkers = ['checkstyle', 'javac']
let g:syntastic_cpp_checkers = ['gcc']
let g:syntastic_c_checkers = ['gcc']
let g:syntastic_stl_format = '[%E{Err: %fe #%e}%B{, }%W{Warn: %fw #%w}]'
let g:syntastic_mode_map = { 'mode': 'active',
\ 'active_filetypes': ['objc', 'python', 'objc++', 'cpp', 'c', 'java'],
\ 'passive_filetypes': [''] }
let g:syntastic_java_javac_classpath = '~/Applications/adt-bundle-mac/sdk/platforms/android-19'
let g:syntastic_auto_loc_list = 1
Bundle 'AndrewRadev/splitjoin.vim'
Bundle 'Yggdroot/indentLine.git'
let g:indentLine_color_term = 239
let g:indentLine_color_gui = '#09AA08'
let g:indentLine_char = '|'
Bundle 'majutsushi/tagbar'
Bundle 'tomtom/tcomment_vim'
Bundle 'tomtom/tlib_vim'
Bundle 'Shougo/unite.vim'
Bundle 'MarcWeber/vim-addon-mw-utils'
Bundle 'kchmck/vim-coffee-script'
Bundle 'ap/vim-css-color'
Bundle 'junegunn/vim-easy-align'
Bundle 'Lokaltog/vim-easymotion'
Bundle 'tpope/vim-endwise'
Bundle 'tpope/vim-fugitive'
Bundle 'nathanaelkane/vim-indent-guides'
Bundle 'michaeljsmith/vim-indent-object'
Bundle 'pangloss/vim-javascript'
Bundle 'terryma/vim-multiple-cursors'
Bundle 'jistr/vim-nerdtree-tabs'
Bundle 'Lokaltog/vim-powerline'
Bundle 'thinca/vim-quickrun'
Bundle 'tpope/vim-ragtag'
Bundle 'tpope/vim-rails'
Bundle 'tpope/vim-repeat'
Bundle 'vim-ruby/vim-ruby'
Bundle 'slim-template/vim-slim'
Bundle 'garbas/vim-snipmate'
Bundle 'tpope/vim-unimpaired'
Bundle 'Shougo/vimfiler.vim'
Bundle 'jnurmine/Zenburn'
Bundle 'sjl/badwolf'
Bundle 'tomasr/molokai'
Bundle 'wesgibbs/vim-irblack'
Bundle 'jonathanfilip/vim-lucius'
Bundle 'jpo/vim-railscasts-theme'
Bundle 'ywjno/vim-tomorrow-theme'
Bundle 'jeffkreeftmeijer/vim-numbertoggle'
Bundle 'ervandew/supertab'
let g:SuperTabDefaultCompletionType = '<C-Tab>'
" Ultisnips
Bundle 'SirVer/ultisnips'
Bundle 'honza/vim-snippets'
" add my personal custom snippets files to runtimepath
set runtimepath+=~/.vim/yoyokko
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
Bundle 'Valloric/YouCompleteMe'
set ttimeoutlen=50
let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py'
let g:ycm_confirm_extra_conf = 1
let g:ycm_extra_conf_globlist = ['~/*','!/media/psf/Home/*']
nnoremap <leader>gdc :YcmCompleter GoToDeclaration<CR>
nnoremap <leader>gdf :YcmCompleter GoToDefinition<CR>
nnoremap <leader>gdd :YcmCompleter GoToDefinitionElseDeclaration<CR>
let g:ycm_error_symbol = '>>'
let g:ycm_warning_symbol = '>*'
let g:ycm_key_list_select_completion = ['<C-TAB>', '<Down>']
let g:ycm_key_list_previous_completion = ['<C-S-TAB>', '<Up>']
" Far improved support for correct indentation for objc code in vim
Bundle "b4winckler/vim-objc"
" Adds support for :A to switch between header / implementation, and more
Bundle 'yoyokko/a.vim'
" Better Objc Syntax highlighting
Bundle 'terhechte/cocoa.vim'
" quicker way to do list methods
"cab lm ListMethods
let g:surround_no_insert_mappings=1
Bundle 'tpope/vim-surround'
Bundle 'eraserhd/vim-kiwi'
Bundle 'klen/python-mode'
let g:pymode=1
let g:pymode_trim_whitespaces=1
let g:pymode_folding=1
let g:pymode_lint_cwindow=0
let g:pymode_rope_completion=0
let g:pymode_rope=0
let g:pymode_rope_lookup_project = 0
Bundle 'plasticboy/vim-markdown'
let g:vim_markdown_folding_disabled=1
filetype plugin indent on
" =============
" custom key
" =============
" add a new line without entering insert mode
noremap <CR> o<Esc>
noremap <Space> i<Space><Esc>
" map backspce to delete a character
noremap <BS> X
" map ctrl+c and ctrl+v
noremap <C-c> y
noremap <C-v> P
" map F7 & F8 to switch between tabs
noremap <F7> :tabn
noremap <F8> :tabp
imap <F1> <Esc>
map <F1> <Esc>
" cancel searched highlight
noremap ; :nohlsearch<CR>
" navigating for long lines
map j gj
map k gk
map <UP> gk
map <DOWN> gj
"imap <UP> <ESC>gk<RIGHT>i
"imap <DOWN> <ESC>gj<RIGHT>i
" map Emac keybind in insert mode
imap <C-b> <Left>
imap <C-f> <Right>
imap <C-p> <Up>
imap <C-n> <Down>
imap <C-a> <Home>
imap <C-e> <End>
inoremap <C-c> <ESC>`^
" set encoding
set encoding=utf-8
set fileencodings=utf-8
" select ALL
map <D-A> ggVG
set completeopt=longest,menuone
if has('gui_running')
set background=light
else
set background=dark
endif
colorscheme solarized
set tags=tags;/
imap ✠ <S-CR>
function! s:insert_gates()
let gatename = substitute(toupper(expand("%:t")), "\\.", "_", "g")
execute "normal! o"
execute "normal! Gi#ifndef " . gatename
execute "normal! o#define " . gatename
execute "normal! o"
execute "normal! o"
execute "normal! o"
execute "normal! Go#endif /* " . gatename . " */"
normal! kkk
endfunction
autocmd BufNewFile *.{h,hpp} call <SID>insert_gates()
" vimgdb setting
let g:vimgdb_debug_file = ""
run macros/gdb_mappings.vim