-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
468 lines (407 loc) · 12.9 KB
/
Copy pathvimrc
File metadata and controls
468 lines (407 loc) · 12.9 KB
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
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
if has("vim_starting")
set nocompatible
set runtimepath+=~/.vim/bundle/neobundle.vim/
set background=dark
"{ Useability/misc
" show (partial) command in status line
set showcmd
" show function arguments if any during autocompletion
set showfulltag
" show matching brackets a.o.
set showmatch
" while browsing through windows set non active non visable
set winminwidth=0
set winminheight=0
" when splittin open window below
set splitbelow
" number of commands and other things to remember
set history=50
" things to log in viminfo
set viminfo='50,/30,"50,
set complete=.,w,b,u,U,t,i,d,k,kspell
" set dict=/usr/share/dict/words
" set thesaurus
" wild
set wildmode=list:longest,full
set wildmenu
"FIXME: is this working for you?
set wildignore+=*/tmp/*,*.so,*.swp,*.pyc
" when compeleting insert longest commen text
set completeopt=menuone,longest
" do autoindent when starting a new line
set smartindent
" Take indent from current line
set autoindent
" automatically change window's cwd to file's dir
set autochdir
"}
"{ Moving
" keep cursor in same column when moving cursor up and down
set nostartofline
" easy jumping from from end of one sentence to beggining of the next
set whichwrap=<,>,[,],b,s,h,l
" make backspace usable
set backspace=indent,eol,start
"for moving around between windows
imap <C-w> <C-o><C-w>
nmap <C-h> <C-w>h<C-w>_
nmap <C-j> <C-w>j<C-w>_
nmap <C-k> <C-w>k<C-w>_
nmap <C-l> <C-w>l<C-w>_
nmap <C-i> <C-w><
nmap <C-o> <C-w>>
"}
"{ Wrapping
" I don't care for wrapping text
set nowrap
" But here are some sensible settings if wrapping is needed
set showbreak=" \ "
" Indent after textwrap
set wrapmargin=2
" for emails this might be a good setting
"set textwidth=72
"}
"{ Search
set hlsearch
" highlight as you are typing a searchpattern
set incsearch
" set casesentitive search
set noignorecase
" Use <C-L> to clear the highlighting of :set hlsearch.
if maparg('<C-L>', 'n') ==# ''
nnoremap <silent> <C-L> :nohlsearch<CR><C-L>
endif
"}
"{ Tabs(\t) - I don't like 'em
" number of spaces in an indent tab
set shiftwidth=4
"number of spaces in a tab
set tabstop=4
set softtabstop=4
"inserts space characters whenever the tab key is pressed
set expandtab
"converts tabs to spaces
set smarttab
"}
"{ Foldes
"set foldclose=all
set foldmethod=marker
set foldnestmax=5
set foldminlines=2
set foldmarker={,}
" Movements that open folds
set foldopen=block,hor,mark,percent,quickfix,search,tag,undo
"}
"{ Backups
"place to put Backups
set backupdir=~/.vim/backups//,/var/tmp//,/tmp//,.
set directory=~/.vim/backups//,/var/tmp//,/tmp//,.
"wite content on file if its been modified
set autowriteall
"write a backup before writing to a file
set writebackup
"}
"{ file formats
" I dont like wintendo
"set fileformats+=mac
set fileformat=unix
set encoding=utf-8
set termencoding=iso-8859-1
"}
" { Misc (unsorted)
" Highlight current line
set nocursorline
" do not update screen while running macros
set lazyredraw
" Use <leader>l to toggle display of whitespace
nmap <leader>l :set list!<CR>
" And set some nice chars to do it with
set listchars=tab:»\ ,eol:¬
" report number of lines changed
set report=0
" keep lines/chars from the edge when moving
if !&scrolloff
set scrolloff=1
endif
if !&sidescrolloff
set sidescrolloff=5
endif
set display+=lastline
set formatoptions=rqo
set nrformats-=octal
"TODO: readup
set shiftround
set ttimeout
set ttimeoutlen=50
" }
"{ Encryption
set cryptmethod=blowfish
"}
if &encoding ==# 'latin1' && has('gui_running')
set encoding=utf-8
endif
if &listchars ==# 'eol:$'
set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+
if !has('win32') && (&termencoding ==# 'utf-8' || &encoding ==# 'utf-8')
let &listchars = "tab:\u21e5 ,trail:\u2423,extends:\u21c9,precedes:\u21c7,nbsp:\u00b7"
endif
endif
if &shell =~# 'fish$'
set shell=/bin/bash
endif
if &history < 1000
set history=1000
endif
if &tabpagemax < 50
set tabpagemax=50
endif
if !empty(&viminfo)
set viminfo^=!
endif
" Allow color schemes to do bright colors without forcing bold.
if &t_Co == 8 && $TERM !~# '^linux'
set t_Co=16
endif
" Load matchit.vim, but only if the user hasn't installed a newer version.
"if !exists('g:loaded_matchit') && findfile('plugin/matchit.vim', &rtp) ==# ''
" runtime! macros/matchit.vim
"endif
inoremap <C-U> <C-G>u<C-U>
nnoremap & :&&<CR>
xnoremap & :&&<CR>
" Make Y consistent with C and D. See :help Y.
nnoremap Y y$
"plugins
function! g:ToggleColorColumn()
if &colorcolumn != ''
setlocal colorcolumn&
else
setlocal colorcolumn=+1
endif
endfunction
nnoremap <silent> <leader>cc :call g:ToggleColorColumn()<CR>
if filereadable($HOME."/.vim/extras.vim")
source ~/.vim/extras.vim
endif
" if needed I can overwrite my general vim settings on a system basis here
if filereadable($HOME."/.vimrc.local")
source ~/.vimrc.local
endif
endif
call neobundle#begin(expand("~/.vim/bundle/"))
NeoBundleFetch "Shougo/neobundle.vim"
NeoBundle "klen/python-mode.git"
NeoBundle "tpope/vim-fugitive.git"
NeoBundle "scrooloose/nerdtree.git"
NeoBundle "scrooloose/nerdcommenter.git"
NeoBundle "mattn/emmet-vim.git"
NeoBundle "bling/vim-airline.git"
NeoBundle "airblade/vim-gitgutter.git"
"maybe https://github.com/mhinz/vim-signify.git
NeoBundle "kien/ctrlp.vim.git"
"NeoBundle "bling/vim-bufferline.git"
NeoBundle "vim-scripts/DrawIt.git"
"NeoBundle "ervandew/supertab.git"
NeoBundle "Shougo/neocomplete.vim.git"
NeoBundle "Raimondi/delimitMate.git"
NeoBundle "tpope/vim-tbone.git"
NeoBundle "Shougo/neosnippet.vim.git"
NeoBundle "Shougo/neosnippet-snippets.git"
NeoBundle "daylerees/colour-schemes.git", { "rtp": "vim/" }
NeoBundle "flazz/vim-colorschemes.git"
"NeoBundle "chrisbra/csv.vim.git"
"NeoBundle "chrisbra/csv.vim.git"
NeoBundle "mbbill/undotree.git"
NeoBundle "vim-scripts/boxdraw.git"
"others
"https://github.com/tpope/vim-surround
"https://github.com/edkolev/tmuxline.vim
"
call neobundle#end()
filetype plugin indent on
NeoBundleCheck
""" Plugin settings"
""{{{ klen/python-mode.git
" Python-mode
" Activate rope
" Keys:
" K Show python docs
" <Ctrl-Space> Rope autocomplete
" <Ctrl-c>g Rope goto definition
" <Ctrl-c>d Rope show documentation
" <Ctrl-c>f Rope find occurrences
" <Leader>b Set, unset breakpoint (g:pymode_breakpoint enabled)
" [[ Jump on previous class or function (normal, visual, operator modes)
" ]] Jump on next class or function (normal, visual, operator modes)
" [M Jump on previous class or method (normal, visual, operator modes)
" ]M Jump on next class or method (normal, visual, operator modes)
let g:pymode_rope = 0
" Documentation
let g:pymode_doc = 0
let g:pymode_doc_key = 'K'
"Linting
let g:pymode_lint = 1
let g:pymode_lint_checker = "pylint,pep8"
" Auto check on save
let g:pymode_lint_write = 1
let g:pymode_lint_onfly = 0
"What to ignore
let g:pymode_lint_ignore = "C0301,C901,E265,E501,E711,E712,R092,W0702"
" Support virtualenv
let g:pymode_virtualenv = 1
" Enable breakpoints plugin
let g:pymode_breakpoint = 1
let g:pymode_breakpoint_key = '<leader>b'
" syntax highlighting
let g:pymode_syntax = 1
let g:pymode_syntax_all = 1
let g:pymode_syntax_indent_errors = g:pymode_syntax_all
let g:pymode_syntax_space_errors = g:pymode_syntax_all
" Don't autofold code
let g:pymode_folding = 1
" let bundle/vim-python-pep8-indent handle indent
let g:pymode_indent = 0
" Don't open cwindow
let g:pymode_lint_cwindow = 0
"}}}
""{{{ scrooloose/nerdtree.git
let NERDTreeIgnore = ['\~$','\.pyc$','__pycache__']
"}}}
""{{{ bling/vim-airline.git
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
" unicode symbols
let g:airline_left_sep = '»'
let g:airline_left_sep = ''
let g:airline_right_sep = '«'
let g:airline_right_sep = ''
let g:airline_symbols.linenr = '␊'
let g:airline_symbols.linenr = ''
let g:airline_symbols.linenr = '¶'
let g:airline_symbols.branch = '⎇'
let g:airline_symbols.paste = 'ρ'
let g:airline_symbols.paste = 'Þ'
let g:airline_symbols.paste = '∥'
let g:airline_symbols.whitespace = 'Ξ'
""}}}
""{{{ airblade/vim-gitgutter.git
let g:gitgutter_sign_added = '+'
let g:gitgutter_sign_modified = '~'
let g:gitgutter_sign_removed = '-'
let g:gitgutter_sign_removed_first_line = '^-'
let g:gitgutter_sign_modified_removed = '~-'
let g:gitgutter_diff_args = '-w'
let g:gitgutter_enabled = 0
""}}}
""{{{ klein/ctrlp.vim.git
"let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git|svn)$',
\ 'file': '\v\.(so|pyc)$',
\ }
""}}}
""{{{ bling/bufferline.git
let g:bufferline_rotate = 1
let g:bufferline_echo = 0
""}}}
""{{{ Shougo/neocomplete.vim.git
" Disable AutoComplPop.
let g:acp_enableAtStartup = 0
" Use neocomplete.
let g:neocomplete#enable_at_startup = 1
" Use smartcase.
let g:neocomplete#enable_smart_case = 1
" Set minimum syntax keyword length.
let g:neocomplete#sources#syntax#min_keyword_length = 3
let g:neocomplete#lock_buffer_name_pattern = '\*ku\*'
" Define dictionary.
let g:neocomplete#sources#dictionary#dictionaries = {
\ 'default' : '',
\ 'vimshell' : $HOME.'/.vimshell_hist',
\ 'scheme' : $HOME.'/.gosh_completions'
\ }
" Define keyword.
if !exists('g:neocomplete#keyword_patterns')
let g:neocomplete#keyword_patterns = {}
endif
let g:neocomplete#keyword_patterns['default'] = '\h\w*'
" Plugin key-mappings.
inoremap <expr><C-g> neocomplete#undo_completion()
inoremap <expr><C-l> neocomplete#complete_common_string()
" Recommended key-mappings.
" <CR>: close popup and save indent.
inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
function! s:my_cr_function()
return neocomplete#close_popup() . "\<CR>"
" For no inserting <CR> key.
"return pumvisible() ? neocomplete#close_popup() : "\<CR>"
endfunction
" <TAB>: completion.
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" <C-h>, <BS>: close popup and delete backword char.
inoremap <expr><C-h> neocomplete#smart_close_popup()."\<C-h>"
inoremap <expr><BS> neocomplete#smart_close_popup()."\<C-h>"
inoremap <expr><C-y> neocomplete#close_popup()
inoremap <expr><C-e> neocomplete#cancel_popup()
" Close popup by <Space>.
"inoremap <expr><Space> pumvisible() ? neocomplete#close_popup() : "\<Space>"
" For cursor moving in insert mode(Not recommended)
"inoremap <expr><Left> neocomplete#close_popup() . "\<Left>"
"inoremap <expr><Right> neocomplete#close_popup() . "\<Right>"
"inoremap <expr><Up> neocomplete#close_popup() . "\<Up>"
"inoremap <expr><Down> neocomplete#close_popup() . "\<Down>"
" Or set this.
"let g:neocomplete#enable_cursor_hold_i = 1
" Or set this.
"let g:neocomplete#enable_insert_char_pre = 1
" AutoComplPop like behavior.
"let g:neocomplete#enable_auto_select = 1
" Shell like behavior(not recommended).
set completeopt+=longest
let g:neocomplete#enable_auto_select = 0
"let g:neocomplete#disable_auto_complete = 1
inoremap <expr><TAB> pumvisible() ? "\<Down>" : "\<C-x>\<C-u>"
" Enable omni completion.
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
" Enable heavy omni completion.
if !exists('g:neocomplete#sources#omni#input_patterns')
let g:neocomplete#sources#omni#input_patterns = {}
endif
"let g:neocomplete#sources#omni#input_patterns.php = '[^. \t]->\h\w*\|\h\w*::'
"let g:neocomplete#sources#omni#input_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)'
"let g:neocomplete#sources#omni#input_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::'
" For perlomni.vim setting.
" https://github.com/c9s/perlomni.vim
let g:neocomplete#sources#omni#input_patterns.perl = '\h\w*->\h\w*\|\h\w*::'
""}}}
""{{{ Shugo/neosnipper.vim.git
imap <C-k> <Plug>(neosnippet_expand_or_jump)
smap <C-k> <Plug>(neosnippet_expand_or_jump)
xmap <C-k> <Plug>(neosnippet_expand_target)
"" SuperTab like snippets behavior.
imap <expr><TAB> neosnippet#expandable_or_jumpable() ?
\ "\<Plug>(neosnippet_expand_or_jump)"
\: pumvisible() ? "\<C-n>" : "\<TAB>"
smap <expr><TAB> neosnippet#expandable_or_jumpable() ?
\ "\<Plug>(neosnippet_expand_or_jump)"
\: "\<TAB>"
"" For snippet_complete marker.
"if has('conceal')
"set conceallevel=2 concealcursor=i
"endif
" Enable snipMate compatibility feature.
let g:neosnippet#enable_snipmate_compatibility = 1
" Tell Neosnippet about the other snippets
let g:neosnippet#snippets_directory='~/.vim/snippets'
""}}}
""{{{ mbbill/undotree.git
if has("persistent_undo")
set undodir = "$HOME."/.vim/undodir"
set undofile
endif
""}}}