|
2
|
1 syntax on
|
|
|
2 set tabstop=2
|
|
|
3 set shiftwidth=2
|
|
|
4 set softtabstop=2
|
|
|
5 set autoindent
|
|
|
6 set smartindent
|
|
|
7 "set termguicolors
|
|
|
8 "set number
|
|
|
9 nnoremap <Leader>cc :set colorcolumn=80<cr>
|
|
|
10 nnoremap <Leader>ncc :set colorcolumn-=80<cr>
|
|
12
|
11 nnoremap <C-l> :ALECodeAction <cr>
|
|
2
|
12 set mouse=a
|
|
|
13
|
|
|
14 function! FixPhpFiles()
|
|
|
15 " Save the current cursor position
|
|
|
16 let save_cursor = getpos(".")
|
|
|
17
|
|
|
18 "Format the files
|
|
|
19 let command = 'php-cs-fixer fix .'
|
|
|
20 let output = system(command)
|
|
|
21 " Reload the file and restore the cursor position
|
|
|
22 execute 'edit!'
|
|
|
23 call setpos(".", save_cursor)
|
|
|
24 endfunction
|
|
|
25
|
|
|
26 nnoremap <leader>f :call FixPhpFiles()<CR>
|
|
|
27
|
|
|
28 " Committing commands
|
|
|
29 map <C-k> :wa<CR>:!hg addremove && hg commit <CR>
|
|
|
30
|