" coc.nvim let g:coc_global_extensions = [ \ 'coc-json' \, 'coc-lists' \, 'coc-eslint' \, 'coc-tsserver' \, 'coc-diagnostic' \, 'coc-vimlsp' \, 'coc-git' \, 'coc-github-users' \, '@yaegassy/coc-intelephense' \, '@yaegassy/coc-laravel' \, '@yaegassy/coc-phpstan' \, '@yaegassy/coc-typescript-vue-plugin' \, 'coc-swagger' \, '@yaegassy/coc-volar-tools' \, '@yaegassy/coc-volar' \, 'coc-php-cs-fixer' \, 'coc-fzf-preview' \, 'coc-sh' \, 'coc-yaml' \, 'coc-blade' \, 'coc-deno' \, 'coc-markdownlint' \ ] "\, 'coc-sql' "\, 'coc-db' "\, 'coc-phpactor' let g:markdown_fenced_languages = [ \ 'vim', \ 'help' \] " " Remap keys for gotos " nmap cd (coc-definition) " nmap cy (coc-type-definition) " nmap ci (coc-implementation) " nmap cr (coc-references) " nmap cn (coc-rename) " nmap cf (coc-format) " vmap cf (coc-format) " nmap R (coc-refactor) " " nnoremap cla :CocFzfList diagnostics " nnoremap clb :CocFzfList diagnostics --current-buf " nnoremap clc :CocFzfList commands " nnoremap cle :CocFzfList extensions " nnoremap cls :CocFzfList symbols " nnoremap clS :CocFzfList services " nnoremap clp :CocFzfListResume " " autocmd FileType php,typescript,python,markdown,javascript,vim nnoremap o :CocFzfList outline " " nmap caA (coc-codeaction) " nmap cal (coc-codeaction-line) " xmap cas (coc-codeaction-selected) " nmap caa (coc-codeaction-cursor) let g:coc_fzf_opts = ['--layout=reverse'] let g:fzf_layout = { 'up': '~40%' } let g:fzf_layout = { 'window': { 'width': 0.7, 'height': 0.6,} } " Use K to show documentation in preview window nnoremap ck :call show_documentation() function! s:show_documentation() if (index(['vim','help'], &filetype) >= 0) execute 'h '.expand('') else call CocAction('doHover') endif endfunction augroup command_window function! ReInitCoc() execute("CocDisable") execute("CocEnable") endfunction autocmd CmdwinEnter * startinsert autocmd CmdwinEnter * call ReInitCoc() augroup END " for PHP " autocmd BufWritePre *.php call CocAction('format') " " function! CustomPhpFormat() " " 現在のファイル名が '*.blade.php' で終わるかどうかをチェック " if expand('%:t') !~ '\.blade\.php$' " " '*.blade.php' で終わらない場合はフォーマットを実行 " call CocAction('format') " endif " endfunction " " PHPファイルを保存前にCustomPhpFormat関数を呼び出す " autocmd BufWritePre *.php call CustomPhpFormat()