This repository was archived by the owner on Jul 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphp.vim
More file actions
69 lines (58 loc) · 1.8 KB
/
php.vim
File metadata and controls
69 lines (58 loc) · 1.8 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
" to be load in ~/.vim/after/ftplugin/php.vim via:
" so ~/.vim/vim-env/php.vim
if has("autocmd")
" Drupal *.module and *.install files.
augroup module
autocmd BufRead,BufNewFile *.module set filetype=php
autocmd BufRead,BufNewFile *.install set filetype=php
autocmd BufRead,BufNewFile *.test set filetype=php
augroup END
endif
"""""""""""""""""""""""""
" phpqa plugin settings "
"""""""""""""""""""""""""
"phpmd config
let g:phpqa_messdetector_ruleset = "~/.vim/vim-env/phpmd.xml"
let g:phpqa_messdetector_cmd='./vendor/bin/phpmd'
" standard for plugin phpcs
let g:phpqa_codesniffer_cmd='./vendor/bin/phpcs'
let g:phpqa_codesniffer_args="--standard=PSR2"
" disable/enable phpqa
let g:phpqa_enable_by_me = 1
function! PhpqaEnableDisable()
echohl Title
if g:phpqa_enable_by_me
let g:phpqa_messdetector_autorun = 0
let g:phpqa_codesniffer_autorun = 0
echo "Phpqa disable"
else
let g:phpqa_messdetector_autorun = 1
let g:phpqa_codesniffer_autorun = 1
echo "Phpqa enable"
endif
let g:phpqa_enable_by_me = 1 - g:phpqa_enable_by_me
echohl None
endfunction
" map to disable/enable phpqa
nnoremap <leader>q :call PhpqaEnableDisable()<cr>
""""""""""""""""""
" phpunitqf "
""""""""""""""""""
" run phpunit
function! RunPHPUnitTest(filter)
let s:bootstrapfile = getcwd() . "/test/bootstrap.php"
if a:filter
normal! T yw
let l:args = "--bootstrap " . s:bootstrapfile ." --filter " . @" . " " . bufname("%")
else
let l:args = "--bootstrap " . s:bootstrapfile ." " . bufname("%")
endif
Test(l:args)
endfunction
" maps to run phpunit
"map <leader>u :Test --bootstrap test/bootstrap.php %<cr>
map <leader>t :Test %<cr>
nnoremap <leader>f :call RunPHPUnitTestOld(0)<cr>
set shiftwidth=4
set tabstop=4
set expandtab