Home

Awesome

coc-laravel

Laravel extension for coc.nvim.

Install

CocInstall:

:CocInstall @yaegassy/coc-laravel

scoped packages

vim-plug:

Plug 'yaegassy/coc-laravel', {'do': 'yarn install --frozen-lockfile'}

Features

Note:

This coc-extension executes artisan commands in the background for some features. Therefore, you must be able to run PHP in your environment.


This coc-extension will provide various completion features and more features for Laravel projects.

[RECOMMENDED] Additional installation of "watchman"

coc-laravel uses the workspace/didChangeWatchedFiles notification to monitor files in the project.

In coc.nvim, it is recommended to install watchman in order to utilize this feature.

If you have difficulty installing watchman, you can use coc-laravel without watchman, but you may not be able to immediately use IntelliSense with the newly added files.

In this case, please manually enter the following command.

or

workspaceFolders

Depending on the project like mono repo or how Vim/Neovim is started, workspaceFolders may not be recognized correctly.

To make coc.nvim recognize workspaceFolders correctly, you can set b:coc_root_patterns in .vimrc/init.vim

Example:

  au FileType php,blade let b:coc_root_patterns = ['.git', '.env', 'composer.json', 'artisan']

For more information, check this coc.nvim's wiki.

Configuration options

Commands

CodeActions

Example key mapping (Code Action related):

nmap <silent> ga <Plug>(coc-codeaction-line)
nmap <silent> <leader>ac <Plug>(coc-codeaction-cursor)

Actions:

Recommended coc-extensions for php

Inspired Projects

Thanks

License

MIT


This extension is built with create-coc-extension