是!你可以做你想做的事.都从vim中运行PHP,并创建一个快捷方式.
Matthew Weier O’Phinney写道:
Probably the most useful thing I’ve
done as a PHP developer is to add
mappings to run the current file
through (a) the PHP interpreter (using
Ctrl-M),and (b) the PHP interpreter’s
linter (using Ctrl-L).
Vim Productivity Tips for PHP Developers
例:
:autocmd FileType PHP noremap <C-M> :w!<CR>:!/usr/bin/PHP %<CR>
或者(这不检查文件类型要小心)
:map <C-M> :w!<CR>:!/usr/bin/PHP %<CR>
Joe’Zonker’Brockmeier写道:
Vim also allows you to execute a
command directly from the editor,
without needing to drop to a shell,by
using bang (!) followed by the command
to be run. For instance,if you’re
editing a file in Vim and want to find
out how many words are in the file,
run
:! wc %