Skip to content

A Sublime Text 2 package that integrates the symfony 2 console right into your editor.

Notifications You must be signed in to change notification settings

neoshadybeat/Sublime-SymfonyCommander

 
 

Repository files navigation

SymfonyCommander

Integration of the Symfony 2 console right into Sublime Text 2

This Sublime Text 2 package integrates the most common Symfony 2 console commands right into your lovely editor of choice ™. Additional you get some great little helpers for writing Symfony2 code.

It provides the following features:

  • Switching between Template and the corresponding Controller/Action
  • Autocompletion for routing and service names
  • Searching within the online api and the online documentation
  • Clear the cache
  • Warmup an empty cache
  • Assetic: Dump all assets to the filesystem
  • Install bundles web assets under the public web directory
  • Display current routes for an application
  • Displays current services for an application
  • Send emails from the spool
  • Doctrine: Clear result cache
  • Doctrine: Clear query cache
  • Doctrine: Clear meta cache

More commands are on the way. If you want to be informed about new versions of this plugin just watch this repro on github or watch out for some tweets.

If you need some Symfony code snippets in addition to this package just install sublime-symfony2. It is a great package for speed up your Symfony 2 development as well.

Changelog

2012-05-24:

  • Restructuring and cleanup some code.
  • Added autocompletion for routing and service names.
  • Fixed wrong command name (thanks to @iamthes)
  • Fixed Shortkey bug

2012-05-09:

  • Added function to switch between Action and corresponding template file

2012-05-04:

  • New features: Clear Doctrine caches an show mapping info

2012-05-03:

  • Added container:debug as a command

2012-04-18:

  • First published Version

Usage

Command Palette

Command Palette

Open the Command Palette with the shortcut Command+Shift+P on OS X or Control+Shift+P otherwise. Alternative you can open the Command Palette in the menu (Tools -> Command Palette...).

Speed up tip:

You don't need to type the complete command (SymfonyCommander...) in the Command Palette to get to to the right command. For example if you type something short like sccl you get directly to the SymfonyCommander cache:clear commands.

Context menu or main menu

You can call the Symfony commands through the context menu of an file or the main menu Tools -> SymfonyCommander.

Contextmenu

Shortcuts

SymfonyCommader has some shortcuts defined:

  • To switch between a Controller Action an the corresponding Template you can use ctrl+alt+s on Windows and Linux or alt+super+s on OS X. At the moment this only works, if the names of your Action an the corresponding template are matching the naming conventions and you are using Twig (for example indexAction and index.html.twig).
  • To clear the cache in the development environment just type ctrl+alt+c on Windows and Linux or alt+super+c on OS X.

You can of cause change or add shortcuts in the user settings.

Autocompletion

With SymfonyCommander you get autocompletion for routes and service names while you are typing.

In addition, there are two commands SymfonyCommander Select Route and SymfonyCommander Select Service in the Command Palette for selecting an entry with more Infos:

Select a service

Select a route

Info: For performance reasons the routes and service names are cached internally. To flush the cache just call the command SymfonyCommander Flush Cache over the Command Palette.

Install

Installation with Package Control (recommended)

  1. The easiest way to install SymfonyCommander is through Package Control, which can be found here.

  2. After the installation of Package Control bring up the Command Palette (Command+Shift+P on OS X, Control+Shift+P otherwise). Select "Package Control: Install Package" and wait until the list with all available packages will appear.

  3. Than select "SymfonyCommander".

Package Control will automatically keep SymfonyCommander up to date with the latest version.

Installation with git

Clone this repository in your Sublime Packages directory which you can find here:

  • OS X : ~/Library/Application Support/Sublime Text 2/Packages/
  • Linux: ~/.Sublime Text 2/Packages/
  • Windows: %APPDATA%/Sublime Text 2/Packages/

Configuration

Global settings

Settings can be configured with a SymfonyCommander.sublime-settings file in your User folder. You can copy the one provided in this package.

{
	"php_command": "/usr/bin/php",
	"api_search_version": "master",
	"doc_search_version": "master"
}

php_command: With php_command you can define where SymfonyCommander can find the php binary. If it is false than SymfonyCommader calls the Symfony console directly without php binary (works well on OS X an Linux). Otherwise you can point php_command to the php binary path, for example C:\php\php.exe or /usr/bin/php. The default is false.

api_search_version: This setting determines which version of the symfony api should be used for searching, could be master or something like v2.0.14. The default is master.

doc_search_version: This setting determines which version of the symfony online documentation should be used for searching, could be either master or 2.0. The default is master.

Project specific settings

SymfonyCommander tries to find the Symfony app/console script automatically. Therefor SymfonyCommander takes the active file an traverses the directory path up and searches for app/console. This works in most cases.

Otherwise you have to tell SymfonyCommander where to find the console script on a project basis. To point SymfonyCommander to the root directory of your Symfony installation you need to set this path in the Sublime Text Project file (*.sublime-project) under the settings-section.

"settings":{
	"SymfonyCommander":{
		"base_directory": "/www/htdocs/your-symfony-project/"
	}
}

License

MIT License

Copyright (c) 2012 Patrick Daether, public < at > pd-digital.de

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

A Sublime Text 2 package that integrates the symfony 2 console right into your editor.

Resources

Stars

Watchers

Forks

Packages

No packages published