1
1
" =============================================================================
2
- " File: php-cs-fixer .vim
2
+ " File: autoload/php_cs_fixer .vim
3
3
" Author: Stéphane PY
4
4
5
- if exists (" g:vim_php_cs_fixer" ) || &cp
6
- finish
7
- endif
8
- let g: vim_php_cs_fixer = 1
9
-
10
5
" Global options definition."{{{
11
6
let g: php_cs_fixer_path = get (g: , ' php_cs_fixer_path' , ' ~/php-cs-fixer.phar' )
12
7
let g: php_cs_fixer_php_path = get (g: , ' php_cs_fixer_php_path' , ' php' )
@@ -27,9 +22,6 @@ if g:php_cs_fixer_version >= 2
27
22
else
28
23
let g: php_cs_fixer_level = get (g: , ' php_cs_fixer_level' , ' symfony' )
29
24
endif
30
- let g: php_cs_fixer_enable_default_mapping = get (g: , ' php_cs_fixer_enable_default_mapping' , ' 1' )
31
- let g: php_cs_fixer_dry_run = get (g: , ' php_cs_fixer_dry_run' , 0 )
32
- let g: php_cs_fixer_verbose = get (g: , ' php_cs_fixer_verbose' , 0 )
33
25
34
26
if g: php_cs_fixer_version == 1
35
27
if exists (' g:php_cs_fixer_config' )
@@ -50,7 +42,7 @@ if exists('g:php_cs_fixer_cache')
50
42
endif
51
43
" }}}
52
44
53
- fun ! PhpCsFixerFix (path , dry_run)
45
+ fun ! php_cs_fixer#fix (path , dry_run)
54
46
55
47
if ! executable (' php-cs-fixer' )
56
48
if ! filereadable (expand (g: php_cs_fixer_path ))
@@ -127,18 +119,3 @@ fun! PhpCsFixerFix(path, dry_run)
127
119
endif
128
120
endif
129
121
endfun
130
-
131
- fun ! PhpCsFixerFixDirectory ()
132
- call PhpCsFixerFix (expand (' %:p:h' ), g: php_cs_fixer_dry_run )
133
- endfun
134
-
135
- fun ! PhpCsFixerFixFile ()
136
- call PhpCsFixerFix (expand (' %:p' ), g: php_cs_fixer_dry_run )
137
- endfun
138
-
139
- if (g: php_cs_fixer_enable_default_mapping == 1 )
140
- nnoremap <silent> <leader> pcd :call PhpCsFixerFixDirectory()<CR>
141
- nnoremap <silent> <leader> pcf :call PhpCsFixerFixFile()<CR>
142
- endif
143
-
144
- " vim: foldmethod = marker
0 commit comments