2016-02-29 37 views

回答

6

命令

)3:wq!<CR>

輸入

Leave only the 
numbered lines. 
LINE 1 
LINE 2 
LINE 3 
That's all. 
Thank you 
very much. 

擊穿

)  goes one sentence forward. This positions the cursor at LINE 1 
3  starts a range of 3 lines for the next command. 
:wq! writes the range to the file. 
     You should notice that when typing :, the range get's set to .,.+2 

我不知道在哪裏放置:,因爲它從普通模式切換到命令模式,以便以下故障同樣有效

)  goes one sentence forward. This positions the cursor at LINE 1 
3:  starts a range of 3 lines and enters command line mode 
wq! writes the range to the file. 
     You should notice that when typing :, the range get's set to .,.+2 
3
  • )把光標當前句子後,上LINE 1

  • 3:command由Vim擴展到:.,.+2command,表示「在當前行和下兩行執行command」。

  • .,.+2wq!只將給定的行寫入文件,從緩衝區/文件中有效地刪除任何其他行。

請參閱:help range:help :write