diff --git a/README b/README index 0162d37..014fe27 100644 --- a/README +++ b/README @@ -13,8 +13,8 @@ Variables: You can overwride two variables on your .vimrc: - let g:SymfonyAppConsoleCaller = "php" - let g:SymfonyAppConsolePath = "app/console" + let g:symfony_app_console_caller= "php" + let g:symfony_app_console_path= "app/console" ========================= @@ -22,8 +22,18 @@ To handle routing or DIC autocompletion, you must define the path to your app co Then you can use (user completion feature) to see all routes and DIC services with some extra informations in the ViM's menu popup. +**Symfony interactive console** + + 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 + map *MY KEY* :execute ":!"g:symfony_enable_shell_cmd + - To open the Symfony interactive console. ========================= @@ -46,3 +56,4 @@ To use it in another system, just use the same class by typing: // require 'VimExceptionHandler.php' VimExceptionHandler::register(); + diff --git a/plugin/symfonycomplete.vim b/plugin/symfonycomplete.vim index 9c39be4..d5c509b 100644 --- a/plugin/symfonycomplete.vim +++ b/plugin/symfonycomplete.vim @@ -1,13 +1,17 @@ -if !exists("g:SymfonyAppConsolePath") - let g:SymfonyAppConsolePath = "app/console" +if !exists("g:symfony_app_console_path") + let g:symfony_app_console_path = "app/console" endif -if !exists("g:SymfonyAppConsoleCaller") - let g:SymfonyAppConsoleCaller = "php" +if !exists("g:symfony_app_console_caller") + let g:symfony_app_console_caller = "php" +endif + +if !exists("g:symfony_enable_shell_mapping") + let g:symfony_enable_shell_mapping = 1 endif fun! CompleteSymfonyContainer(base, res) - let shellcmd = g:SymfonyAppConsoleCaller. ' '.g:SymfonyAppConsolePath.' container:debug' + let shellcmd = g:symfony_app_console_caller. ' '.g:symfony_app_console_path.' container:debug' let output = system(shellcmd) if v:shell_error return 0 @@ -26,7 +30,7 @@ fun! CompleteSymfonyContainer(base, res) endfun fun! CompleteSymfonyRouter(base, res) - let shellcmd = g:SymfonyAppConsoleCaller. ' '.g:SymfonyAppConsolePath.' router:debug' + let shellcmd = g:symfony_app_console_caller. ' '.g:symfony_app_console_path.' router:debug' let output = system(shellcmd) if v:shell_error return 0 @@ -65,5 +69,8 @@ set completefunc=CompleteSymfony " Open console -let cmd = g:SymfonyAppConsoleCaller." ".g:SymfonyAppConsolePath." -s" -map :execute ":!"cmd +let g:symfony_enable_shell_cmd = g:symfony_app_console_caller." ".g:symfony_app_console_path." -s" + +if(g:symfony_enable_shell_mapping == 1) + map :execute ":!"g:symfony_enable_shell_cmd +endif