Run PHP file from within vim -


is possibly run php file within vim? im trying here having shortcut whenever need run file i'm editing skip exiting vim , calling php interpreter manually

yes! it's possible want. both running php within vim, , creating shortcut.

matthew weier o'phinney writes:

probably useful thing i've done php developer add mappings run current file through (a) php interpreter (using ctrl-m), , (b) php interpreter's linter (using ctrl-l).

vim productivity tips php developers

example:

:autocmd filetype php noremap <c-m> :w!<cr>:!/usr/bin/php %<cr> 

or (this doesn't check filetype beware)

:map <c-m> :w!<cr>:!/usr/bin/php %<cr> 

joe 'zonker' brockmeier writes:

vim allows execute command directly editor, without needing drop shell, using bang (!) followed command run. instance, if you're editing file in vim , want find out how many words in file, run

:! wc % 

vim tips: working external commands


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -