vim-symfony/README.md

74 lines
2.1 KiB
Markdown
Raw Permalink Normal View History

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:
2013-10-09 11:38:11 -04:00
- symfony routing autocompletion
- symfony DIC autocompletion
- symfony console
- php stack trace navigation using quickfix list
2011-11-15 12:20:11 -05:00
=========================
2013-10-10 03:42:54 -04:00
## Config Variables:
2011-11-15 12:20:11 -05:00
You can overwride two variables on your .vimrc:
2011-11-15 12:20:11 -05:00
let g:symfony_app_console_caller= "php"
let g:symfony_app_console_path= "app/console"
2016-04-08 08:10:57 -04:00
You can also define this config per directory. Just add `set exrc` in your global .vimrc.
This will automatically read any `.vimrc` in the current folder (where you launched vim).
=========================
2013-10-10 03:42:54 -04:00
## Service & routing completion
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.
**Symfony interactive console**
<C-F> To open the Symfony interactive console.
If you want to change this:
let g:symfony_enable_shell_mapping = 0 "disable the mapping of symfony console
" Use your key instead of default key which is <C-F>
map *MY KEY* :execute ":!"g:symfony_enable_shell_cmd<CR>
2011-11-15 12:20:11 -05:00
=========================
2013-10-10 03:42:54 -04:00
## stack trace navigation
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
2013-10-09 11:34:17 -04:00
arguments: [ 'dev-vim-server' ] # optional vim server name, defaults to 'dev'
2011-11-15 12:20:11 -05:00
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();
2013-10-09 11:34:17 -04:00
Then launch vim using:
vim --servername dev-vim-server