Vim RecallEnglish

過濾行或執行外部指令

:!

範例

一般模式 0 / 3

過濾行或執行外部指令。

Shell 內容

shell
/bin/sh
上一個外部指令
printf hello

外部輸出

stdout
操作前後

操作前

Shell 內容

shell
/bin/sh
上一個外部指令
printf hello

外部輸出

stdout

操作後

Shell 內容

shell
/bin/sh
已執行指令
printf hello

外部輸出

stdout
hello

根據文件繪製。假設使用支援 printf 的 POSIX shell,允許執行外部指令,且有畫面所示的指令歷史(:! 和 :!!)。此處只顯示範例資料。外殼指令印出 hello,而編輯緩衝區保持不變。主要說明::!。

範例緩衝區
alpha
beta
gamma
游標位於第 1 行,第 1 欄
詳細說明與 Vim 文件

本例輸入 :!printf hello 後按 Enter。