vim-laravel icon indicating copy to clipboard operation
vim-laravel copied to clipboard

:Artisan in new window

Open s-widerberg opened this issue 4 years ago • 1 comments

Thanks for this plugin! It's really helped speed up my dev workflow.

I'm still pretty new to vim, so I'm not sure I'll explain this with the correct terminology.

My development usually starts like:

cd repo-to-work-on
vim .

At some point I'll want to make a new test/model/migration/something. So I usually will open a new window: <C-w> n At this point, unfortunately it seems it's not detecting that I'm inside a Laravel ecosystem, so :Artisan will complain:

E492: Not an editor command: Artisan

I've tried to understand the detection process but this is a bit over my head right now. Am I misunderstanding something? Is there a way to get this to work for my use case?

s-widerberg avatar Feb 23 '21 23:02 s-widerberg

The plug-in is only activated for buffers that are actual files in a Laravel project (and it doesn't care about your current working directory), whereas <C-w>n creates a new, empty buffer not associated with an extant file. I recommend using <C-w>s and <C-w>v to create horizontally and vertically split windows respectively as a workaround, or use :sp|Artisan and :vs|Artisan for the same effect.

The reason the plug-in works this way is that, among other well-known plug-ins, Fugitive (Git client) also used to work this way. But now Fugitive is also activated for new buffers when the current working directory is a Git repository or is a subdirectory of one, which is a nice convenience that we should probably add.

noahfrederick avatar Feb 25 '21 19:02 noahfrederick