2011-11-15 12:05:06 -05:00
|
|
|
Symfony2 plugin for ViM
|
2011-11-15 12:20:11 -05:00
|
|
|
=======================
|
2011-11-15 12:05:06 -05:00
|
|
|
|
2011-11-15 12:20:11 -05:00
|
|
|
This plugin handles:
|
|
|
|
* symfony routing autocompletion
|
|
|
|
* symfony DIC autocompletion
|
2012-02-09 15:04:14 -05:00
|
|
|
* symfony console
|
2011-11-15 12:20:11 -05:00
|
|
|
* php stack trace navigation using quickfix list
|
|
|
|
|
|
|
|
=========================
|
|
|
|
|
2012-02-10 10:14:17 -05:00
|
|
|
Variables:
|
2011-11-15 12:20:11 -05:00
|
|
|
|
2012-02-10 10:14:17 -05:00
|
|
|
You can overwride two variables on your .vimrc:
|
2011-11-15 12:20:11 -05:00
|
|
|
|
2012-02-10 10:26:20 -05:00
|
|
|
let g:symfony_app_console_caller= "php"
|
|
|
|
let g:symfony_app_console_path= "app/console"
|
2012-02-09 15:04:14 -05:00
|
|
|
|
|
|
|
=========================
|
|
|
|
|
2012-02-10 10:14:17 -05:00
|
|
|
To handle routing or DIC autocompletion, you must define the path to your app console that returns valid output concerning dic and routing.
|
|
|
|
|
|
|
|
Then you can use <C-x><C-u> (user completion feature) to see all routes and DIC services with some extra informations in the ViM's menu popup.
|
2012-02-09 15:04:14 -05:00
|
|
|
|
2012-02-10 10:26:20 -05:00
|
|
|
**Symfony interactive console**
|
|
|
|
|
2012-02-10 10:58:31 -05:00
|
|
|
<C-F> To open the Symfony interactive console.
|
2012-02-10 10:26:20 -05:00
|
|
|
|
|
|
|
If you want to change this:
|
|
|
|
|
|
|
|
let g:symfony_enable_shell_mapping = 0 "disable the mapping of symfony console
|
|
|
|
|
2012-02-10 10:58:31 -05:00
|
|
|
" Use your key instead of default key which is <C-F>
|
2012-02-10 10:26:20 -05:00
|
|
|
map *MY KEY* :execute ":!"g:symfony_enable_shell_cmd<CR>
|
|
|
|
|
2012-02-10 10:14:17 -05:00
|
|
|
|
2012-02-09 15:04:14 -05:00
|
|
|
|
2011-11-15 12:20:11 -05:00
|
|
|
=========================
|
|
|
|
|
|
|
|
To handle stack trace navigation with Symfony2, you can use this exception handler class:
|
|
|
|
|
|
|
|
https://github.com/docteurklein/vim-symfony/blob/master/VimExceptionHandler.php
|
|
|
|
|
|
|
|
Don't forget to require it in your autoload system.
|
|
|
|
|
|
|
|
Then you'll have to register the exception listener, for example (in your config_dev.yml):
|
|
|
|
|
|
|
|
services:
|
|
|
|
vim.stack_trace:
|
|
|
|
class: VimExceptionHandler
|
|
|
|
tags:
|
|
|
|
- { name: 'kernel.event_listener', event: 'kernel.exception', method: 'onKernelException' }
|
|
|
|
|
|
|
|
To use it in another system, just use the same class by typing:
|
|
|
|
|
|
|
|
// require 'VimExceptionHandler.php'
|
|
|
|
VimExceptionHandler::register();
|
2012-02-10 10:14:17 -05:00
|
|
|
|
2012-02-10 10:26:20 -05:00
|
|
|
|