Sublime Text is our editor of choice. This section will contain some useful packages that we recommend.
First you need to install Package Control in Sublime Text. Simply follow the installation instructions. After installation you can press Ctrl+Shift+P (Cmd+Shift+P under MacOS) which opens the command palette. There you will now have a set of “Package Control” commands available, e.g. Package Control: Install Package.
We recommend installing the following packages:
One of the most useful tools for PHP web development in Sublime Text ist the PHP Companion. After installation you should add the following key bindings under Preferences ยป Key Bindings:
[
{ "keys": ["f3"], "command": "implement" },
{ "keys": ["f4"], "command": "import_namespace" },
{ "keys": ["f5"], "command": "find_use" },
{ "keys": ["f6"], "command": "expand_fqcn", "args": {"leading_separator": true} },
{ "keys": ["f7"], "command": "insert_php_constructor_property" },
{ "keys": ["shift+f12"], "command": "goto_definition_scope" }
]
The commands are also described in the GitHub README, but here the description of the more important commands.
With this command you can import the current namespace. i.e., if you are in a new file called AppBundle/EventListener/SomeListener/MyListener.php, it will automatically add
namespace AppBundle\EventListener\SomeListener;
at the beginning of the PHP file.
This will add the use statement of the currently “selected” class name. Sublime Text will try to find the appropriate namespace automatically. If the result is ambiguous, it will show you a set of options. For example, if you write a class name
MyListener
and the cursor is in the middle or the end of the class name and then you hit F5, the PHP Companion will automatically add
use AppBundle\EventListener\SomeListener\MyListener;
to the PHP file.
This is similar to the find_use command, but instead of importing the use statement, PHP Companion will prepend the class nam with the “fully qualified class name”. e.g.
MyListener
will turn into
\AppBundle\EventListener\SomeListener\MyListener
The SCSS package provides correct syntax highlighting for SCSS files.
The Twig package provies syntax highlighting for Twig.