2016-02-29 51 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