{"id":26560578,"url":"https://github.com/itspriddle/vim-laravel-projections","last_synced_at":"2025-03-22T13:18:22.985Z","repository":{"id":281288633,"uuid":"944643978","full_name":"itspriddle/vim-laravel-projections","owner":"itspriddle","description":"Laravel + projectionist.vim 🤝","archived":false,"fork":false,"pushed_at":"2025-03-16T22:26:57.000Z","size":39,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T23:27:50.212Z","etag":null,"topics":["laravel","php","vim"],"latest_commit_sha":null,"homepage":"","language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itspriddle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-07T17:57:51.000Z","updated_at":"2025-03-16T22:27:00.000Z","dependencies_parsed_at":"2025-03-08T04:26:39.955Z","dependency_job_id":null,"html_url":"https://github.com/itspriddle/vim-laravel-projections","commit_stats":null,"previous_names":["itspriddle/vim-laravel-projections"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itspriddle%2Fvim-laravel-projections","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itspriddle%2Fvim-laravel-projections/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itspriddle%2Fvim-laravel-projections/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itspriddle%2Fvim-laravel-projections/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itspriddle","download_url":"https://codeload.github.com/itspriddle/vim-laravel-projections/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244959456,"owners_count":20538629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","php","vim"],"created_at":"2025-03-22T13:18:22.302Z","updated_at":"2025-03-22T13:18:22.972Z","avatar_url":"https://github.com/itspriddle.png","language":"Vim Script","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vim-laravel-projections\n\nThis plugin provides a set of commands and basic templates for working with\nLaravel projects in Vim using [projectionist.vim][].\n\n[projectionist.vim]: https://github.com/tpope/vim-projectionist\n\n## Example Workflow\n\n- Open `vim` in your Laravel project with no arguments.\n- Open your `App\\Models\\User` model with `:Emodel U\u003ctab\u003e` (tab completing to `User`). Add a great new feature.\n- Open the corresponding test file in a vertical split with `:AV`. Add a test for your new feature.\n- Run the test file with `pest` using `:Make` (or better yet, `m\u003ccr\u003e`).\n- Press `\u003cC-w\u003e\u003cC-w\u003e` to move back to the User model window.\n- Open your `App\\Http\\Controllers\\UserController` controller with `:Tcontroller`.\n- Open the corresponding test file in a horizontal split with `:AS`.\n- Run the test again with `m\u003ccr\u003e`.\n- Start a Tinker console to diagnose some issues with `:Console`.\n- Open your web routes file with `:Eroute`.\n- Etc...\n\n## Pre-requisites\n\n- [projectionist.vim][] is required to use this plugin.\n- [dispatch.vim][] is optional if you want to can be used to leverage\n  `:Start`, `:Console`, `:Make` and `:Dispatch`.\n\nRecommended, but not required:\n\n- [composer.vim][] is recommended to use its built in support for `gf` and\n  friends. It's not all all required to use the projections in this plugin.\n\n[composer.vim]: https://github.com/noahfrederick/vim-composer\n[dispatch.vim]: https://github.com/tpope/vim-dispatch\n\n## Installation\n\nRight now, I'm trying to avoid having this plugin do anything fancy. If you\nwant, you can just copy [laravel-projections.json][] to your\nproject at `.projections.json`.\n\nIf you are using [plug.vim][] or a similar plugin manager you can add this to\nyour `vimrc`:\n\n```vim\nPlug 'tpope/vim-projectionist'\nPlug 'tpope/vim-dispatch' \" optional, but recommended\nPlug 'noahfrederick/vim-composer' \" optional, but recommended\nPlug 'itspriddle/vim-laravel-projections'\n```\n\n[laravel-projections.json]: https://raw.githubusercontent.com/itspriddle/vim-laravel-projections/refs/heads/main/plugin/laravel-projections.json\n[plug.vim]: https://github.com/junegunn/vim-plug\n\n## Commands\n\n### Base Commands\n\n- `:Console` - Open the tinker console. Requires dispatch.vim.\n- `:Start` - Open the tinker console. Requires dispatch.vim. _This isn't\n  locked in. I might use it for `composer dev`._\n\n### Entity Commands\n\n\"Entities\" are basically anything under `app/` and a few others. Pretty much\neverything that there's a `php artisan make:*` command is here.\n\nIf you're unfamiliar with projectionist, it sets up Vim commands based on the\nfile path. This means that we can run things like `:Emodel User` to open\n`app/Models/User.php`. It works with tab completion, so you can type\n`:Emodel U\u003cTab\u003e` to complete to `:Emodel User`. And when you're in other\nrelated files, like `app/Models/UserFactory.php`, you can run `:Emodel` to\njump to `app/Models/User.php`.\n\nIn addition to `:Emodel User` to `:edit app/Models/User.php`, we can also do:\n\n- `:Smodel User` will `:split app/Models/User.php` in a vertical split\n- `:Vmodel User` will `:vsplit app/Models/User.php` in a vertical split\n- `:Tmodel User` will `:tabedit app/Models/User.php` in a new tab\n- `:Dmodel User` will `:read app/Models/User.php` the template for the model\n  (defined by this plugin) and replace the current buffer's contents with it\n- `:Omodel User` will `:drop app/Models/User.php`, which opens the file in any\n  window it's already opened in\n\nThese commands all have the following variants:\n\n- `:E*` - `:edit` the destination file\n- `:S*` - `:split` the destination file\n- `:V*` - `:vsplit` the destination file\n- `:T*` - `:tabedit` the destination file\n- `:D*` - `:read` the destination file\n- `:O*` - `:drop` the destination file\n\nThe list of commands is as follows:\n\n- `:Eaction \u003carg\u003e` - Open the given action.\n- `:Ebroadcast \u003carg\u003e` - Open the given broadcast.\n- `:Ecast \u003carg\u003e` - Open the given cast.\n- `:Ecommand \u003carg\u003e` - Open the given console command.\n- `:Ecomposer` - Open `composer.json`.\n    - Call `:Make` while editing `composer.json` or `composer.lock` to run\n      `composer install` via Dispatch.\n- `:Econfig [arg]` - Open the given configuration file. With no argument\n  provided, opens `config/app.php`.\n- `:Econtroller \u003carg\u003e` - Open the given controller.\n- `:Ecss [arg]` - Open the given CSS file. With no argument provided, opens\n  `resources/css/app.css`.\n- `:Edoc [arg]` - Open the documentation file. With no argument provided,\n  opens `README.md`.\n- `:Edotenv [arg]` - Open the dotenv file for the given environment. With no\n  argument provided, opens `.env`.\n- `:Eenum \u003carg\u003e` - Open the given enum.\n- `:Eevent \u003carg\u003e` - Open the given event.\n- `:Eexception \u003carg\u003e` - Open the given exception.\n- `:Efacade \u003carg\u003e` - Open the given facade.\n- `:Efactory \u003carg\u003e` - Open the given factory.\n- `:Ejob \u003carg\u003e` - Open the given job.\n- `:Ejs [arg]` - Open the given JavaScript file. With no argument provided,\n  opens `resources/js/app.js`.\n- `:Elang \u003carg\u003e` - Open the given language file.\n- `:Elistener \u003carg\u003e` - Open the given listener.\n- `:Elivewire \u003carg\u003e` - Open the given Livewire component.\n- `:Elog \u003carg\u003e` - Open the given log file.\n- `:Email \u003carg\u003e` - Open the given mail.\n- `:Emiddleware \u003carg\u003e` - Open the given middleware.\n- `:Emigration \u003carg\u003e` - Open the given DB migration.\n    - Call `:Make` while editing a migration file to run `php artisan migrate`\n      via Dispatch for that specific migration.\n    - Call `:Dispatch` while editing a migration file to run `php artisan\n      migrate` via Dispatch for all migrations.\n- `:Emodel [arg]` - Open the given model.\n    - Call `:Emodel` without arguments from inside a factory, seeder,\n      observer, policy, or Unit test to open the model for the current file.\n- `:Enotification \u003carg\u003e` - Open the given notification.\n- `:Enpm \u003carg\u003e` - Open NPM `package.json` file.\n    - Call `:Make` while editing `package.json` or `package-lock.json` to run\n      `npm install` via Dispatch.\n- `:Eobserver \u003carg\u003e` - Open the given observer.\n- `:Epolicy \u003carg\u003e` - Open the given policy.\n- `:Eprovider [arg]` - Open the given provider. With no argument provided,\n  opens `AppServiceProvider`.\n- `:Erepository \u003carg\u003e` - Open the given repository.\n- `:Erequest \u003carg\u003e` - Open the given form request.\n- `:Eresource \u003carg\u003e` - Open the given API resource.\n- `:Eresponse \u003carg\u003e` - Open the given HTTP response.\n- `:Eroute [arg]` - Open the given route file. With no argument provided,\n  opens `web`.\n- `:Erule \u003carg\u003e` - Open the given rule.\n- `:Escope \u003carg\u003e` - Open the given scope.\n- `:Escript \u003carg\u003e` - Open the given script.\n- `:Eseeder [arg]` - Open the given seeder. With no argument provided, opens\n  `DatabaseSeeder`.\n    - Call `:Make` while editing a seeder file to run `php artisan db:seed`\n      via Dispatch for that specific seeder.\n    - Call `:Dispatch` while editing a seeder file to run `php artisan seed`\n      via Dispatch for the default `DatabaseSeeder`.\n- `:Eservice \u003carg\u003e` - Open the given service.\n- `:Etailwind` - Open the Tailwind CSS configuration file.\n- `:Etest \u003carg\u003e` - Open the given test.\n    - Call `:Dispatch` or `:Make` while editing a test file to run the test\n      with `php artisan test {file}` via Dispatch.\n- `:Etrait \u003carg\u003e` - Open the given trait.\n- `:Eview \u003carg\u003e` - Open the given view.\n- `:Evite` - Open the Vite configuration file.\n    - Run `:Make` while editing `vite.config.js` to run `npm run build` via\n      Dispatch.\n    - Run `:Start` while editing `vite.config.js` to run `npx run dev` via\n      Dispatch.\n- `:Eworkflow [arg]` - Open the given GitHub workflow. With no argument\n  provided, opens `.github/workflows/ci.yml`.\n\n## Alternate Files\n\nAlternate files allow you to use `:A` to switch between the main file and an\nalternate. A common use case is to switch between a class and its test file.\n\n- `app/*.php` - Open the corresponding test file under `tests/Feature/` or\n  `tests/Unit/`.\n- `tests/{Feature,Unit}/*Test.php` - Open the corresponding class file under\n  `app/`.\n- `routes/web.php` - Open the API route file (`routes/api.php`).\n- `.env` - Open the `.env.example` file.\n    - `.env.example` - Open the `.env` file.\n- `composer.json` - Open `composer.lock`.\n    - `composer.lock` - Open `composer.json`.\n- `package.json` - Open `package-lock.json`.\n    - `package-lock.json` - Open `package.json`.\n\nThis also lets you access `:E*` projection commands for the alternate file.\n\nFor example, if you are editing `app/Models/User.php`, you can use `:Etest` to\nswitch to `tests/Feature/Models/UserTest.php`; from in `UserTest.php`, you can\nuse `:Emodel` to switch back to `app/Models/User.php`.\n\n- `app/*.php`:\n    - `:Etest`\n- `app/Models/`:\n    - `:Efactory`\n    - `:Eseeder`\n    - `:Eobserver`\n    - `:Epolicy`\n\n## Templates\n\nA few templates are provided for creating new files through Projectionist.\nThat happens when you use an `:E*` command for a file that doesn't exist yet,\nor use `:A` to switch to a non-existent alternate file. If you manually create\na file, you can run `:AD` to replace the buffer contents with the new file\ntemplate.\n\nBy default, `*.php` files will just contain a `declare(strict_types=1);`\nstatement at the top.\n\nFiles under `app/*.php` will also include a namespace declaration based on the\nfile path. For example, creating a new file `app/Models/User.php` will include\nthe line `namespace App\\Models;`.\n\n## License\n\nMIT License - see [`LICENSE`](./LICENSE) in this repo.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitspriddle%2Fvim-laravel-projections","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitspriddle%2Fvim-laravel-projections","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitspriddle%2Fvim-laravel-projections/lists"}