RicardoRamirezR/
lali-components.nvim
g4t.io

Neovim Plugin to for Navigating Laravel and Livewire Components

by Paul Redmond

LALI Components is a Neovim plugin for autocompletion of Laravel and Livewire components by community member Ricardo Ramirez.

README from RicardoRamirezR/lali-components.nvim Open on GitHub →

[!WARNING] Any issue please report it at blade-nav

[!CAUTION] There is a more comprehensive plugin, blade-nav It opens views from controllers and routes for view(), View::make(), and Route::view(). Additionally, it can generate a component using an Artisan command as an option. Sorry for any inconvenience. Why not here? My OCD wins, since blade-nav is a superset of this plugin.

Laravel / Livewire Components

lali

Features

1. Navigating to Components with gf

Using the gf command on certain component names in your code will open the corresponding component file. This feature works with the following patterns:

  • <x-name>
  • @extends('name')
  • @include('name')
  • <livewire:name>
  • @livewire('name')

If the component has an associated class, you will be prompted to choose which one to open.

2. Autocompletion with nvim-cmp

When using the Neovim completion plugin (nvim-cmp), suggestions for relevant components will appear as you type the following prefixes:

  • <x-
  • @extends
  • @include
  • <live
  • @livewire

Setup

To get started with lali-components.nvim, add the plugin to your init.lua or init.vim file:

Using packer:

use {
    'ricardoramirezr/lali-components.nvim',
    ft = 'blade'
}

Using lazy:

{
    'ricardoramirezr/lali-components.nvim',
    ft = 'blade'
}

Usage

  1. Navigating to Components: Place your cursor on the component name and press gf. If the component has multiple classes, you will be prompted to choose which one to open.

  2. Autocompletion: Start typing the component prefix (<x-, @extends, etc.) and nvim-cmp will suggest the relevant components. Select from the suggestions to complete your component names quickly.

Example

Here is an example to illustrate the usage of the plugin:

<!-- Blade Template Example -->
<x-button>Click Me</x-button>

@extends('layouts.app')

@include('partials.header')

<livewire:counter />
@livewire('counter')

In the example above, you can:

  • Place your cursor on , @extends('layouts.app'), @include('partials.header'), <livewire:counter />, or @livewire('counter') and press gf to navigate to the respective component file.
  • Start typing <x-, @extends, @include, <live, or @livewire to get autocompletion suggestions from nvim-cmp.

Contributing

Contributions are welcome! Please submit issues and pull requests to the GitHub repository.

License

This plugin is open-source and distributed under the MIT License.

More from the ecosystem

marcreichel/
laya-php
g4t.io
3 53

LayaPHP: Self-Hosted Text Classification for PHP and Laravel

Classify text in PHP without an LLM bill: typed decisions in 100+ languages, self-hosted. Laravel-ready SDK for Laya, a Jev AI alternative.

ai classification decision-engine
marcreichel/laya-php via Laravel News
Josh-Dovey/
postcodes-laravel
g4t.io
5 9

Postcodes for Laravel: GB Postcode Lookup and Geography Data

Postcodes for Laravel adds typed GB postcode lookups, validation, geography data, distance searches, and test fakes through the GB Postcodes API.

Josh-Dovey/postcodes-laravel via Laravel News
RedberryProducts/
mailbox-for-laravel
g4t.io
4 115

Mailbox for Laravel: Preview and Test Rendered Email

Mailbox for Laravel captures outgoing mail in a local dashboard and lets you test rendered HTML, recipients, and attachments with fluent assertions.

RedberryProducts/mailbox-for-laravel via Laravel News