2016-08-14 42 views
-1

一個簡單的php文件被編輯在/var/www/html/tmp/test.php。爲什麼firefox無法在vim中解析我的php?

<html> 
<p>haha</p> 
<?php 
echo "test"; 
?> 
</html> 

在firefox中用firefox打開它127.0.0.1/tmp/test.php。

enter image description here
F12被映射到執行火狐解析PHP文件在/ etc/VIM /的vimrc。

nmap <F12>f :!firefox 'http://127.0.0.1/tmp/%'<CR> 

現在到vim /var/www/html/tmp/test.php並按F12。
發生了一個難以置信的反應。
1.firefox根本沒有被調用。
2.chrome開放反應,結果錯誤。

enter image description here

+0

你是什麼defaumt瀏覽器? –

回答

1

我至少可以看到一對夫婦的事情是錯誤的。

一,你寫的映射是<F12>˚F這將是F12,然後按字母F.

二,的相對路徑擴展到該文件,在這種情況下/var/www/html/tmp/test.php你'從主目錄執行vim。您正在尋找擴張實際上是%:t

:help expand

+0

nmap :!firefox'http://127.0.0.1/tmp/%:t'

+0

你去了:) – iovis

相關問題