-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.vim
696 lines (580 loc) · 22.2 KB
/
init.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
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
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
:set nocompatible
if has('nvim')
if empty(glob('~/.local/share/nvim/site/autoload/plug.vim'))
silent !curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
elseif empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
if (has("nvim"))
call plug#begin('~/.local/share/nvim/plugged')
else
call plug#begin('~/.vim/plugged')
endif
" My bundles
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-obsession'
Plug 'vim-scripts/taglist.vim'
Plug 'tomtom/tlib_vim'
Plug 'MarcWeber/vim-addon-mw-utils'
Plug 'mbbill/undotree'
Plug 'dense-analysis/ale'
" Snippets
"if has('python') || has('python3')
Plug 'SirVer/ultisnips'
"endif
Plug 'honza/vim-snippets'
" Diff
Plug 'will133/vim-dirdiff'
" Force dir diff lang to en_US
let g:DirDiffForceLang = "en_US"
" PHP
Plug 'StanAngeloff/php.vim'
" Plug 'spf13/PIV'
"Plug 'vexxor/phpdoc.vim'
Plug 'arnaud-lb/vim-php-namespace'
Plug 'joonty/vdebug'
" HTML5
Plug 'elzr/vim-json'
Plug 'groenewege/vim-less'
Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx'
Plug 'HerringtonDarkholme/yats'
Plug 'hail2u/vim-css3-syntax'
Plug 'beyondwords/vim-twig'
Plug 'digitaltoad/vim-jade'
" Plug 'flowtype/vim-flow' " Does not seems to play well with ale, but maybe useless
" Plug 'fleischie/vim-styled-components' " too much memory consumtion
"Plug 'spf13/vim-autoclose'
Plug 'airblade/vim-gitgutter'
" Plug 'shawncplus/phpcomplete.vim'
Plug 'ctrlpvim/ctrlp.vim'
" Behat
Plug 'veloce/vim-behat'
" status line
Plug 'itchyny/lightline.vim'
Plug 'maximbaz/lightline-ale'
" Themes
Plug 'spf13/vim-colors'
Plug 'mhartington/oceanic-next'
Plug 'dracula/vim', { 'as': 'dracula' }
Plug 'chriskempson/base16-vim'
Plug 'markvincze/panda-vim'
" Plug 'trusktr/seti.vim'
Plug 'nicholasc/vim-seti'
if executable('ack-grep')
let g:ackprg="ack-grep -H --nocolor --nogroup --column"
Plug 'mileszs/ack.vim'
elseif executable('ack')
Plug 'mileszs/ack.vim'
elseif executable('ag')
Plug 'mileszs/ack.vim'
let g:ackprg = 'ag --nogroup --nocolor --column --smart-case'
endif
call plug#end()
"php Doc
inoremap <F6> <ESC>:call PhpDoc()<CR>i
nnoremap <F6> :call PhpDoc()<CR>
vnoremap <F6> :call PhpDoc()<CR>
map <F1> <Esc>
imap <F1> <Esc>
let mapleader=","
" General
if has ('x') && has ('gui') " On Linux use + register for copy-paste
set clipboard=unnamedplus
elseif has ('gui') " On mac and Windows, use * register for copy-paste
set clipboard=unnamed
endif
set history=10000 " history (default is 20)
set nospell " spell checking off
" Instead of reverting the cursor to the last position in the buffer, we
" set it to the first line when editing a git commit message
au FileType gitcommit au! BufEnter COMMIT_EDITMSG call setpos('.', [0, 1, 1, 0])
" Backup
set backup
set writebackup
set backupdir=~/.vim/.backups
set directory=~/.vim/.backups
if has('persistent_undo')
set undofile " So is persistent undo ...
set undolevels=1000 " Maximum number of changes that can be undone
set undoreload=10000 " Maximum number lines to save for undo on a buffer reload
set undodir=~/.vim/.backups
endif
" UI
" if $COLORTERM == 'gnome-terminal'
set t_Co=256
if (!has('nvim') && has("termguicolors") && &term =~ '256color')
" disable Background Color Erase (BCE) so that color schemes
" render properly when inside 256-color tmux and GNU screen.
" see also http://snk.tuxfamily.org/log/vim-256color-bce.html
set t_ut=
" due to tmux 256 colors. See https://github.com/tmux/tmux/issues/1246
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors
endif
" endif
if (has("nvim") && has("termguicolors"))
set termguicolors
endif
" colorscheme dracula
" colorscheme base16-one-light
colorscheme base16-unikitty-dark
set colorcolumn=80,120
set showmode
set cursorline
hi CursorLine guibg=#111111
" if has("statusline")
" set statusline=%<%#StatusLineGit#%{fugitive#head()}%#StatusLine#\ [%{getcwd()}]\ %f\ %h%m%r%=\ %{\"[\".(&fenc==\"\"?&enc:&fenc).((exists(\"+bomb\")\ &&\ &bomb)?\",B\":\"\").\"]\ \"}%k\ %l,%c\ %P
" " set statusline=%<%#StatusLineGit#%{fugitive#statusline(\"[%b]\")}%#StatusLine#\ %f\ %h%m%r%=\ %{\"[\".(&fenc==\"\"?&enc:&fenc).((exists(\"+bomb\")\ &&\ &bomb)?\",B\":\"\").\"]\ \"}%k\ %l,%c\ %P
" " set statusline=%<%f\ %h%m%r%=%#StatusLineGit#%{fugitive#statusline(\"[%status%]\")}%#StatusLine#\ %{\"[\".(&fenc==\"\"?&enc:&fenc).((exists(\"+bomb\")\ &&\ &bomb)?\",B\":\"\").\"]\ \"}%k\ %-14.(%l,%c%V%)\ %P
" "set statusline=%<%f\ %{fugitive#statusline()}\ %h%m%r%=%{\"[\".(&fenc==\"\"?&enc:&fenc).((exists(\"+bomb\")\ &&\ &bomb)?\",B\":\"\").\"]\ \"}%k\ %-14.(%l,%c%V%)\ %P
" endif
set backspace=indent,eol,start " Backspace for dummies"
set linespace=0 " No extra spaces between rows
set nu " Line numbers on
set showmatch " Show matching brackets/parenthesis
set incsearch " Find as you type search
set hlsearch " Highlight search terms
set winminheight=0 " Windows can be 0 line high
set ignorecase " Case insensitive search
set wildignorecase " Case insensitive command line
set smartcase " Case sensitive when uc present
set wildmenu " Show list instead of just completing
set guioptions-=T " no toolbar
set guioptions-=m " no menubar
set guioptions-=e " Tabs vi style (non-gtk)
"set wildmode=list:longest,full " Command <Tab> completion, list matches, then longest common part, then all.
set wildmode=full " Command <Tab> completion, list matches, then longest common part, then all.
set whichwrap=b,s,h,l,<,>,[,] " Backspace and cursor keys wrap too
set scrolljump=5 " Lines to scroll when cursor leaves screen
set scrolloff=3 " Minimum lines to keep above and below cursor
set foldenable " Auto fold code
set list
set listchars=tab:›\ ,trail:•,extends:#,nbsp:. " Highlight problematic whitespace"
set foldcolumn=1
" Formatting {
" set nowrap " Do not wrap long lines
set autoindent " Indent at the same level of the previous line
set shiftwidth=4 " Use indents of 4 spaces
set expandtab " Tabs are spaces, not tabs
set tabstop=4 " An indentation every four columns
set softtabstop=4 " Let backspace delete indent
set nojoinspaces " Prevents inserting two spaces after punctuation on a join (J)
set splitright " Puts new vsplit windows to the right of the current
set splitbelow " Puts new split windows to the bottom of the current
set matchpairs+=<:> " Match, to be used with %
set pastetoggle=<F12> " pastetoggle (sane indentation on pastes)
"set comments=sl:/*,mb:*,elx:*/ " auto format comment blocks
" Remove trailing whitespaces and ^M chars
" To disable the stripping of whitespace, add the following to your
" .vimrc.before.local file:
" let g:spf13_keep_trailing_whitespace = 1
autocmd FileType c,cpp,java,go,php,javascript,python,twig,xml,yml autocmd BufWritePre <buffer> if !exists('g:spf13_keep_trailing_whitespace') | call StripTrailingWhitespace() | endif
autocmd BufNewFile,BufRead *.html.twig set filetype=html.twig
autocmd BufNewFile,BufRead *.svg.twig set filetype=svg.twig
autocmd BufNewFile,BufRead *.neon,.yamllint set filetype=yaml
autocmd FileType haskell setlocal expandtab shiftwidth=2 softtabstop=2
autocmd FileType php autocmd BufWritePre <buffer> call PhpSortUse()
" let g:php_namespace_sort_after_insert = 1
" preceding line best in a plugin but here for now.
autocmd BufNewFile,BufRead *.coffee set filetype=coffee
" php-cs-fixer filetype
autocmd BufNewFile,BufRead *.php_cs set filetype=php
let g:php_cs_fixer_config_file = '.php_cs'
" Workaround vim-commentary for Haskell
autocmd FileType haskell setlocal commentstring=--\ %s
" Workaround broken colour highlighting in Haskell
autocmd FileType haskell setlocal nospell
" Javascript airbnb convention
autocmd BufRead,BufEnter .babelrc,.eslintrc set filetype=javascript
autocmd FileType javascript setlocal shiftwidth=2 tabstop=2 softtabstop=2 foldcolumn=0
autocmd FileType scss setlocal shiftwidth=2 tabstop=2 softtabstop=2 foldcolumn=0
autocmd FileType yaml setlocal expandtab shiftwidth=2 softtabstop=2
" jsx file not required to do JSX
let g:jsx_ext_required = 0
" }
" Stupid shift key fixes
if has("user_commands")
command! -bang -nargs=* -complete=file E e<bang> <args>
command! -bang -nargs=* -complete=file W w<bang> <args>
command! -bang -nargs=* -complete=file Wq wq<bang> <args>
command! -bang -nargs=* -complete=file WQ wq<bang> <args>
command! -bang Wa wa<bang>
command! -bang WA wa<bang>
command! -bang Q q<bang>
command! -bang QA qa<bang>
command! -bang Qa qa<bang>
endif
cmap Tabe tabe
" Yank from the cursor to the end of the line, to be consistent with C and D.
nnoremap Y y$"
" Visual shifting (does not exit Visual mode)
" vnoremap < <gv
" vnoremap > >gv
" Sudo save
:cmap wro %!sudo tee > /dev/null %
" Plugins {
" " PIV {
" let g:DisableAutoPHPFolding = 1
" let g:PIVAutoClose = 0
" " }
" SnipMate {
" Setting the author val
" If forking, please overwrite in your .vimrc.local file
let g:snips_author = 'Julien Deniau <[email protected]>'
" }"
" Undotree {
nnoremap <silent> <F7> :UndotreeToggle<CR>
" If undotree is opened, it is likely one wants to interact with it.
let g:undotree_SetFocusWhenToggle = 1
" }
" Tag list {
nnoremap <silent> <F8> :TlistToggle<CR>
" }
" Json {
let g:vim_json_syntax_conceal = 0
" }
" lightline {
" let g:lightline = {
" \ 'colorscheme': 'powerline',
" \ 'active': {
" \ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'filename' ], ['ctrlpmark'] ],
" \ 'right': [ [ 'syntastic', 'lineinfo' ], ['percent'], [ 'fileformat', 'fileencoding', 'filetype' ] ]
" \ },
" \ 'component_function': {
" \ 'fugitive': 'LightlineFugitive',
" \ 'filename': 'LightlineFilename',
" \ 'fileformat': 'LightlineFileformat',
" \ 'filetype': 'LightlineFiletype',
" \ 'fileencoding': 'LightlineFileencoding',
" \ 'mode': 'LightlineMode',
" \ 'ctrlpmark': 'CtrlPMark',
" \ },
" \ 'component_expand': {
" \ 'syntastic': 'SyntasticStatuslineFlag',
" \ },
" \ 'component_type': {
" \ 'syntastic': 'error',
" \ },
" \ }
let g:lightline = {
\ 'colorscheme': 'Tomorrow',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'filename' ], ['ctrlpmark'] ],
\ 'right': [ [ 'linter_checking', 'linter_errors', 'linter_warnings', 'linter_ok', 'lineinfo' ], ['percent'], [ 'fileformat', 'fileencoding', 'filetype' ] ]
\ },
\ 'component_function': {
\ 'fugitive': 'LightlineFugitive',
\ 'filename': 'LightlineFilename',
\ 'fileformat': 'LightlineFileformat',
\ 'filetype': 'LightlineFiletype',
\ 'fileencoding': 'LightlineFileencoding',
\ 'mode': 'LightlineMode',
\ 'ctrlpmark': 'CtrlPMark',
\ },
\ 'component_expand': {
\ 'linter_checking': 'lightline#ale#checking',
\ 'linter_warnings': 'lightline#ale#warnings',
\ 'linter_errors': 'lightline#ale#errors',
\ 'linter_ok': 'lightline#ale#ok',
\ },
\ 'component_type': {
\ 'linter_checking': 'warning',
\ 'linter_warnings': 'warning',
\ 'linter_errors': 'error',
\ 'linter_ok': 'left',
\ },
\ }
function! LightlineModified()
return &ft =~ 'help' ? '' : &modified ? '+' : &modifiable ? '' : '-'
endfunction
function! LightlineReadonly()
return &ft !~? 'help' && &readonly ? 'RO' : ''
endfunction
function! LightlineFilename()
let fname = expand('%:t')
let pathname = expand('%:h')
return fname == 'ControlP' && has_key(g:lightline, 'ctrlp_item') ? g:lightline.ctrlp_item :
\ fname == '__Tagbar__' ? g:lightline.fname :
\ fname =~ '__Gundo\|NERD_tree' ? '' :
\ &ft == 'vimfiler' ? vimfiler#get_status_string() :
\ &ft == 'unite' ? unite#get_status_string() :
\ &ft == 'vimshell' ? vimshell#get_status_string() :
\ ('' != LightlineReadonly() ? LightlineReadonly() . ' ' : '') .
\ ('' != fname ? pathname . '/' . fname : '[No Name]') .
\ ('' != LightlineModified() ? ' ' . LightlineModified() : '')
endfunction
function! LightlineFugitive()
try
if expand('%:t') !~? 'Tagbar\|Gundo\|NERD' && &ft !~? 'vimfiler' && exists('*fugitive#head')
let mark = '' " edit here for cool mark
let branch = fugitive#head()
return branch !=# '' ? mark.branch : ''
endif
catch
endtry
return ''
endfunction
function! LightlineFileformat()
return winwidth(0) > 70 ? &fileformat : ''
endfunction
function! LightlineFiletype()
return winwidth(0) > 70 ? (&filetype !=# '' ? &filetype : 'no ft') : ''
endfunction
function! LightlineFileencoding()
return winwidth(0) > 70 ? (&fenc !=# '' ? &fenc : &enc) : ''
endfunction
function! LightlineMode()
let fname = expand('%:t')
return fname == '__Tagbar__' ? 'Tagbar' :
\ fname == 'ControlP' ? 'CtrlP' :
\ fname == '__Gundo__' ? 'Gundo' :
\ fname == '__Gundo_Preview__' ? 'Gundo Preview' :
\ fname =~ 'NERD_tree' ? 'NERDTree' :
\ &ft == 'unite' ? 'Unite' :
\ &ft == 'vimfiler' ? 'VimFiler' :
\ &ft == 'vimshell' ? 'VimShell' :
\ winwidth(0) > 60 ? lightline#mode() : ''
endfunction
function! CtrlPMark()
if expand('%:t') =~ 'ControlP' && has_key(g:lightline, 'ctrlp_item')
call lightline#link('iR'[g:lightline.ctrlp_regex])
return lightline#concatenate([g:lightline.ctrlp_prev, g:lightline.ctrlp_item
\ , g:lightline.ctrlp_next], 0)
else
return ''
endif
endfunction
let g:ctrlp_status_func = {
\ 'main': 'CtrlPStatusFunc_1',
\ 'prog': 'CtrlPStatusFunc_2',
\ }
function! CtrlPStatusFunc_1(focus, byfname, regex, prev, item, next, marked)
let g:lightline.ctrlp_regex = a:regex
let g:lightline.ctrlp_prev = a:prev
let g:lightline.ctrlp_item = a:item
let g:lightline.ctrlp_next = a:next
return lightline#statusline(0)
endfunction
function! CtrlPStatusFunc_2(str)
return lightline#statusline(0)
endfunction
" augroup AutoSyntastic
" autocmd!
" autocmd BufWritePost * call s:syntastic()
" augroup END
" function! s:syntastic()
" SyntasticCheck
" call lightline#update()
" endfunction
" }
" }
" Strip whitespace {
function! StripTrailingWhitespace()
" Preparation: save last search, and cursor position.
let _s=@/
let l = line(".")
let c = col(".")
" do the business:
%s/\s\+$//e
" clean up: restore previous search history, and cursor position
let @/=_s
call cursor(l, c)
endfunction
" }
" close tab on left / right {
command! -nargs=0 TabCloseRight :.+1,$tabdo :tabclose
" }
" GUI
:set gfn=Bitstream\ Vera\ Sans\ Mono\ 8
" TAILLE DE LA TABULATION
:set textwidth=0
" DÉSACTIVE LE BIP
:set vb t_vb=
" RETOUR A LA LIGNE AUTOMATIQUE
" :set nowrap
" PHP syntax configuration
"let php_mysql_query=1
let php_sync_method = 0 " avoid breaking syntax detection for long files
let php_folding = 0 " don't fold
" APPLICATION APPELEE PAR LA COMMANDE :MAKE
":set makeprg=php\ -l\ %
":set errorformat=%m\ in\ %f\ on\ line\ %l
" Indentation
":set smartindent
" DICTIONNARY PHP
set complete-=k complete+=k
set dictionary+=~/.vim/dictionary/PHP.dict
" CHAR ENCODING
" :set fileencoding=ISO-8859-1
":set fileencoding=utf-8
" FONT UTILISEE
"set showtabline=2
"let g:pdv_cfg_Author = "Julien Deniau <[email protected]>"
"
"source ~/.vim/bundle/atoum/syntax/atoum.vim
"source ~/.vim/bundle/atoum/ftplugin/php/atoum.vim
"
"" phpDocumentator
"let g:pdv_cfg_Version = ""
"let g:pdv_cfg_Author = "Julien Deniau <[email protected]>"
"let g:pdv_cfg_Copyright = ""
"let g:pdv_cfg_License = ""
func! ToggleHLSearch()
if &hls
set nohls
exe "echo 'Highlight OFF'"
else
set hls
exe "echo 'Highlight ON'"
endif
endfunc
nmap <silent> ,n <Esc>:call ToggleHLSearch()<CR>
func! ToggleLeftColumns()
if &number
set nonumber
set foldcolumn=0
" SyntasticReset
GitGutterDisable
exe "echo 'Left columns OFF'"
else
set number
set foldcolumn=1
" SyntasticCheck
GitGutterEnable
exe "echo 'Left columns ON'"
endif
endfunc
nmap <silent> ,f <Esc>:call ToggleLeftColumns()<CR>
" move tabs
:nnoremap <C-A-h> :tabm -1<CR>
:nnoremap <C-A-l> :tabm +1<CR>
:nnoremap <C-k> :tabm -1<CR>
:nnoremap <C-j> :tabm +1<CR>
" move between tabs
:nnoremap <C-l> gt
:nnoremap <C-h> gT
" move to previous / next error
:nnoremap <A-j> :ALENext -error -wrap<CR>
:nnoremap <A-k> :ALEPrevious -error -wrap<CR>
:cab t tabe
:imap <C-h> <Left>
:imap <C-l> <Right>
:imap <M-h> <Esc>
"pour eviter les tab incrementés lors des copiers collers
" :set paste
:set laststatus=2
" Go back to the position the cursor was on the last time this file was edited
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")|execute("normal `\"")|endif
"fonctionnement de la touche Home
:noremap <Home> ^
:inoremap <Home> <Esc>^i
" touches relou
:map <S-Insert> <MiddleMouse>
:map! <S-Insert> <MiddleMouse>
"TAGS PHP du projet
"nmap <silent> <F4>
" \ :!ctags -f ~/.vim/tags
" \ --langmap="php:+.inc"
" \ --PHP-kinds=+cf-v
" \ --exclude=photo
" \ --exclude=backup
" \ --exclude=style
" \ --exclude=tmp
" \ --exclude=temporaire
" \ --exclude=xmlrpc
" \ --exclude=nusoap
" \ --exclude=geshi
" \ --exclude=jpgraph
" \ --exclude=m6wc
" \ --languages=PHP
" \ -h ".php.inc" -R --totals=yes
" \ --tag-relative=yes ~/svn/ ~/ftp/<CR>
set tags=~/.vim/tags
"ouvre les tags dans un nouvel onglet
map <C-_> :tab tj <C-R>=expand("<cword>")<CR><CR>
map <C-LeftMouse> <LeftMouse> :tab tj <C-R>=expand("<cword>")<CR><CR>
map <C-]> <C-w><C-]>
"positionnement de la fenetre en full screen a droite
if !has('nvim')
:winpos 0 0
endif
":set lines=106
":set columns=148
" user ag instead of ack if available
if executable('ag')
let g:ackprg = 'ag --vimgrep'
endif
" define a highlight colour group for bookmarks
let g:showmarks_enable = 0
let showmarks_include = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
let g:showmarks_hlline_lower = 1
let g:showmarks_hlline_upper = 1
let g:showmarks_hlline_other = 1
" For marks a-z
highlight ShowMarksHLl gui=bold guibg=grey30
" For marks A-Z
highlight ShowMarksHLu gui=bold guibg=grey30
" For all other marks
highlight ShowMarksHLo gui=bold guibg=grey30
" For multiple marks on the same line.
highlight ShowMarksHLm gui=bold guibg=grey30
""imap <buffer> <F5> <C-O>:call PhpInsertUse()<CR>
""map <buffer> <F5> :call PhpInsertUse()<CR>
" Syntastic checkers
" let g:syntastic_php_checkers = ['php', 'phpcs', 'phpmd']
" let g:syntastic_php_phpmd_exec = './vendor/phpmd/phpmd/src/bin/phpmd'
" let g:syntastic_php_phpmd_post_args = 'codesize,design,unusedcode,controversial'
" let g:syntastic_javascript_eslint_exec = './node_modules/.bin/eslint'
" let g:syntastic_javascript_flow_exec = './node_modules/.bin/flow'
" let g:syntastic_javascript_checkers = ['eslint', 'flow']
" let g:syntastic_aggregate_errors = 1
" let g:flow#enable = 0
"
" let g:syntastic_php_phpcs_args = "--standard=PSR2"
" Syntax formatter
" let g:neoformat_enabled_javascript = ['prettier']
" let g:neoformat_enabled_json = ['prettier']
" let g:neoformat_enabled_python = ['autopep8']
" let g:neoformat_enabled_php = ['php-cs-fixer']
" Group Neoformat and save in undo command
" augroup fmt
" autocmd!
" autocmd BufWritePre * undojoin | Neoformat
" augroup END
"
"
" let g:ale_lint_on_enter = 1
let g:ale_sign_column_always = 1
let g:ale_fix_on_save = 1
" let g:ale_set_loclist = 0
" let g:ale_set_quickfix = 1
let g:ale_open_list = 0
let g:ale_fixers = {
\ 'css': [ 'prettier' ],
\ 'json': [ 'prettier' ],
\ 'markdown': [ 'prettier' ],
\ 'javascript': [ 'prettier' ],
\ 'php': [ 'php_cs_fixer' ],
\}
let g:ale_linters = {
\ 'javascript': ['eslint'],
\}
let g:ale_php_phpcbf_standard = 'PSR2'
let g:ale_php_phpcs_standard = 'PSR2'
let g:ale_php_phpmd_ruleset = 'codesize,controversial,design,unusedcode'
" let g:ale_php_phpstan_configuration = 'phpstan.neon'
" let g:ale_php_phpstan_level = ''
" Autowrite file with php-cs-fixer as it's not managed by ale
"autocmd FileType php autocmd BufWritePost * call PhpCsFixerFixFile()
" autocmd FileType php autocmd BufWritePost,FileWritePost * :echom "writing file"
" augroup phpcsfixer
" autocmd!
" autocmd FileType php autocmd BufWritePost,FileWritePost * :call PhpCsFixerFixFile()
" augroup END