<commit_before>" ALE
"-----

" Set phpcs standard
let g:ale_php_phpcs_standard = 'PSR12'
" Set phpstan to level 5
let g:ale_php_phpstan_level = 5

" PHPActor
"----------

" Include use statement
autocmd FileType php nmap <buffer> <silent> <Leader>u :call phpactor#UseAdd()<CR>
" Invoke the context menu
autocmd FileType php nmap <buffer> <silent> <Leader>mm :call phpactor#ContextMenu()<CR>
" Goto definition of class or class member under the cursor
autocmd FileType php nmap <buffer> <silent> <C-]> :call PhpGoToDefinition()<CR>

if !exists('*PhpGoToDefinition')
    " Without the exists check, we end up trying to redefine the function
    " while it is in use when we open another PHP file by jumping to a
    " definition in said file, causing an error.
    function! PhpGoToDefinition ()
        call phpactor#GotoDefinition()
        " In case PHPActor can't find a definition, try CoC instead.  If
        " PHPActor succeeds, this will still be called but nothing happens as
        " we've already jumped to the definition.  Haven't figured out yet how
        " to detect the error from PHPActor to make this conditional.
        call CocAction('jumpDefinition')
    endfunction
endif<commit_msg>Set lines in php files to wrap at 120 chars<commit_after>" ALE
"-----

" Set phpcs standard
let g:ale_php_phpcs_standard = 'PSR12'
" Set phpstan to level 5
let g:ale_php_phpstan_level = 5

" PHPActor
"----------

" Include use statement
autocmd FileType php nmap <buffer> <silent> <Leader>u :call phpactor#UseAdd()<CR>
" Invoke the context menu
autocmd FileType php nmap <buffer> <silent> <Leader>mm :call phpactor#ContextMenu()<CR>
" Goto definition of class or class member under the cursor
autocmd FileType php nmap <buffer> <silent> <C-]> :call PhpGoToDefinition()<CR>

if !exists('*PhpGoToDefinition')
    " Without the exists check, we end up trying to redefine the function
    " while it is in use when we open another PHP file by jumping to a
    " definition in said file, causing an error.
    function! PhpGoToDefinition ()
        call phpactor#GotoDefinition()
        " In case PHPActor can't find a definition, try CoC instead.  If
        " PHPActor succeeds, this will still be called but nothing happens as
        " we've already jumped to the definition.  Haven't figured out yet how
        " to detect the error from PHPActor to make this conditional.
        call CocAction('jumpDefinition')
    endfunction
endif

" Misc
"------

" Wrap lines at 120 characters
setlocal textwidth=120
{'fraction_non_alphanumeric': 0.08667992047713717, 'fraction_numerical': 0.006759443339960238, 'mean_word_length': 3.59963436928702, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6920894', 'n_tokens_mistral': 798, 'n_tokens_neox': 749, 'n_words': 312}